aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--common/openpgp-oid.c8
-rw-r--r--common/util.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/common/openpgp-oid.c b/common/openpgp-oid.c
index 676079cde..af91bb1aa 100644
--- a/common/openpgp-oid.c
+++ b/common/openpgp-oid.c
@@ -333,10 +333,10 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits)
/* Map an OpenPGP OID to the Libgcrypt curve NAME. Returns NULL for
- unknown curve names. We prefer an alias name here which is more
- suitable for printing. */
+ unknown curve names. Unless CANON is set we prefer an alias name
+ here which is more suitable for printing. */
const char *
-openpgp_oid_to_curve (const char *oidstr)
+openpgp_oid_to_curve (const char *oidstr, int canon)
{
int i;
@@ -345,7 +345,7 @@ openpgp_oid_to_curve (const char *oidstr)
for (i=0; oidtable[i].name; i++)
if (!strcmp (oidtable[i].oidstr, oidstr))
- return oidtable[i].alias? oidtable[i].alias : oidtable[i].name;
+ return !canon && oidtable[i].alias? oidtable[i].alias : oidtable[i].name;
return NULL;
}
diff --git a/common/util.h b/common/util.h
index 90acefa1a..df0f39290 100644
--- a/common/util.h
+++ b/common/util.h
@@ -323,7 +323,7 @@ gpg_error_t openpgp_oid_from_str (const char *string, gcry_mpi_t *r_mpi);
char *openpgp_oid_to_str (gcry_mpi_t a);
int openpgp_oid_is_ed25519 (gcry_mpi_t a);
const char *openpgp_curve_to_oid (const char *name, unsigned int *r_nbits);
-const char *openpgp_oid_to_curve (const char *oid);
+const char *openpgp_oid_to_curve (const char *oid, int canon);
const char *openpgp_enum_curves (int *idxp);