aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2021-02-25 09:16:18 +0100
committerWerner Koch <wk@gnupg.org>2021-02-25 09:16:18 +0100
commita170f0e73f38e474b6d4463433fe344eca865fa5 (patch)
tree730d647693276f6d15f6493048b93c595329bcc3
parent473b83d1b9efe51fcca68708580597dddf3f50b7 (diff)
downloadgnupg-a170f0e73f38e474b6d4463433fe344eca865fa5.tar.gz
sm: Do not print certain issuer not found diags in quiet mode.
* sm/certchain.c (find_up_dirmngr): Print one diagnostic only in verbose mode. Do not print issuer not found diags in quiet mode. * sm/minip12.c (parse_bag_data): Add missing verbose condition. -- GnuPG-bug-id: 4757
-rw-r--r--sm/certchain.c44
-rw-r--r--sm/minip12.c5
2 files changed, 28 insertions, 21 deletions
diff --git a/sm/certchain.c b/sm/certchain.c
index 9d13a672b..e23a1c427 100644
--- a/sm/certchain.c
+++ b/sm/certchain.c
@@ -815,7 +815,7 @@ find_up_dirmngr (ctrl_t ctrl, KEYDB_HANDLE kh,
if (opt.verbose)
log_info (_("number of matching certificates: %d\n"),
find_up_store_certs_parm.count);
- if (rc && !opt.quiet)
+ if (rc && opt.verbose)
log_info (_("dirmngr cache-only key lookup failed: %s\n"),
gpg_strerror (rc));
return ((!rc && find_up_store_certs_parm.count)
@@ -958,22 +958,25 @@ find_up (ctrl_t ctrl, KEYDB_HANDLE kh,
;
else if (gpg_err_code (err) == GPG_ERR_NOT_FOUND)
{
- log_info ("%sissuer certificate ", find_next?"next ":"");
- if (keyid)
- {
- log_printf ("{");
- gpgsm_dump_serial (keyid);
- log_printf ("} ");
- }
- if (authidno)
+ if (!opt.quiet)
{
- log_printf ("(#");
- gpgsm_dump_serial (authidno);
- log_printf ("/");
- gpgsm_dump_string (s);
- log_printf (") ");
+ log_info ("%sissuer certificate ", find_next?"next ":"");
+ if (keyid)
+ {
+ log_printf ("{");
+ gpgsm_dump_serial (keyid);
+ log_printf ("} ");
+ }
+ if (authidno)
+ {
+ log_printf ("(#");
+ gpgsm_dump_serial (authidno);
+ log_printf ("/");
+ gpgsm_dump_string (s);
+ log_printf (") ");
+ }
+ log_printf ("not found using authorityKeyIdentifier\n");
}
- log_printf ("not found using authorityKeyIdentifier\n");
}
else if (err)
log_error ("failed to find authorityKeyIdentifier: err=%d\n", err);
@@ -1803,7 +1806,7 @@ do_validate_chain (ctrl_t ctrl, ksba_cert_t cert, ksba_isotime_t checktime_arg,
if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
{
do_list (0, listmode, listfp, _("issuer certificate not found"));
- if (!listmode)
+ if (!listmode && !opt.quiet)
{
log_info ("issuer certificate: #/");
gpgsm_dump_string (issuer);
@@ -2232,9 +2235,12 @@ gpgsm_basic_cert_check (ctrl_t ctrl, ksba_cert_t cert)
{
if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
{
- log_info ("issuer certificate (#/");
- gpgsm_dump_string (issuer);
- log_printf (") not found\n");
+ if (!opt.quiet)
+ {
+ log_info ("issuer certificate (#/");
+ gpgsm_dump_string (issuer);
+ log_printf (") not found\n");
+ }
}
else
log_error ("failed to find issuer's certificate: %s <%s>\n",
diff --git a/sm/minip12.c b/sm/minip12.c
index a7537f06f..820e0d6b0 100644
--- a/sm/minip12.c
+++ b/sm/minip12.c
@@ -1449,8 +1449,9 @@ parse_bag_data (const unsigned char *buffer, size_t length, int startoffset,
if (ti.class || ti.tag != TAG_OCTET_STRING || !ti.length )
goto bailout;
- log_info ("%lu bytes of %s encrypted text\n",
- ti.length, is_pbes2? "AES128":"3DES");
+ if (opt_verbose)
+ log_info ("%lu bytes of %s encrypted text\n",
+ ti.length, is_pbes2? "AES128":"3DES");
plain = gcry_malloc_secure (ti.length);
if (!plain)