From 87d713ff41454bd08a345c63605f6fc7ac854dd4 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 18 Mar 2015 17:20:55 -0400 Subject: [PATCH] Set GPGME_SIGSUM_KEY_REVOKED also for gpg. * src/verify.c (calc_sig_summary): Handle GPG_ERR_CERT_REVOKED. -- parse_new_sig() handles a revoked key by setting sig->status to GPG_ERR_CERT_REVOKED, but then later calc_sig_summary() expects that code in sig->validity_reason. Additional comments added by wk. --- src/verify.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/verify.c b/src/verify.c index 37b2bd46..84487ee4 100644 --- a/src/verify.c +++ b/src/verify.c @@ -195,6 +195,10 @@ calc_sig_summary (gpgme_signature_t sig) sum |= GPGME_SIGSUM_KEY_MISSING; break; + case GPG_ERR_CERT_REVOKED: + sum |= GPGME_SIGSUM_KEY_REVOKED; + break; + case GPG_ERR_BAD_SIGNATURE: case GPG_ERR_NO_ERROR: break; @@ -213,6 +217,9 @@ calc_sig_summary (gpgme_signature_t sig) break; case GPG_ERR_CERT_REVOKED: + /* Note that this is a second way to set this flag. It may also + have been set due to a sig->status of STATUS_REVKEYSIG from + parse_new_sig. */ sum |= GPGME_SIGSUM_KEY_REVOKED; break;