diff options
author | Neal H. Walfield <[email protected]> | 2015-09-16 12:05:03 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2015-09-16 13:15:29 +0000 |
commit | 77c2ad4a817c129b899708399ed2078a52b452b8 (patch) | |
tree | 17e4d4600b2a39a9ed1f061c51d2caceec612897 | |
parent | g10: Release resources when returning an error in get_seckey. (diff) | |
download | gnupg-77c2ad4a817c129b899708399ed2078a52b452b8.tar.gz gnupg-77c2ad4a817c129b899708399ed2078a52b452b8.zip |
g10: Also mark revoked and expired keys as unusable.
* g10/getkey.c (skip_unusable): Also mark the key as unusable if it
has been revoked or has expired.
--
Signed-off-by: Neal H. Walfield <[email protected]>.
Diffstat (limited to '')
-rw-r--r-- | g10/getkey.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/g10/getkey.c b/g10/getkey.c index 18ef84ef6..4ade93e2f 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -592,8 +592,12 @@ skip_unusable (void *dummy, u32 * keyid, int uid_no) pk = keyblock->pkt->pkt.public_key; - /* Is the user ID in question revoked/expired? */ - if (uid_no) + /* Is the key revoked or expired? */ + if (pk->flags.revoked || pk->has_expired) + unusable = 1; + + /* Is the user ID in question revoked or expired? */ + if (!unusable && uid_no) { KBNODE node; int uids_seen = 0; |