summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-12-05 17:48:24 +0100
committerWerner Koch <wk@gnupg.org>2022-12-05 17:48:24 +0100
commit58819c024a11dd89b01dd00ab7becba64feec7c7 (patch)
treeaab650247590037476607a05a7ec3c02657d96b0
parentgpgsm: Fix "problem re-searching certificate" case. (diff)
downloadgnupg2-58819c024a11dd89b01dd00ab7becba64feec7c7.tar.xz
gnupg2-58819c024a11dd89b01dd00ab7becba64feec7c7.zip
gpgsm: Print the revocation time also with --verify.
* sm/certchain.c (is_cert_still_valid): Print revocation reason.
-rw-r--r--sm/certchain.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sm/certchain.c b/sm/certchain.c
index abce4c327..9813eca8c 100644
--- a/sm/certchain.c
+++ b/sm/certchain.c
@@ -1246,7 +1246,22 @@ is_cert_still_valid (ctrl_t ctrl, int chain_model, int lm, estream_t fp,
switch (gpg_err_code (err))
{
case GPG_ERR_CERT_REVOKED:
- do_list (1, lm, fp, _("certificate has been revoked"));
+ if (!check_isotime (ctrl->revoked_at))
+ {
+ char *tmpstr;
+ const unsigned char *t = ctrl->revoked_at;
+
+ tmpstr = xtryasprintf ("%.4s-%.2s-%.2s %.2s:%.2s:%s (%s)",
+ t, t+4, t+6, t+9, t+11, t+13,
+ ctrl->revocation_reason?
+ ctrl->revocation_reason : "");
+
+ do_list (1, lm, fp, "%s: %s",
+ _("certificate has been revoked"), tmpstr);
+ xfree (tmpstr);
+ }
+ else
+ do_list (1, lm, fp, _("certificate has been revoked"));
*any_revoked = 1;
/* Store that in the keybox so that key listings are able to
return the revoked flag. We don't care about error,