2009-02-15 [colin] 3.7.0cvs66
authorColin Leroy <colin@colino.net>
Sun, 15 Feb 2009 18:49:01 +0000 (18:49 +0000)
committerColin Leroy <colin@colino.net>
Sun, 15 Feb 2009 18:49:01 +0000 (18:49 +0000)
* src/privacy.c
* src/plugins/pgpcore/select-keys.c
* src/plugins/pgpcore/sgpgme.c
Disable use of disabled keys

ChangeLog
PATCHSETS
configure.ac
src/plugins/pgpcore/select-keys.c
src/plugins/pgpcore/sgpgme.c
src/privacy.c

index 56e77fc..ca8f1d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-15 [colin]     3.7.0cvs66
+
+       * src/privacy.c
+       * src/plugins/pgpcore/select-keys.c
+       * src/plugins/pgpcore/sgpgme.c
+               Disable use of disabled keys
+
 2009-02-15 [colin]     3.7.0cvs65
 
        * src/folderview.c
index 957cabc..fc3de10 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.4.24 -r 1.1.4.25 src/gtk/progressdialog.c;  cvs diff -u -r 1.1.4.14 -r 1.1.4.15 src/gtk/progressdialog.h;  ) > 3.7.0cvs63.patchset
 ( cvs diff -u -r 1.5.2.13 -r 1.5.2.14 src/addressitem.h;  cvs diff -u -r 1.1.16.5 -r 1.1.16.6 src/export.h;  cvs diff -u -r 1.8.2.29 -r 1.8.2.30 src/headerview.c;  cvs diff -u -r 1.2.2.5 -r 1.2.2.6 src/headerview.h;  cvs diff -u -r 1.3.2.6 -r 1.3.2.7 src/common/version.h.in;  cvs diff -u -r 1.1.4.2 -r 1.1.4.3 src/gtk/about.h;  cvs diff -u -r 1.5.2.39 -r 1.5.2.40 src/gtk/menu.c;  cvs diff -u -r 1.4.2.22 -r 1.4.2.23 src/gtk/menu.h;  ) > 3.7.0cvs64.patchset
 ( cvs diff -u -r 1.207.2.211 -r 1.207.2.212 src/folderview.c;  cvs diff -u -r 1.395.2.406 -r 1.395.2.407 src/summaryview.c;  ) > 3.7.0cvs65.patchset
+( cvs diff -u -r 1.10.2.19 -r 1.10.2.20 src/privacy.c;  cvs diff -u -r 1.1.2.25 -r 1.1.2.26 src/plugins/pgpcore/select-keys.c;  cvs diff -u -r 1.1.2.61 -r 1.1.2.62 src/plugins/pgpcore/sgpgme.c;  ) > 3.7.0cvs66.patchset
index e535d07..d18a2c3 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=65
+EXTRA_VERSION=66
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 39a84ce..6d4cfbc 100644 (file)
@@ -183,7 +183,7 @@ set_row (GtkCMCList *clist, gpgme_key_t key, gpgme_protocol_t proto)
 
     /* first check whether the key is capable of encryption which is not
      * the case for revoked, expired or sign-only keys */
