Commit d2e4f588b6 for openssl.org
commit d2e4f588b69a09000ab34c828cc87c642e504353
Author: Heath Dutton🕴️ <heathdutton@gmail.com>
Date: Wed Jan 7 14:37:55 2026 -0500
apps/speed.c: support algorithm name aliases in kem and sig lookup
Fixes #29355
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29571)
diff --git a/apps/speed.c b/apps/speed.c
index bd1a0da705..cda7e4cbfb 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;
}