Handle MD5 not being supported by lib crypto

When initialising the message digests in lib/isc/md.c no
longer assume that the initialisation cannot fail.
This commit is contained in:
Mark Andrews
2023-03-22 11:14:11 +11:00
parent f138a1447a
commit 2abd6c7ab4

View File

@@ -177,21 +177,20 @@ const isc_md_type_t *isc__md_sha512 = NULL;
{ \
REQUIRE(isc__md_##alg == NULL); \
isc__md_##alg = EVP_MD_fetch(NULL, algname, NULL); \
RUNTIME_CHECK(isc__md_##alg != NULL); \
}
#define md_unregister_algorithm(alg) \
{ \
REQUIRE(isc__md_##alg != NULL); \
EVP_MD_free(*(isc_md_type_t **)&isc__md_##alg); \
isc__md_##alg = NULL; \
#define md_unregister_algorithm(alg) \
{ \
if (isc__md_##alg != NULL) { \
EVP_MD_free(*(isc_md_type_t **)&isc__md_##alg); \
isc__md_##alg = NULL; \
} \
}
#else
#define md_register_algorithm(alg, algname) \
{ \
isc__md_##alg = EVP_##alg(); \
RUNTIME_CHECK(isc__md_##alg != NULL); \
#define md_register_algorithm(alg, algname) \
{ \
isc__md_##alg = EVP_##alg(); \
}
#define md_unregister_algorithm(alg)
#endif