2005-12-09 [cleroy] 1.9.100cvs79
authorColin Leroy <colin@colino.net>
Fri, 9 Dec 2005 07:59:46 +0000 (07:59 +0000)
committerColin Leroy <colin@colino.net>
Fri, 9 Dec 2005 07:59:46 +0000 (07:59 +0000)
* src/plugins/pgpcore/sgpgme.c
Display (untrusted) on not trusted signatures
Patch by Michal Èihaø <michal@cihar.com>
Closes bug #867 (Report also key trust)

ChangeLog
PATCHSETS
configure.ac
src/plugins/pgpcore/sgpgme.c

index c8eec4e..9f84a2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-09 [cleroy]    1.9.100cvs79
+
+       * src/plugins/pgpcore/sgpgme.c
+               Display (untrusted) on not trusted signatures
+               Patch by Michal Èihaø <michal@cihar.com>
+               Closes bug #867 (Report also key trust)
+
 2005-12-09 [cleroy]    1.9.100cvs78
 
        * src/common/plugin.c
 2005-12-09 [cleroy]    1.9.100cvs78
 
        * src/common/plugin.c
index 1687672..62dcad0 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.83.2.52 -r 1.83.2.53 src/mimeview.c;  cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/plugins/pgpcore/sgpgme.c;  ) > 1.9.100cvs76.patchset
 ( cvs diff -u -r 1.213.2.69 -r 1.213.2.70 src/folder.c;  ) > 1.9.100cvs77.patchset
 ( cvs diff -u -r 1.13.2.9 -r 1.13.2.10 src/common/plugin.c;  ) > 1.9.100cvs78.patchset
 ( cvs diff -u -r 1.83.2.52 -r 1.83.2.53 src/mimeview.c;  cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/plugins/pgpcore/sgpgme.c;  ) > 1.9.100cvs76.patchset
 ( cvs diff -u -r 1.213.2.69 -r 1.213.2.70 src/folder.c;  ) > 1.9.100cvs77.patchset
 ( cvs diff -u -r 1.13.2.9 -r 1.13.2.10 src/common/plugin.c;  ) > 1.9.100cvs78.patchset
+( cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/plugins/pgpcore/sgpgme.c;  ) > 1.9.100cvs79.patchset
index 7f8a4bb..8b8197b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=100
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=100
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=78
+EXTRA_VERSION=79
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c056a5a..dba63e7 100644 (file)
@@ -90,7 +90,18 @@ SignatureStatus sgpgme_sigstat_gpgme_to_privacy(gpgme_ctx_t ctx, gpgme_verify_re
        debug_print("err code %d\n", gpg_err_code(sig->status));
        switch (gpg_err_code(sig->status)) {
        case GPG_ERR_NO_ERROR:
        debug_print("err code %d\n", gpg_err_code(sig->status));
        switch (gpg_err_code(sig->status)) {
        case GPG_ERR_NO_ERROR:
-               return SIGNATURE_OK;
+               switch (gpg_err_code(sig->validity)) {
+               case GPGME_VALIDITY_NEVER:
+                       return SIGNATURE_INVALID;
+               case GPGME_VALIDITY_UNKNOWN:
+               case GPGME_VALIDITY_UNDEFINED:
+               case GPGME_VALIDITY_MARGINAL:
+               case GPGME_VALIDITY_FULL:
+               case GPGME_VALIDITY_ULTIMATE:
+                       return SIGNATURE_OK;
+               default:
+                       return SIGNATURE_CHECK_FAILED;
+               }
        case GPG_ERR_SIG_EXPIRED:
        case GPG_ERR_KEY_EXPIRED:
                return SIGNATURE_WARN;
        case GPG_ERR_SIG_EXPIRED:
        case GPG_ERR_KEY_EXPIRED:
                return SIGNATURE_WARN;
@@ -168,8 +179,19 @@ gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
                uname = g_strdup("<?>");
        switch (gpg_err_code(sig->status)) {
        case GPG_ERR_NO_ERROR:
                uname = g_strdup("<?>");
        switch (gpg_err_code(sig->status)) {
        case GPG_ERR_NO_ERROR:
-               result = g_strdup_printf(_("Good signature from %s."),
-                       uname);
+               switch (gpg_err_code(sig->validity)) {
+               case GPGME_VALIDITY_MARGINAL:
+               case GPGME_VALIDITY_FULL:
+               case GPGME_VALIDITY_ULTIMATE:
+                       result = g_strdup_printf(_("Good signature from %s."), uname);
+                       break;
+               case GPGME_VALIDITY_UNKNOWN:
+               case GPGME_VALIDITY_UNDEFINED:
+               case GPGME_VALIDITY_NEVER:
+               default:
+                       result = g_strdup_printf(_("Good signature (untrusted) from %s."), uname);
+                       break;
+               }
                break;
        case GPG_ERR_SIG_EXPIRED:
                result = g_strdup_printf(_("Expired signature from %s."), uname);
                break;
        case GPG_ERR_SIG_EXPIRED:
                result = g_strdup_printf(_("Expired signature from %s."), uname);