]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: sha1/sm3/md5 can get build-time disabled in openssl
authorLuca Boccassi <luca.boccassi@gmail.com>
Fri, 19 Jun 2026 12:32:09 +0000 (13:32 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 19 Jun 2026 12:32:24 +0000 (13:32 +0100)
Do not fail tests if any of these get disabled in the openssl
build

Follow-up for c52a003dc86bb91b2724a00449a50b26009fdfd0

src/test/test-crypto-util.c

index 989905ab0f823786ab7eeb3fc22f84dec8498aa9..c4ba64367137dde0249d9ca673b7fb1f94990cd8 100644 (file)
@@ -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) {