[Commits] [SCM] claws branch, master, updated. 3.13.0-105-g1cd1e06

ticho at claws-mail.org ticho at claws-mail.org
Tue Dec 15 00:14:11 CET 2015


The branch, master has been updated
       via  1cd1e0621335858dcb89276bc089339ff80dbd48 (commit)
      from  00002659672b5e5fc4944a22b796854bfa71d1ee (commit)

Summary of changes:
 src/plugins/pgpcore/sgpgme.c |   24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)


- Log -----------------------------------------------------------------
commit 1cd1e0621335858dcb89276bc089339ff80dbd48
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Tue Dec 15 00:07:35 2015 +0100

    Better fix for crash after broken pgp keyring update.
    
    This should fix the crash without interfering with
    signature checking when public key is missing.

diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c
index 7afe4bf..d407531 100644
--- a/src/plugins/pgpcore/sgpgme.c
+++ b/src/plugins/pgpcore/sgpgme.c
@@ -217,18 +217,8 @@ gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 	} else if (gpg_err_code(err) != GPG_ERR_NO_ERROR && gpg_err_code(err) != GPG_ERR_EOF) {
 		return g_strdup_printf(_("The signature can't be checked - %s"), 
 			gpgme_strerror(err));
-	} else if (gpg_err_code(err) != GPG_ERR_NO_ERROR && gpg_err_code(err) == GPG_ERR_EOF &&
-	           key == NULL) {
-               /*
-                * When gpg is upgraded to gpg-v21 then installer tries to migrate the old
-                * gpg keyrings found in ~/.gnupg to the new version. If the keyrings contain
-                * very old keys using ciphers no more supported in gpg-v21 this transition
-                * can fail and the left-over ~/.gnupg/pubring.gpg will cause claws to crash
-                * when the above condition is meet.
-                */
-               return g_strdup_printf(_("The signature can't be checked - %s."),
-                        gpgme_strerror(err));
-        }
+  }
+
 	if (key)
 		uname = extract_name(key->uids->uid);
 	else
@@ -236,7 +226,7 @@ gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 
 	switch (gpg_err_code(sig->status)) {
 	case GPG_ERR_NO_ERROR:
-               switch (key->uids?key->uids->validity:GPGME_VALIDITY_UNKNOWN) {
+               switch ((key && key->uids) ? key->uids->validity : GPGME_VALIDITY_UNKNOWN) {
 		case GPGME_VALIDITY_ULTIMATE:
 			result = g_strdup_printf(_("Good signature from \"%s\" [ultimate]"), uname);
 			break;
@@ -250,7 +240,13 @@ gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 		case GPGME_VALIDITY_UNDEFINED:
 		case GPGME_VALIDITY_NEVER:
 		default:
-			result = g_strdup_printf(_("Good signature from \"%s\""), uname);
+			if (key) {
+				result = g_strdup_printf(_("Good signature from \"%s\""), uname);
+			} else {
+				gchar *id = g_strdup(sig->fpr + strlen(sig->fpr)-8);
+				result = g_strdup_printf(_("Key 0x%s not available to verify this signature"), id);
+				g_free(id);
+			}
 			break;
                }
 		break;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list