summaryrefslogtreecommitdiffstats
path: root/dirmngr
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2018-10-22 14:23:11 +0200
committerWerner Koch <wk@gnupg.org>2018-10-22 14:23:11 +0200
commit0a7f446c189201ca6e527af08b44da756b343209 (patch)
treed7e52dabfc734807a194cab1d2554f553aabc301 /dirmngr
parenttools: Replace duplicated code in mime-maker. (diff)
downloadgnupg2-0a7f446c189201ca6e527af08b44da756b343209.tar.xz
gnupg2-0a7f446c189201ca6e527af08b44da756b343209.zip
dirmngr: In verbose mode print the OCSP responder id.
* dirmngr/ocsp.c (ocsp_isvalid): Print the responder id. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'dirmngr')
-rw-r--r--dirmngr/ocsp.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/dirmngr/ocsp.c b/dirmngr/ocsp.c
index ca28960e4..966eda304 100644
--- a/dirmngr/ocsp.c
+++ b/dirmngr/ocsp.c
@@ -653,6 +653,33 @@ ocsp_isvalid (ctrl_t ctrl, ksba_cert_t cert, const char *cert_fpr,
if (err)
goto leave;
+ /* It is sometimes useful to know the responder ID. */
+ if (opt.verbose)
+ {
+ char *resp_name;
+ ksba_sexp_t resp_keyid;
+
+ err = ksba_ocsp_get_responder_id (ocsp, &resp_name, &resp_keyid);
+ if (err)
+ log_info (_("error getting responder ID: %s\n"), gpg_strerror (err));
+ else
+ {
+ log_info ("responder id: ");
+ if (resp_name)
+ log_printf ("'/%s' ", resp_name);
+ if (resp_keyid)
+ {
+ log_printf ("{");
+ dump_serial (resp_keyid);
+ log_printf ("} ");
+ }
+ log_printf ("\n");
+ }
+ ksba_free (resp_name);
+ ksba_free (resp_keyid);
+ err = 0;
+ }
+
/* We got a useful answer, check that the answer has a valid signature. */
sigval = ksba_ocsp_get_sig_val (ocsp, produced_at);
if (!sigval || !*produced_at)