From 77c2ad4a817c129b899708399ed2078a52b452b8 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Wed, 16 Sep 2015 14:05:03 +0200 Subject: [PATCH] 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 . --- g10/getkey.c | 8 ++++++-- 1 file 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;