mirror of
git://git.gnupg.org/gnupg.git
synced 2024-10-30 19:58:44 +01:00
gpg: Do not show RENC if no key capabilities are found for a key.
* g10/packet.h (PUBKEY_USAGE_BASIC_MASK): New. * g10/getkey.c (merge_selfsigs_subkey): Mask the default. (merge_selfsigs_main): Ditto. --
This commit is contained in:
parent
bc43812358
commit
1d91252205
@ -3137,7 +3137,8 @@ merge_selfsigs_main (ctrl_t ctrl, kbnode_t keyblock, int *r_revoked,
|
||||
if (!key_usage)
|
||||
{
|
||||
/* No key flags at all: get it from the algo. */
|
||||
key_usage = openpgp_pk_algo_usage (pk->pubkey_algo);
|
||||
key_usage = (openpgp_pk_algo_usage (pk->pubkey_algo)
|
||||
& PUBKEY_USAGE_BASIC_MASK);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3411,7 +3412,8 @@ merge_selfsigs_subkey (ctrl_t ctrl, kbnode_t keyblock, kbnode_t subnode)
|
||||
if (!key_usage)
|
||||
{
|
||||
/* No key flags at all: get it from the algo. */
|
||||
key_usage = openpgp_pk_algo_usage (subpk->pubkey_algo);
|
||||
key_usage = (openpgp_pk_algo_usage (subpk->pubkey_algo)
|
||||
& PUBKEY_USAGE_BASIC_MASK);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -60,6 +60,11 @@
|
||||
#define PUBKEY_USAGE_RENC 1024 /* Restricted encryption. */
|
||||
#define PUBKEY_USAGE_TIME 2048 /* Timestamp use. */
|
||||
|
||||
/* The usage bits which can be derived from the algo. */
|
||||
#define PUBKEY_USAGE_BASIC_MASK (PUBKEY_USAGE_SIG|PUBKEY_USAGE_ENC\
|
||||
|PUBKEY_USAGE_CERT|PUBKEY_USAGE_AUTH)
|
||||
|
||||
|
||||
/* Helper macros. */
|
||||
#define is_RSA(a) ((a)==PUBKEY_ALGO_RSA || (a)==PUBKEY_ALGO_RSA_E \
|
||||
|| (a)==PUBKEY_ALGO_RSA_S )
|
||||
|
Loading…
Reference in New Issue
Block a user