summaryrefslogtreecommitdiff
path: root/src/sys-crypto-md.h
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-11-10 07:44:53 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2020-11-10 07:44:53 -0500
commit5ec13918d31e2b9dedf6f754d11a7cdd78f2d45f (patch)
tree94c2f5681977555e40c484513acd4918a0e63987 /src/sys-crypto-md.h
parent47aa6d4ac84528cc18d70afd9fca7596a271a77e (diff)
downloadlighttpd-git-5ec13918d31e2b9dedf6f754d11a7cdd78f2d45f.tar.gz
[core] define SHA*_DIGEST_LENGTH macros if missing
Diffstat (limited to 'src/sys-crypto-md.h')
-rw-r--r--src/sys-crypto-md.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/sys-crypto-md.h b/src/sys-crypto-md.h
index c8a9e1ce..4b320ed8 100644
--- a/src/sys-crypto-md.h
+++ b/src/sys-crypto-md.h
@@ -104,9 +104,6 @@ SHA256_Update(SHA256_CTX *ctx, const void *data, size_t length)
}
#define USE_LIB_CRYPTO_SHA512_256
-#ifndef SHA512_256_DIGEST_LENGTH
-#define SHA512_256_DIGEST_LENGTH 32
-#endif
typedef struct sha512_256_ctx SHA512_CTX; /*(yes, SHA512_CTX)*/
static inline int
SHA512_256_Init(SHA512_CTX *ctx)
@@ -679,4 +676,18 @@ NSS_gen_hashfuncs(SHA256, HASH_AlgSHA256);
#endif
+#ifdef USE_LIB_CRYPTO_SHA256
+#ifndef SHA256_DIGEST_LENGTH
+#define SHA256_DIGEST_LENGTH 32
+#endif
+#endif
+
+
+#ifdef USE_LIB_CRYPTO_SHA512_256
+#ifndef SHA512_256_DIGEST_LENGTH
+#define SHA512_256_DIGEST_LENGTH 32
+#endif
+#endif
+
+
#endif /* LI_SYS_CRYPTO_MD_H */