diff options
author | Werner Koch <[email protected]> | 2023-04-21 12:04:04 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2023-04-21 13:23:29 +0000 |
commit | c03ba92576e34f791430ab1c68814ff16c81407b (patch) | |
tree | 196ae333ab0f0213f9164dc5585e5530c5c49d1c /g10/keydb.h | |
parent | common: Incorporate upstream changes of regexp. (diff) | |
download | gnupg-c03ba92576e34f791430ab1c68814ff16c81407b.tar.gz gnupg-c03ba92576e34f791430ab1c68814ff16c81407b.zip |
gpg: Fix writing ECDH keys to OpenPGP smartcards.
* agent/command.c (cmd_keytocard): Add new arg for ECDH params.
* scd/app-openpgp.c (ecc_writekey): Use provided ECDH params to
compute the fingerprint.
* g10/call-agent.c (agent_keytocard): Add arg ecdh_param_str.
* g10/keyid.c (ecdh_param_str_from_pk): New.
* g10/card-util.c (card_store_subkey): Pass ECDH params to writekey.
* g10/keygen.c (card_store_key_with_backup): Ditto.
* scd/app-openpgp.c (store_fpr): Add arg update.
(rsa_read_pubkey, ecc_read_pubkey): Add arg meta_update and avoid
writing the fingerprint back to the card if not set.
(read_public_key): Also add arg meta_update.
(get_public_key): Do not pass it as true here...
(do_genkey): ... but here.
(rsa_write_key, ecc_writekey): Force string the fingerprint.
--
The problem showed up because in 2.4 we changed the standard ECDH
parameter some years ago. Now when trying to write an ECDH key
created by 2.2 with 2.4 to an openpgp card, scdaemon computes a wrong
fingerprint and thus gpg was not able to find the key again by
fingerprint.
The patch also avoids updating the stored fingerprint in certain
situations.
This fix is somewhat related to
GnuPG-bug-id: 6378
Diffstat (limited to 'g10/keydb.h')
-rw-r--r-- | g10/keydb.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/keydb.h b/g10/keydb.h index 9323e3137..1a66d664e 100644 --- a/g10/keydb.h +++ b/g10/keydb.h @@ -576,6 +576,7 @@ char *format_hexfingerprint (const char *fingerprint, char *buffer, size_t buflen); gpg_error_t keygrip_from_pk (PKT_public_key *pk, unsigned char *array); gpg_error_t hexkeygrip_from_pk (PKT_public_key *pk, char **r_grip); +char *ecdh_param_str_from_pk (PKT_public_key *pk); /*-- kbnode.c --*/ |