From 9463dd7e0cd97e68300ef74d1aa727412eaa5ef8 Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Fri, 27 Aug 2021 14:40:01 -0400 Subject: [PATCH] Fix build on ancient platforms lacking SHA224 --- cups/hash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cups/hash.c b/cups/hash.c index c153c66559..ba7d6ec1c9 100644 --- a/cups/hash.c +++ b/cups/hash.c @@ -85,6 +85,7 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */ return (CC_SHA1_DIGEST_LENGTH); } +#ifdef CC_SHA224_DIGEST_LENGTH else if (!strcmp(algorithm, "sha2-224")) { CC_SHA256_CTX ctx; /* SHA-224 context */ @@ -98,6 +99,7 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */ return (CC_SHA224_DIGEST_LENGTH); } +#endif /* CC_SHA224_DIGEST_LENGTH */ else if (!strcmp(algorithm, "sha2-256")) { CC_SHA256_CTX ctx; /* SHA-256 context */ @@ -137,6 +139,7 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */ return (CC_SHA512_DIGEST_LENGTH); } +#ifdef CC_SHA224_DIGEST_LENGTH else if (!strcmp(algorithm, "sha2-512_224")) { CC_SHA512_CTX ctx; /* SHA-512 context */ @@ -158,6 +161,7 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */ return (CC_SHA224_DIGEST_LENGTH); } +#endif /* CC_SHA224_DIGEST_LENGTH */ else if (!strcmp(algorithm, "sha2-512_256")) { CC_SHA512_CTX ctx; /* SHA-512 context */ -- 2.47.2