From 98943422b583d73dcdaaa1b56e86214862d3066e Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 19 Jun 2026 13:32:09 +0100 Subject: [PATCH] test: sha1/sm3/md5 can get build-time disabled in openssl Do not fail tests if any of these get disabled in the openssl build Follow-up for c52a003dc86bb91b2724a00449a50b26009fdfd0 --- src/test/test-crypto-util.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test-crypto-util.c b/src/test/test-crypto-util.c index 989905ab0f..c4ba643671 100644 --- a/src/test/test-crypto-util.c +++ b/src/test/test-crypto-util.c @@ -101,9 +101,11 @@ static const struct { const char *alg; size_t size; } digest_size_table[] = { +#ifndef OPENSSL_NO_SHA1 /* SHA1 "family" */ { "sha1", 20, }, { "sha-1", 20, }, +#endif /* SHA2 family */ { "sha224", 28, }, { "sha256", 32, }, @@ -122,10 +124,14 @@ static const struct { { "sha3-256", 32, }, { "sha3-384", 48, }, { "sha3-512", 64, }, +#ifndef OPENSSL_NO_SM3 /* SM3 family */ { "sm3", 32, }, +#endif +#ifndef OPENSSL_NO_MD5 /* MD5 family */ { "md5", 16, }, +#endif }; TEST(digest_size) {