2004-10-03 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Fri, 22 Oct 2004 17:57:56 +0000 (17:57 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Fri, 22 Oct 2004 17:57:56 +0000 (17:57 +0000)
* verify.c (parse_trust): If no reason is provided, set
SIG->validity_reason to 0.
(calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.

gpgme/ChangeLog
gpgme/verify.c

index 9baaf6eab0c431a2334f841dd010695bbc2095bc..6b2539d6dfcebefc71e04ac27c01733546548e93 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-03  Marcus Brinkmann  <marcus@g10code.de>
+
+       * verify.c (parse_trust): If no reason is provided, set
+       SIG->validity_reason to 0.
+       (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
+
 2004-10-22  Marcus Brinkmann  <marcus@g10code.de>
 
        * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
index ceb84f84a52e18d3b469d685f59cd5893b94e3e3..80593e9d415844fd0c68650395d126fc40378ba5 100644 (file)
@@ -111,7 +111,13 @@ calc_sig_summary (gpgme_signature_t sig)
     }
   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))
     {
@@ -461,6 +467,8 @@ parse_trust (gpgme_signature_t sig, gpgme_status_code_t code, char *args)
 
   if (*args)
     sig->validity_reason = _gpgme_map_gnupg_error (args);
+  else
+    sig->validity_reason = 0;
 
   return 0;
 }