aboutsummaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2024-10-08 06:25:41 +0000
committerNIIBE Yutaka <[email protected]>2024-10-08 06:25:41 +0000
commit57dce1ee62c2b900b852877c1c9754126b87ed0f (patch)
tree59e06ebe2703c30d6026dea4f4bb6fa9f6e96e4b /sm
parentcommon,gpg,scd,sm: Use openpgp_oid_or_name_to_curve to get curve. (diff)
downloadgnupg-57dce1ee62c2b900b852877c1c9754126b87ed0f.tar.gz
gnupg-57dce1ee62c2b900b852877c1c9754126b87ed0f.zip
common,gpg,scd,sm: Fix for Curve25519 OID supporting new and old.
* common/util.h (openpgp_curve_to_oid): Add new argument to select OID by OpenPGP version. * common/openpgp-oid.c (openpgp_curve_to_oid): Implement returning selected OID for Curve25519. * common/openpgp-fpr.c (compute_openpgp_fpr_ecc): Follow the change, selecting by the version. * g10/export.c (match_curve_skey_pk): Likewise. (transfer_format_to_openpgp): Likewise. * g10/gpg.c (list_config): Likewise, print new OID. * g10/keygen.c (ecckey_from_sexp): Likewise, selecting by the version. * sm/encrypt.c (ecdh_encrypt): Likewise, don't care. * sm/minip12.c (build_ecc_key_sequence): Likewise, new OID. * scd/app-openpgp.c (ecdh_params, gen_challenge): Likewise, don't care. (ecc_read_pubkey, change_keyattr_from_string, ecc_writekey): Likewise, old OID. -- GnuPG-bug-id: 7316 Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'sm')
-rw-r--r--sm/encrypt.c2
-rw-r--r--sm/minip12.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sm/encrypt.c b/sm/encrypt.c
index 202bbb92f..98d3024ad 100644
--- a/sm/encrypt.c
+++ b/sm/encrypt.c
@@ -218,7 +218,7 @@ ecdh_encrypt (DEK dek, gcry_sexp_t s_pkey, gcry_sexp_t *r_encval)
* canonical numerical OID. We also use this to get the size of the
* curve which we need to figure out a suitable hash algo. We
* should have a Libgcrypt function to do this; see bug report #4926. */
- curve = openpgp_curve_to_oid (curvebuf, &curvebits, NULL);
+ curve = openpgp_curve_to_oid (curvebuf, &curvebits, NULL, -1);
if (!curve)
{
err = gpg_error (GPG_ERR_UNKNOWN_CURVE);
diff --git a/sm/minip12.c b/sm/minip12.c
index 00ba26d7d..34ba1a53b 100644
--- a/sm/minip12.c
+++ b/sm/minip12.c
@@ -2596,7 +2596,7 @@ build_ecc_key_sequence (gcry_mpi_t *kparms, int mode, size_t *r_length)
/* We need to use our OpenPGP mapping to turn a curve name into its
* canonical numerical OID. We should have a Libgcrypt function to
* do this; see bug report #4926. */
- curve = openpgp_curve_to_oid (p, &curvebits, NULL);
+ curve = openpgp_curve_to_oid (p, &curvebits, NULL, 1);
xfree (p);
if (!curve)
{