From: Heath Dutton🕴️ Date: Wed, 7 Jan 2026 19:37:55 +0000 (-0500) Subject: apps/speed.c: support algorithm name aliases in kem and sig lookup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2e4f588b69a09000ab34c828cc87c642e504353;p=thirdparty%2Fopenssl.git apps/speed.c: support algorithm name aliases in kem and sig lookup Fixes #29355 Reviewed-by: Paul Dale Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/29571) --- diff --git a/apps/speed.c b/apps/speed.c index bd1a0da7051..cda7e4cbfb2 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -1895,6 +1895,8 @@ static void collect_kem(EVP_KEM *kem, void *stack) static int kem_locate(const char *algo, unsigned int *idx) { unsigned int i; + EVP_KEM *kem; + const char *canonical_name; for (i = 0; i < kems_algs_len; i++) { if (strcmp(kems_algname[i], algo) == 0) { @@ -1902,6 +1904,18 @@ static int kem_locate(const char *algo, unsigned int *idx) return 1; } } + kem = EVP_KEM_fetch(app_get0_libctx(), algo, app_get0_propq()); + if (kem != NULL) { + canonical_name = EVP_KEM_get0_name(kem); + for (i = 0; i < kems_algs_len; i++) { + if (strcmp(kems_algname[i], canonical_name) == 0) { + *idx = i; + EVP_KEM_free(kem); + return 1; + } + } + EVP_KEM_free(kem); + } return 0; } @@ -1927,6 +1941,8 @@ static void collect_signatures(EVP_SIGNATURE *sig, void *stack) static int sig_locate(const char *algo, unsigned int *idx) { unsigned int i; + EVP_SIGNATURE *sig; + const char *canonical_name; for (i = 0; i < sigs_algs_len; i++) { if (strcmp(sigs_algname[i], algo) == 0) { @@ -1934,6 +1950,18 @@ static int sig_locate(const char *algo, unsigned int *idx) return 1; } } + sig = EVP_SIGNATURE_fetch(app_get0_libctx(), algo, app_get0_propq()); + if (sig != NULL) { + canonical_name = EVP_SIGNATURE_get0_name(sig); + for (i = 0; i < sigs_algs_len; i++) { + if (strcmp(sigs_algname[i], canonical_name) == 0) { + *idx = i; + EVP_SIGNATURE_free(sig); + return 1; + } + } + EVP_SIGNATURE_free(sig); + } return 0; }