diff options
author | Werner Koch <[email protected]> | 2023-05-25 14:43:37 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2023-05-25 14:43:44 +0000 |
commit | 9f2f7a51b2430056168363828722afc6c7488946 (patch) | |
tree | 463ad4f56832eadc2b58dcf000aaf67d21a83266 /g10/encrypt.c | |
parent | gpg: Fix searching for the ADSK key when adding an ADSK. (diff) | |
download | gnupg-9f2f7a51b2430056168363828722afc6c7488946.tar.gz gnupg-9f2f7a51b2430056168363828722afc6c7488946.zip |
gpg: Skip keys found via ADSKs.
* g10/encrypt.c (write_pubkey_enc): Indicate encryption to an ADSK.
* g10/getkey.c (finish_lookup): Skip ADKS keys.
--
If a key is searched by fingerprint or keyid and it happens that this
is an ADSK (subkey with the RENC usage), we need to skip this key
because it is not the key we actually want to encrypt to. The actual
ADSK key is taken later by looking at all subkeys of the actual
selected key.
This is related to
GnuPG-bug-id: 6504
Diffstat (limited to 'g10/encrypt.c')
-rw-r--r-- | g10/encrypt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/g10/encrypt.c b/g10/encrypt.c index 687b4344e..ff1c6be85 100644 --- a/g10/encrypt.c +++ b/g10/encrypt.c @@ -1171,6 +1171,12 @@ write_pubkey_enc (ctrl_t ctrl, if ( opt.verbose ) { char *ustr = get_user_id_string_native (ctrl, enc->keyid); + if ((pk->pubkey_usage & PUBKEY_USAGE_RENC)) + { + char *tmpustr = xstrconcat (ustr, " [ADSK]", NULL); + xfree (ustr); + ustr = tmpustr; + } log_info (_("%s/%s.%s encrypted for: \"%s\"\n"), openpgp_pk_algo_name (enc->pubkey_algo), openpgp_cipher_algo_name (dek->algo), |