PGP: Improve pgp_verify()
authorMikael Berthe <mikael@lilotux.net>
Mon, 27 Nov 2006 21:40:26 +0100
changeset 1054 082d55152a25
parent 1053 1ec7ec9bda60
child 1055 6eb1efea75d0
PGP: Improve pgp_verify() Sometimes the summary is 0 and the status is 0. According to the gpgme reference manual, status=0 means the signature is valid.
mcabber/src/pgp.c
--- a/mcabber/src/pgp.c	Mon Nov 27 20:55:33 2006 +0100
+++ b/mcabber/src/pgp.c	Mon Nov 27 21:40:26 2006 +0100
@@ -228,6 +228,10 @@
           // r is a static variable, let's copy it.
           verified_key = g_strdup(r);
           *sigsum = vr->signatures->summary;
+          // For some reason summary could be 0 when status is 0 too,
+          // which means the signature is valid...
+          if (!*sigsum && !vr->signatures->status)
+            *sigsum = GPGME_SIGSUM_GREEN;
         }
       }
       gpgme_data_release(data_text);