+2008-11-26 [colin] 3.6.1cvs45
+
+ * src/plugins/pgpcore/select-keys.c
+ * src/plugins/pgpcore/sgpgme.c
+ Fix bug 1591, 'S/MIME: better key
+ handling/selection dialog'
+ Really ignore revoked/expired keys
+
2008-11-26 [colin] 3.6.1cvs44
* src/main.c
( cvs diff -u -r 1.49.2.121 -r 1.49.2.122 src/procmime.c; ) > 3.6.1cvs42.patchset
( cvs diff -u -r 1.179.2.236 -r 1.179.2.237 src/imap.c; cvs diff -u -r 1.101.2.57 -r 1.101.2.58 src/news.c; cvs diff -u -r 1.1.4.105 -r 1.1.4.106 src/etpan/imap-thread.c; ) > 3.6.1cvs43.patchset
( cvs diff -u -r 1.115.2.215 -r 1.115.2.216 src/main.c; cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/common/claws.c; cvs diff -u -r 1.9.2.35 -r 1.9.2.36 src/common/ssl.c; ) > 3.6.1cvs44.patchset
+( cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/plugins/pgpcore/select-keys.c; cvs diff -u -r 1.1.2.56 -r 1.1.2.57 src/plugins/pgpcore/sgpgme.c; ) > 3.6.1cvs45.patchset
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=44
+EXTRA_VERSION=45
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
/* 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)
+ if (!key->can_encrypt || key->revoked || key->expired)
return;
+
algo_buf = g_strdup_printf ("%du/%s",
key->subkeys->length,
gpgme_pubkey_algo_name(key->subkeys->pubkey_algo) );
switch (key->uids->validity)
{
case GPGME_VALIDITY_UNDEFINED:
- s = "q";
+ s = _("Undefined");
break;
case GPGME_VALIDITY_NEVER:
- s = "n";
+ s = _("Never");
break;
case GPGME_VALIDITY_MARGINAL:
- s = "m";
+ s = _("Marginal");
break;
case GPGME_VALIDITY_FULL:
- s = "f";
+ s = _("Full");
break;
case GPGME_VALIDITY_ULTIMATE:
- s = "u";
+ s = _("Ultimate");
break;
case GPGME_VALIDITY_UNKNOWN:
default:
- s = "?";
+ s = _("Unknown");
break;
}
text[COL_VALIDITY] = s;
update_progress (sk, ++running, pattern);
while ( !(err = gpgme_op_keylist_next ( ctx, &key )) ) {
gpgme_user_id_t uid = key->uids;
- if (!key->can_encrypt)
+ if (!key->can_encrypt || key->revoked || key->expired)
continue;
debug_print ("%% %s:%d: insert\n", __FILE__ ,__LINE__ );
set_row (clist, key, proto );
continue;
raw_mail = g_strdup(uid->email);
extract_address(raw_mail);
- if (!strcmp(pattern, raw_mail)) {
+ if (!strcasecmp(pattern, raw_mail)) {
exact_match = TRUE;
g_free(raw_mail);
break;
titles[COL_KEYID] = _("Key ID");
titles[COL_NAME] = _("Name");
titles[COL_EMAIL] = _("Address");
- titles[COL_VALIDITY] = _("Val");
+ titles[COL_VALIDITY] = _("Trust");
clist = gtk_cmclist_new_with_titles (N_COL_TITLES, (char**)titles);
gtk_container_add (GTK_CONTAINER (scrolledwin), clist);
goto bail;
err = gpgme_op_keylist_start(ctx, keyid, 1);
- if (!err)
- err = gpgme_op_keylist_next(ctx, &key);
+ if (!err) {
+ do {
+ err = gpgme_op_keylist_next(ctx, &key);
+ if (!err && key && key->protocol == gpgme_get_protocol(ctx) &&
+ !key->expired && !key->revoked)
+ 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");
+ gpgme_key_release(key);
+ }
+ } while (!err);
+ }
if (err) {
g_warning("setup_signers start: %s", gpgme_strerror(err));
privacy_set_error(_("Secret key not found (%s)"), gpgme_strerror(err));
goto bail;
}
- err = gpgme_op_keylist_next(ctx, &key2);
+ do {
+ err = gpgme_op_keylist_next(ctx, &key2);
+ if (!err && key2 && key2->protocol == gpgme_get_protocol(ctx) &&
+ !key2->expired && !key2->revoked)
+ 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");
+ gpgme_key_release(key2);
+ }
+ } while (!err);
if (!err) {
+ gpgme_key_release(key2);
g_warning("ambiguous specification of secret key '%s'\n",
keyid);
privacy_set_error(_("Secret key specification is ambiguous"));
gpgme_op_keylist_end(ctx);
err = gpgme_signers_add(ctx, key);
+ debug_print("got key (proto %d (pgp %d, smime %d).\n", key->protocol,
+ GPGME_PROTOCOL_OpenPGP, GPGME_PROTOCOL_CMS);
gpgme_key_release(key);
if (err) {