gnupg/scd
Werner Koch c03ba92576
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
2023-04-21 15:23:29 +02:00
..
ChangeLog-2011 Generate the ChangeLog from commit logs. 2011-12-01 11:09:02 +01:00
Makefile.am scd: Add very basic support for PIV cards. 2019-01-20 11:45:57 +01:00
apdu.c scd: Redact --debug cardio output of a VERIFY APDU. 2022-11-17 14:33:18 +01:00
apdu.h scd:p15: Make it code work again for D-Trust cards. 2021-02-23 12:56:42 +01:00
app-common.h scd: On a Yubikey re-select the last app after the use of APDU. 2023-04-18 12:04:15 +02:00
app-dinsig.c scd: Replace all assert macros by the log_assert macro. 2021-03-31 19:16:05 +02:00
app-geldkarte.c scd: Replace all assert macros by the log_assert macro. 2021-03-31 19:16:05 +02:00
app-help.c scd: Fix duplicate output of KEYPAIRINFO by readkey command. 2021-04-08 19:27:25 +02:00
app-nks.c scd:nks: Fix ECC signing if key not given by keygrip. 2022-11-15 14:52:40 +01:00
app-openpgp.c gpg: Fix writing ECDH keys to OpenPGP smartcards. 2023-04-21 15:23:29 +02:00
app-p15.c scd,p15: Enforce a min. PIN length for certain cards. 2023-04-20 12:41:08 +02:00
app-piv.c scd: Return USAGE information for KEYINFO command. 2022-05-26 12:01:16 +09:00
app-sc-hsm.c agent,dirmngr,gpg,scd: Clean up for modern compiler. 2022-09-14 12:08:58 +09:00
app.c scd: On a Yubikey re-select the last app after the use of APDU. 2023-04-18 12:04:15 +02:00
atr.c scd: Replace all assert macros by the log_assert macro. 2021-03-31 19:16:05 +02:00
atr.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
ccid-driver.c scd: Add npth_unprotect/npth_protect for blocking operations. 2022-08-25 13:13:11 +09:00
ccid-driver.h scd:ccid-driver: Fix pinpad error handling for cancel/timeout. 2020-11-27 15:17:56 +09:00
command.c scd: On a Yubikey re-select the last app after the use of APDU. 2023-04-18 12:04:15 +02:00
iso7816.c scd: Improve reading of binary records. 2021-06-18 17:42:38 +02:00
iso7816.h scd:p15: Support ECDSA and ECDH for CardOS. 2021-03-29 14:49:08 +02:00
scdaemon-w32info.rc w32: Add icons and version information. 2013-05-07 21:35:48 +02:00
scdaemon.c gpg,common,scd,sm: Function prototype fixes for modern compiler. 2022-09-13 16:34:00 +09:00
scdaemon.h scd: Return USAGE information for KEYINFO command. 2022-05-26 12:01:16 +09:00