aboutsummaryrefslogtreecommitdiffstats
path: root/sm/minip12.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-02-24 07:40:06 +0000
committerWerner Koch <[email protected]>2021-02-24 07:40:06 +0000
commit615d2e4fb15859320ea0ebec1bb457c692c57f0a (patch)
tree34c7f56a8298204e4265008263625de01334139a /sm/minip12.c
parentscd:p15: Make it code work again for D-Trust cards. (diff)
downloadgnupg-615d2e4fb15859320ea0ebec1bb457c692c57f0a.tar.gz
gnupg-615d2e4fb15859320ea0ebec1bb457c692c57f0a.zip
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
Diffstat (limited to 'sm/minip12.c')
-rw-r--r--sm/minip12.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/sm/minip12.c b/sm/minip12.c
index 26d77f426..a7537f06f 100644
--- a/sm/minip12.c
+++ b/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,8 +938,9 @@ parse_bag_encrypted_data (const unsigned char *buffer, size_t length,
else
goto bailout;
- log_info ("%lu bytes of %s encrypted text\n",ti.length,
- is_pbes2?"AES128":is_3des?"3DES":"RC2");
+ if (opt_verbose)
+ log_info ("%lu bytes of %s encrypted text\n",ti.length,
+ is_pbes2?"AES128":is_3des?"3DES":"RC2");
plain = gcry_malloc_secure (ti.length);
if (!plain)
@@ -1026,7 +1037,8 @@ parse_bag_encrypted_data (const unsigned char *buffer, size_t length,
{
int len;
- log_info ("processing simple keyBag\n");
+ if (opt_verbose)
+ log_info ("processing simple keyBag\n");
/* Fixme: This code is duplicated from parse_bag_data. */
if (parse_tag (&p, &n, &ti) || ti.class || ti.tag != TAG_SEQUENCE)
@@ -1109,7 +1121,8 @@ parse_bag_encrypted_data (const unsigned char *buffer, size_t length,
}
else
{
- log_info ("processing certBag\n");
+ if (opt_verbose)
+ log_info ("processing certBag\n");
if (parse_tag (&p, &n, &ti))
goto bailout;
if (ti.class || ti.tag != TAG_SEQUENCE)