aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2024-10-08 05:48:47 +0000
committerNIIBE Yutaka <[email protected]>2024-10-08 05:58:29 +0000
commitf5703994d4692fc310292a93296626f484936b16 (patch)
treebd11c037af4ed11e70fa6525835a00487c3239fe /g10
parentImplement GNUPG_ASSUME_COMPLIANCE envvar for testing (diff)
downloadgnupg-f5703994d4692fc310292a93296626f484936b16.tar.gz
gnupg-f5703994d4692fc310292a93296626f484936b16.zip
common,gpg,scd,sm: Use openpgp_oid_or_name_to_curve to get curve.
* common/sexputil.c (pubkey_algo_string): Use openpgp_oid_or_name_to_curve. * g10/card-util.c (current_card_status, ask_card_keyattr): Likewise. * scd/app-piv.c (writekey_ecc): Likewise. * sm/fingerprint.c (gpgsm_get_key_algo_info): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'g10')
-rw-r--r--g10/card-util.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/g10/card-util.c b/g10/card-util.c
index 002b26e45..5fd6094fc 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -631,13 +631,7 @@ current_card_status (ctrl_t ctrl, estream_t fp,
const char *curve_for_print = "?";
if (info.key_attr[i].curve)
- {
- const char *oid;
- oid = openpgp_curve_to_oid (info.key_attr[i].curve,
- NULL, NULL);
- if (oid)
- curve_for_print = openpgp_oid_to_curve (oid, 0);
- }
+ curve_for_print = openpgp_oid_or_name_to_curve (info.key_attr[i].curve, 0);
tty_fprintf (fp, " %s", curve_for_print);
}
tty_fprintf (fp, "\n");
@@ -1524,7 +1518,6 @@ ask_card_keyattr (int keyno, const struct key_attr *current)
else
{
const char *curve;
- const char *oid_str;
if (current->algo == PUBKEY_ALGO_RSA)
{
@@ -1545,8 +1538,7 @@ ask_card_keyattr (int keyno, const struct key_attr *current)
if (curve)
{
key_attr->algo = algo;
- oid_str = openpgp_curve_to_oid (curve, NULL, NULL);
- key_attr->curve = openpgp_oid_to_curve (oid_str, 0);
+ key_attr->curve = openpgp_oid_or_name_to_curve (curve, 0);
}
else
{