From a6e40530898622fbc5d76557a7da5e69368ecaa4 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 6 Aug 2015 16:44:03 +0900 Subject: common: extend API of openpgp_oid_to_curve for canonical name. * common/openpgp-oid.c (openpgp_oid_to_curve): Add CANON argument. * common/util.h: Update. * g10/import.c (transfer_secret_keys): Follow the change. * g10/keyid.c (pubkey_string): Likewise. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Likewise. * parse-packet.c (parse_key): Likewise. * scd/app-openpgp.c (send_key_attr, get_public_key): Likewise. -- Change the function so that caller can select canonical name of curve or name for printing. Suggested by wk. --- scd/app-openpgp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scd/app-openpgp.c') diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index cc9577383..637f6b19d 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -911,7 +911,7 @@ send_key_attr (ctrl_t ctrl, app_t app, const char *keyword, int keyno) keyno+1, app->app_local->keyattr[keyno].ecc.flags? PUBKEY_ALGO_EDDSA: (keyno==1? PUBKEY_ALGO_ECDH: PUBKEY_ALGO_ECDSA), - openpgp_oid_to_curve (app->app_local->keyattr[keyno].ecc.oid)); + openpgp_oid_to_curve (app->app_local->keyattr[keyno].ecc.oid, 0)); } else snprintf (buffer, sizeof buffer, "%d 0 0 UNKNOWN", keyno+1); @@ -1442,7 +1442,7 @@ get_public_key (app_t app, int keyno) format = "(public-key(ecc(curve%s)(flags eddsa)(q%b)))"; err = gcry_sexp_build (&s_pkey, NULL, format, - openpgp_oid_to_curve (app->app_local->keyattr[keyno].ecc.oid), + openpgp_oid_to_curve (app->app_local->keyattr[keyno].ecc.oid, 1), (int)mlen, mbuf); if (err) goto leave; -- cgit v1.2.3