0.9.6claws73
authorChristoph Hohmann <reboot@gmx.ch>
Mon, 10 Nov 2003 21:16:29 +0000 (21:16 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Mon, 10 Nov 2003 21:16:29 +0000 (21:16 +0000)
* src/mimeview.c
        add "Full info" button for bad and warn signature status

* src/sgpgme.c
        generate full signature info like gpg's output
        (gpg -v --with-fingerprint --verify)

ChangeLog.claws
configure.ac
src/mimeview.c
src/sgpgme.c

index c363682684e09f2fee491bfa03fdfdefc3dc0de7..1b5f4422bd25158d88171513c6889fac85aaba16 100644 (file)
@@ -1,3 +1,12 @@
+2003-11-10 [christoph] 0.9.6claws73
+
+       * src/mimeview.c
+               add "Full info" button for bad and warn signature status
+
+       * src/sgpgme.c
+               generate full signature info like gpg's output
+               (gpg -v --with-fingerprint --verify)
+
 2003-11-10 [christoph] 0.9.6claws72
 
        * src/mimeview.c
index dad22ad7390ba82421be4b792c8a7f1ab096928a..092111817df4b542dc542e64d6e16f3acb94be20 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=72
+EXTRA_VERSION=73
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 937277d2b9cd130662d9041ec38412153159d42e..b285a704d5510a782c28e2fe098a10517739b752 100644 (file)
@@ -636,9 +636,13 @@ static void update_signature_noticeview(MimeView *mimeview, MimeInfo *mimeinfo)
                        icon = STOCK_PIXMAP_PRIVACY_PASSED;
                        break;
                case SIGNATURE_WARN:
+                       button_text = _("Full info");
+                       func = display_full_info_cb;
                        icon = STOCK_PIXMAP_PRIVACY_WARN;
                        break;
                case SIGNATURE_INVALID:
+                       button_text = _("Full info");
+                       func = display_full_info_cb;
                        icon = STOCK_PIXMAP_PRIVACY_FAILED;
                        break;
                case SIGNATURE_CHECK_FAILED:
index 7fb63768fef3d89ce26443c946ba3c49e52490f1..146e65c8e436d27c029947c67c941ecb0a9f968a 100644 (file)
@@ -23,6 +23,7 @@
  
 #ifdef USE_GPGME
 
+#include <time.h>
 #include <gtk/gtk.h>
 #include <gpgme.h>
 
@@ -138,7 +139,73 @@ gchar *sgpgme_sigstat_info_short(GpgmeCtx ctx, GpgmeSigStat status)
 
 gchar *sgpgme_sigstat_info_full(GpgmeCtx ctx, GpgmeSigStat status)
 {
-       return g_strdup(_("Todo"));
+       gint i = 0;
+       gchar *ret;
+       GString *siginfo;
+       GpgmeKey key;
+       
+       siginfo = g_string_sized_new(64);
+       while (gpgme_get_sig_key(ctx, i, &key) != GPGME_EOF) {
+               time_t sigtime, expiretime;
+               GpgmeSigStat sigstatus;
+               gchar time[64];
+               const gchar *keytype, *keyid;
+               
+               sigtime = gpgme_get_sig_ulong_attr(ctx, i, GPGME_ATTR_CREATED, 0);
+               strftime(time, 64, "%c", gmtime(&sigtime));
+               keytype = gpgme_key_get_string_attr(key, GPGME_ATTR_ALGO, NULL, 0);
+               keyid = gpgme_key_get_string_attr(key, GPGME_ATTR_KEYID, NULL, 0);
+               g_string_sprintfa(siginfo,
+                       _("Signature made %s using %s key ID %s\n"),
+                       time, keytype, keyid);
+               
+               sigstatus = gpgme_get_sig_ulong_attr(ctx, i, GPGME_ATTR_SIG_STATUS, 0); 
+               switch (sigstatus) {
+               case GPGME_SIG_STAT_GOOD:
+               case GPGME_SIG_STAT_GOOD_EXP:
+               case GPGME_SIG_STAT_GOOD_EXPKEY:
+               {
+                       gint j = 1;
+                       const gchar *uid;
+                       
+                       g_string_sprintfa(siginfo,
+                               _("Good signature from \"%s\"\n"),
+                               gpgme_key_get_string_attr(key, GPGME_ATTR_USERID, NULL, 0));
+                       while (uid = gpgme_key_get_string_attr(key, GPGME_ATTR_USERID, NULL, j)) {
+                               g_string_sprintfa(siginfo,
+                                       _("                aka \"%s\"\n"),
+                                       uid);
+                               j++;
+                       }
+                       g_string_sprintfa(siginfo,
+                               _("Primary key fingerprint: %s\n"), 
+                               gpgme_key_get_string_attr(key, GPGME_ATTR_FPR, NULL, 0));
+                       break;
+               }
+               case GPGME_SIG_STAT_BAD:
+                       g_string_sprintfa(siginfo,
+                               _("BAD signature from \"%s\"\n"),
+                               gpgme_key_get_string_attr(key, GPGME_ATTR_USERID, NULL, 0));
+                       break;
+               default:
+                       break;
+               }
+               
+               expiretime = gpgme_get_sig_ulong_attr(ctx, i, GPGME_ATTR_EXPIRE, 0);
+               if (expiretime > 0) {
+                       strftime(time, 64, "%c", gmtime(&expiretime));
+                       g_string_sprintfa(siginfo,
+                               _("Signature expires %s\n"),
+                               time);
+               }
+               
+               g_string_append(siginfo, "\n");
+               i++;
+       }
+
+       ret = siginfo->str;
+       g_string_free(siginfo, FALSE);
+       return ret;
 }
 
 void sgpgme_init()