mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
gpg: Fix selection of key.
* g10/getkey.c (pubkey_cmp): Handle the case of TRUST_EXPIRED. -- GnuPG-bug-id: 4713 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
7f3ce66ec5
commit
390f597868
@ -1359,7 +1359,9 @@ pubkey_cmp (ctrl_t ctrl, const char *name, struct pubkey_cmp_cookie *old,
|
|||||||
if (! uid_is_ok (&old->key, old->uid) && uid_is_ok (&new->key, uid))
|
if (! uid_is_ok (&old->key, old->uid) && uid_is_ok (&new->key, uid))
|
||||||
return -1; /* Validity of the NEW key is better. */
|
return -1; /* Validity of the NEW key is better. */
|
||||||
|
|
||||||
if (old->validity < new->validity)
|
if (new->validity != TRUST_EXPIRED && old->validity < new->validity)
|
||||||
|
return -1; /* Validity of the NEW key is better. */
|
||||||
|
if (old->validity == TRUST_EXPIRED && new->validity != TRUST_EXPIRED)
|
||||||
return -1; /* Validity of the NEW key is better. */
|
return -1; /* Validity of the NEW key is better. */
|
||||||
|
|
||||||
if (old->validity == new->validity && uid_is_ok (&new->key, uid)
|
if (old->validity == new->validity && uid_is_ok (&new->key, uid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user