From 4c456bf07508cb65f4937394afc1ee18f1fd2655 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 23 Nov 2023 16:01:58 +0100 Subject: [PATCH] scd:openpgp: Fallback to default ECDH params in writekey. * scd/app-openpgp.c (ecc_writekey): Use default ECDH parameters and remove the now useless check. -- This seems to be better than bailing out. In almost all cases our standard parameters are used and if not, well, the fingerprint will be wrong. GnuPG-bug-id: 6378 --- scd/app-openpgp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 014cd9395..3e77f8540 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -4733,9 +4733,11 @@ ecc_writekey (app_t app, ctrl_t ctrl, if (algo == PUBKEY_ALGO_ECDH && !ecdh_param) { - log_error ("opgp: ecdh parameters missing\n"); - err = gpg_error (GPG_ERR_INV_VALUE); - goto leave; + /* In case this is used by older clients we fallback to our + * default ecc parameters. */ + log_info ("opgp: using default ecdh parameters\n"); + ecdh_param = ecdh_params (curve); + ecdh_param_len = 4; } oidstr = openpgp_curve_to_oid (curve, &n, NULL);