mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
sm: Silence some output on --quiet
* sm/encrypt.c (gpgsm_encrypt): Take care of --quiet. * sm/gpgsm.c: Include minip12.h. (set_debug): Call p12_set_verbosity. * sm/import.c (parse_p12): Dump keygrip only in debug mode. * sm/minip12.c (opt_verbose, p12_set_verbosity): New. (parse_bag_encrypted_data): Print info messages only in verbose mode. -- GnuPG-bug-id: 4757
This commit is contained in:
parent
33aaa37e5b
commit
615d2e4fb1
@ -840,6 +840,7 @@ gpgsm_encrypt (ctrl_t ctrl, certlist_t recplist, int data_fd, estream_t out_fp)
|
||||
goto leave;
|
||||
}
|
||||
audit_log (ctrl->audit, AUDIT_ENCRYPTION_DONE);
|
||||
if (!opt.quiet)
|
||||
log_info ("encrypted data created\n");
|
||||
|
||||
leave:
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include "../common/asshelp.h"
|
||||
#include "../common/init.h"
|
||||
#include "../common/compliance.h"
|
||||
|
||||
#include "minip12.h"
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
@ -768,6 +768,10 @@ set_debug (void)
|
||||
|
||||
if (opt.debug)
|
||||
parse_debug_flag (NULL, &opt.debug, debug_flags);
|
||||
|
||||
/* minip12.c may be used outside of GnuPG, thus we don't have the
|
||||
* opt structure over there. */
|
||||
p12_set_verbosity (opt.verbose);
|
||||
}
|
||||
|
||||
|
||||
|
@ -881,6 +881,7 @@ parse_p12 (ctrl_t ctrl, ksba_reader_t reader, struct stats_s *stats)
|
||||
log_error ("can't calculate keygrip\n");
|
||||
goto leave;
|
||||
}
|
||||
if (DBG_X509)
|
||||
log_printhex (grip, 20, "keygrip:");
|
||||
|
||||
/* Convert to canonical encoding using a function which pads it to a
|
||||
|
13
sm/minip12.c
13
sm/minip12.c
@ -142,6 +142,16 @@ struct tag_info
|
||||
};
|
||||
|
||||
|
||||
static int opt_verbose;
|
||||
|
||||
|
||||
void
|
||||
p12_set_verbosity (int verbose)
|
||||
{
|
||||
opt_verbose = verbose;
|
||||
}
|
||||
|
||||
|
||||
/* Wrapper around tlv_builder_add_ptr to add an OID. When we
|
||||
* eventually put the whole tlv_builder stuff into Libksba, we can add
|
||||
* such a function there. Right now we don't do this to avoid a
|
||||
@ -928,6 +938,7 @@ parse_bag_encrypted_data (const unsigned char *buffer, size_t length,
|
||||
else
|
||||
goto bailout;
|
||||
|
||||
if (opt_verbose)
|
||||
log_info ("%lu bytes of %s encrypted text\n",ti.length,
|
||||
is_pbes2?"AES128":is_3des?"3DES":"RC2");
|
||||
|
||||
@ -1026,6 +1037,7 @@ parse_bag_encrypted_data (const unsigned char *buffer, size_t length,
|
||||
{
|
||||
int len;
|
||||
|
||||
if (opt_verbose)
|
||||
log_info ("processing simple keyBag\n");
|
||||
|
||||
/* Fixme: This code is duplicated from parse_bag_data. */
|
||||
@ -1109,6 +1121,7 @@ parse_bag_encrypted_data (const unsigned char *buffer, size_t length,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (opt_verbose)
|
||||
log_info ("processing certBag\n");
|
||||
if (parse_tag (&p, &n, &ti))
|
||||
goto bailout;
|
||||
|
@ -22,6 +22,9 @@
|
||||
|
||||
#include <gcrypt.h>
|
||||
|
||||
|
||||
void p12_set_verbosity (int verbose);
|
||||
|
||||
gcry_mpi_t *p12_parse (const unsigned char *buffer, size_t length,
|
||||
const char *pw,
|
||||
void (*certcb)(void*, const unsigned char*, size_t),
|
||||
|
Loading…
x
Reference in New Issue
Block a user