mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-13 22:21:09 +02:00
gpg: For decryption, support use of a key with no 'encrypt' usage.
* g10/pubkey-enc.c (get_session_key): Don't skip at no PUBKEY_USAGE_ENC. Emit information the key has no 'encrypt' usage. -- GnuPG-bug-id: 4246 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
b4501fc826
commit
31ae0718ba
@ -91,9 +91,6 @@ get_session_key (ctrl_t ctrl, struct pubkey_enc_list *list, DEK *dek)
|
|||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!(sk->pubkey_usage & PUBKEY_USAGE_ENC))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* Check compliance. */
|
/* Check compliance. */
|
||||||
if (! gnupg_pk_is_allowed (opt.compliance, PK_USE_DECRYPTION,
|
if (! gnupg_pk_is_allowed (opt.compliance, PK_USE_DECRYPTION,
|
||||||
sk->pubkey_algo, 0,
|
sk->pubkey_algo, 0,
|
||||||
@ -144,7 +141,10 @@ get_session_key (ctrl_t ctrl, struct pubkey_enc_list *list, DEK *dek)
|
|||||||
}
|
}
|
||||||
else if (opt.try_all_secrets
|
else if (opt.try_all_secrets
|
||||||
|| (k->keyid[0] == keyid[0] && k->keyid[1] == keyid[1]))
|
|| (k->keyid[0] == keyid[0] && k->keyid[1] == keyid[1]))
|
||||||
;
|
{
|
||||||
|
if (!opt.quiet && !(sk->pubkey_usage & PUBKEY_USAGE_ENC))
|
||||||
|
log_info (_("using the key with no 'encrypt' usage.\n"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -153,7 +153,11 @@ get_session_key (ctrl_t ctrl, struct pubkey_enc_list *list, DEK *dek)
|
|||||||
if (!err)
|
if (!err)
|
||||||
{
|
{
|
||||||
if (!opt.quiet && !k->keyid[0] && !k->keyid[1])
|
if (!opt.quiet && !k->keyid[0] && !k->keyid[1])
|
||||||
log_info (_("okay, we are the anonymous recipient.\n"));
|
{
|
||||||
|
log_info (_("okay, we are the anonymous recipient.\n"));
|
||||||
|
if (!(sk->pubkey_usage & PUBKEY_USAGE_ENC))
|
||||||
|
log_info (_("using the key with no 'encrypt' usage.\n"));
|
||||||
|
}
|
||||||
search_for_secret_keys = 0;
|
search_for_secret_keys = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user