-    if (!key->can_encrypt || key->revoked || key->expired)
+    if (!key->can_encrypt || key->revoked || key->expired || key->disabled)
         return;
 
     algo_buf = g_strdup_printf ("%du/%s", 
@@ -302,7 +302,7 @@ fill_clist (struct select_keys_s *sk, const char *pattern, gpgme_protocol_t prot
     update_progress (sk, ++running, pattern);
     while ( !(err = gpgme_op_keylist_next ( ctx, &key )) ) {
        gpgme_user_id_t uid = key->uids;
-       if (!key->can_encrypt || key->revoked || key->expired)
+       if (!key->can_encrypt || key->revoked || key->expired || key->disabled)
                continue;
         debug_print ("%% %s:%d:  insert\n", __FILE__ ,__LINE__ );
         set_row (clist, key, proto ); 
index 0138cfa..8d94838 100644 (file)
@@ -511,14 +511,22 @@ gboolean sgpgme_setup_signers(gpgme_ctx_t ctx, PrefsAccount *account,
                        do {
                                err = gpgme_op_keylist_next(ctx, &key);
                                if (!err && key && key->protocol == gpgme_get_protocol(ctx) &&
-                                   !key->expired && !key->revoked)
+                                   !key->expired && !key->revoked && !key->disabled)
                                        break;
                                if (!err && key && key->protocol != gpgme_get_protocol(ctx)) {
                                        debug_print("skipping a key (wrong protocol %d)\n", key->protocol);
                                        gpgme_key_release(key);
                                }
-                               if (!err && key && (key->expired || key->revoked)) {
-                                       debug_print("skipping a key (%s)\n", key->expired?"expired":"revoked");
+                               if (!err && key && (key->expired || key->revoked || key->disabled)) {
+                                       
+                                       debug_print("skipping a key");
+                                       if (key->expired) 
+                                               debug_print(" expired");
+                                       if (key->revoked) 
+                                               debug_print(" revoked");
+                                       if (key->disabled) 
+                                               debug_print(" disabled");
+                                       debug_print("\n");
                                        gpgme_key_release(key);
                                }
                        } while (!err);
@@ -532,14 +540,21 @@ gboolean sgpgme_setup_signers(gpgme_ctx_t ctx, PrefsAccount *account,
                do {
                        err = gpgme_op_keylist_next(ctx, &key2);
                        if (!err && key2 && key2->protocol == gpgme_get_protocol(ctx) &&
-                           !key2->expired && !key2->revoked)
+                           !key2->expired && !key2->revoked && !key2->disabled)
                                break;
                        if (!err && key && key2->protocol != gpgme_get_protocol(ctx)) {
                                debug_print("skipping a key (wrong protocol %d)\n", key2->protocol);
                                gpgme_key_release(key2);
                        }
-                       if (!err && key && (key2->expired || key2->revoked)) {
-                               debug_print("skipping a key (%s)\n", key2->expired?"expired":"revoked");
+                       if (!err && key && (key2->expired || key2->revoked || key2->disabled)) {
+                                       debug_print("skipping a key");
+                                       if (key2->expired) 
+                                               debug_print(" expired");
+                                       if (key2->revoked) 
+                                               debug_print(" revoked");
+                                       if (key2->disabled) 
+                                               debug_print(" disabled");
+                                       debug_print("\n");
                                gpgme_key_release(key2);
                        }
                } while (!err);
index 3b9a144..4bf73f0 100644 (file)
@@ -417,6 +417,8 @@ gboolean privacy_sign(const gchar *id, MimeInfo *target, PrefsAccount *account,
 gchar *privacy_get_encrypt_data(const gchar *id, GSList *recp_names)
 {
        PrivacySystem *system;
+       gchar *ret = NULL;
+       GSList *uniq_names = NULL, *cur;
 
        g_return_val_if_fail(id != NULL, NULL);
        g_return_val_if_fail(recp_names != NULL, NULL);
@@ -429,7 +431,15 @@ gchar *privacy_get_encrypt_data(const gchar *id, GSList *recp_names)
        if (system->get_encrypt_data == NULL)
                return NULL;
 
-       return system->get_encrypt_data(recp_names);
+       for (cur = recp_names; cur; cur = cur->next) {
+               if (!g_slist_find_custom(uniq_names, cur->data, (GCompareFunc)strcmp)) {
+                       uniq_names = g_slist_prepend(uniq_names, cur->data);
+               }
+       }
+       ret = system->get_encrypt_data(uniq_names);
+       
+       g_slist_free(uniq_names);
+       return ret;
 }
 
 const gchar *privacy_get_encrypt_warning(const gchar *id)