gpgme/gpgme (ChangeLog verify.c)
cvs user wk
cvs at cvs.gnupg.org
Thu Apr 21 08:56:43 CEST 2005
Date: Thursday, April 21, 2005 @ 09:13:41
Author: wk
Path: /cvs/gpgme/gpgme/gpgme
Modified: ChangeLog verify.c
(calc_sig_summary): Set the key revoked bit.
-----------+
ChangeLog | 6 +++++-
verify.c | 25 +++++++++++++++++++------
2 files changed, 24 insertions(+), 7 deletions(-)
Index: gpgme/gpgme/ChangeLog
diff -u gpgme/gpgme/ChangeLog:1.396 gpgme/gpgme/ChangeLog:1.397
--- gpgme/gpgme/ChangeLog:1.396 Thu Apr 14 10:49:20 2005
+++ gpgme/gpgme/ChangeLog Thu Apr 21 09:13:41 2005
@@ -1,3 +1,7 @@
+2005-04-21 Werner Koch <wk at g10code.com>
+
+ * verify.c (calc_sig_summary): Set the key revoked bit.
+
2005-04-14 Marcus Brinkmann <marcus at g10code.de>
* wait-global.c (gpgme_wait): Use LI->ctx when checking a context
@@ -4676,7 +4680,7 @@
* data.c (gpgme_data_rewind): Allow to rewind data_type_none.
- Copyright 2001, 2002, 2003, 2004 g10 Code GmbH
+ Copyright 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
Index: gpgme/gpgme/verify.c
diff -u gpgme/gpgme/verify.c:1.70 gpgme/gpgme/verify.c:1.71
--- gpgme/gpgme/verify.c:1.70 Tue Dec 7 22:13:36 2004
+++ gpgme/gpgme/verify.c Thu Apr 21 09:13:41 2005
@@ -94,7 +94,8 @@
calc_sig_summary (gpgme_signature_t sig)
{
unsigned long sum = 0;
-
+
+ /* Calculate the red/green flag. */
if (sig->validity == GPGME_VALIDITY_FULL
|| sig->validity == GPGME_VALIDITY_ULTIMATE)
{
@@ -113,11 +114,6 @@
else if (gpg_err_code (sig->status) == GPG_ERR_BAD_SIGNATURE)
sum |= GPGME_SIGSUM_RED;
- if (sig->validity == GPGME_VALIDITY_UNKNOWN)
- {
- if (gpg_err_code (sig->validity_reason) == GPG_ERR_CRL_TOO_OLD)
- sum |= GPGME_SIGSUM_CRL_TOO_OLD;
- }
/* FIXME: handle the case when key and message are expired. */
switch (gpg_err_code (sig->status))
@@ -143,6 +139,23 @@
break;
}
+ /* Now look at the certain reason codes. */
+ switch (gpg_err_code (sig->validity_reason))
+ {
+ case GPG_ERR_CRL_TOO_OLD:
+ if (sig->validity == GPGME_VALIDITY_UNKNOWN)
+ sum |= GPGME_SIGSUM_CRL_TOO_OLD;
+ break;
+
+ case GPG_ERR_CERT_REVOKED:
+ sum |= GPGME_SIGSUM_KEY_REVOKED;
+ break;
+
+ default:
+ break;
+ }
+
+ /* Check other flags. */
if (sig->wrong_key_usage)
sum |= GPGME_SIGSUM_BAD_POLICY;
More information about the Gnupg-commits
mailing list