From: Luca Boccassi Date: Fri, 19 Jun 2026 12:32:09 +0000 (+0100) Subject: test: sha1/sm3/md5 can get build-time disabled in openssl X-Git-Tag: v261~8^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98943422b583d73dcdaaa1b56e86214862d3066e;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/test/test-crypto-util.c b/src/test/test-crypto-util.c index 989905ab0f8..c4ba6436713 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) {