]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle MD5 not being supported by lib crypto
authorMark Andrews <marka@isc.org>
Wed, 22 Mar 2023 00:14:11 +0000 (11:14 +1100)
committerMark Andrews <marka@isc.org>
Mon, 3 Apr 2023 02:44:27 +0000 (12:44 +1000)
When initialising the message digests in lib/isc/md.c no
longer assume that the initialisation cannot fail.

lib/isc/md.c

index 725fef04c7c3c9e65bf457f25524d8454e88600b..4efaee4466b57c00c635c88fcc4db5057c3a96e0 100644 (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