2003-04-29 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Tue, 29 Apr 2003 20:50:15 +0000 (20:50 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Tue, 29 Apr 2003 20:50:15 +0000 (20:50 +0000)
* verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
for bad signatures.

trunk/gpgme/ChangeLog
trunk/gpgme/verify.c

index 4634a6dadb14e4837370ecd808a082acf8288893..944dc83052c2e8814cea6fbb2d684f2eef3604cf 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-29  Marcus Brinkmann  <marcus@g10code.de>
+
+       * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
+       for bad signatures.
+
 2003-04-28  Marcus Brinkmann  <marcus@g10code.de>
 
        * context.h: Remove OPDATA_VERIFY_COLLECTING.
index 85854cdb0e107b93b77cc80df360d3b6e6f783b2..42341e0f16b81146987b0e8e800c57db157eed8f 100644 (file)
@@ -108,25 +108,28 @@ calc_sig_summary (GpgmeSignature sig)
     sum |= GPGME_SIGSUM_RED;
   
   /* FIXME: handle the case when key and message are expired. */
-  if (sig->status == GPGME_Sig_Expired)
-    sum |= GPGME_SIGSUM_SIG_EXPIRED;
-  else if (sig->status == GPGME_Key_Expired)
-    sum |= GPGME_SIGSUM_KEY_EXPIRED;
-  else if (sig->status == GPGME_No_Public_Key)
-    sum |= GPGME_SIGSUM_KEY_MISSING;
-  else if (sig->status)
-    sum |= GPGME_SIGSUM_SYS_ERROR;
-  
-  if (sig->validity_reason == GPGME_Key_Revoked)
-    sum |= GPGME_SIGSUM_KEY_REVOKED;
-  else if (sig->validity_reason == GPGME_No_CRL_Known)
-    sum |= GPGME_SIGSUM_CRL_MISSING;
-  else if (sig->validity_reason == GPGME_CRL_Too_Old)
-    sum |= GPGME_SIGSUM_CRL_TOO_OLD;
-  else if (sig->validity_reason == GPGME_Policy_Mismatch)
-    sum |= GPGME_SIGSUM_BAD_POLICY;
-  else if (sig->validity_reason)
-    sum |= GPGME_SIGSUM_SYS_ERROR;
+  switch (sig->status)
+    {
+    case GPGME_Sig_Expired:
+      sum |= GPGME_SIGSUM_SIG_EXPIRED;
+      break;
+
+    case GPGME_Key_Expired:
+      sum |= GPGME_SIGSUM_KEY_EXPIRED;
+      break;
+
+    case GPGME_No_Public_Key:
+      sum |= GPGME_SIGSUM_KEY_MISSING;
+      break;
+
+    case GPGME_Bad_Signature:
+    case GPGME_No_Error:
+      break;
+
+    default:
+      sum |= GPGME_SIGSUM_SYS_ERROR;
+      break;
+    }
   
   if (sig->wrong_key_usage)
     sum |= GPGME_SIGSUM_BAD_POLICY;