summaryrefslogtreecommitdiffstats
path: root/g10/getkey.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2013-03-20 10:00:12 +0100
committerWerner Koch <wk@gnupg.org>2013-03-20 10:00:12 +0100
commiteaa6dc3a8b4f31525650cd4785d6bafab86d68b7 (patch)
tree6552e846c825e2dae78d5ceefebee0e2acaeb27f /g10/getkey.c
parentAdd code to allow for late memory cleanup. (diff)
parentgpg: Print indicator for unknown key capability. (diff)
downloadgnupg2-eaa6dc3a8b4f31525650cd4785d6bafab86d68b7.tar.xz
gnupg2-eaa6dc3a8b4f31525650cd4785d6bafab86d68b7.zip
Merge branch 'master' into key-storage-work
--
Diffstat (limited to 'g10/getkey.c')
-rw-r--r--g10/getkey.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index 60429b6a1..4453a92d5 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1291,13 +1291,19 @@ parse_key_usage (PKT_signature * sig)
if (flags)
key_usage |= PUBKEY_USAGE_UNKNOWN;
+
+ if (!key_usage)
+ key_usage |= PUBKEY_USAGE_NONE;
}
+ else if (p) /* Key flags of length zero. */
+ key_usage |= PUBKEY_USAGE_NONE;
/* We set PUBKEY_USAGE_UNKNOWN to indicate that this key has a
capability that we do not handle. This serves to distinguish
between a zero key usage which we handle as the default
capabilities for that algorithm, and a usage that we do not
- handle. */
+ handle. Likewise we use PUBKEY_USAGE_NONE to indicate that
+ key_flags have been given but they do not specify any usage. */
return key_usage;
}