From 24095101a5069f15a9aea7512498ac436a76814a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 11 Feb 2020 14:38:03 +0100 Subject: common: Extend the openpgp_curve_to_oid function. * common/openpgp-oid.c (openpgp_curve_to_oid): Add optional arg R_NBITS. Change all callers. -- In particular for ed25519 and cv25519 it is quite useful to have an ability to get the required algorithm. --- common/util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/util.h') diff --git a/common/util.h b/common/util.h index a6bab2415..64d6c1627 100644 --- a/common/util.h +++ b/common/util.h @@ -238,7 +238,8 @@ int openpgp_oidbuf_is_ed25519 (const void *buf, size_t len); int openpgp_oid_is_ed25519 (gcry_mpi_t a); int openpgp_oidbuf_is_cv25519 (const void *buf, size_t len); int openpgp_oid_is_cv25519 (gcry_mpi_t a); -const char *openpgp_curve_to_oid (const char *name, unsigned int *r_nbits); +const char *openpgp_curve_to_oid (const char *name, + unsigned int *r_nbits, int *r_algo); const char *openpgp_oid_to_curve (const char *oid, int canon); const char *openpgp_oid_or_name_to_curve (const char *oidname, int canon); const char *openpgp_enum_curves (int *idxp); -- cgit v1.2.3