diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-01-30 16:32:34 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-01-30 16:32:34 +0000 |
commit | f69b145be27f04e34c076158b105c325017a4178 (patch) | |
tree | 8d401d4d74c7ac6c002b1426f07ee155044f0a63 /pgpkey.c | |
parent | 2221314e4937a54558a1731a64db8cfcd2f92125 (diff) |
Handle expired keys correclty, even when they are the only and exact
match when searching for keys by address.
Diffstat (limited to 'pgpkey.c')
-rw-r--r-- | pgpkey.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -587,10 +587,10 @@ pgp_key_t *pgp_getkeybyaddr (struct pgp_vinfo * pgp, ADDRESS *r, *p; LIST *hints = NULL; int weak = 0; - int weak_association; + int weak_association, kflags; int match; pgp_uid_t *q; - pgp_key_t *keys, *k, *kn; + pgp_key_t *keys, *k, *kn, *pk; pgp_key_t *matches = NULL; pgp_key_t **last = &matches; @@ -625,6 +625,9 @@ pgp_key_t *pgp_getkeybyaddr (struct pgp_vinfo * pgp, continue; } + pkey = pgp_principal_key (k); + kflags = k->flags | pkey->flags; + q = k->address; weak_association = 1; match = 0; @@ -644,7 +647,9 @@ pgp_key_t *pgp_getkeybyaddr (struct pgp_vinfo * pgp, match = 1; if (((q->trust & 0x03) == 3) && - (p->mailbox && a->mailbox && !mutt_strcasecmp (p->mailbox, a->mailbox))) + !(kflags & KEYFLAG_CANTUSE) && + (p->mailbox && a->mailbox && + !mutt_strcasecmp (p->mailbox, a->mailbox))) weak_association = 0; } } |