]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
make feature-test --md5 --with-fips aware
authorMark Andrews <marka@isc.org>
Fri, 24 Feb 2023 01:21:04 +0000 (12:21 +1100)
committerMark Andrews <marka@isc.org>
Mon, 3 Apr 2023 02:44:27 +0000 (12:44 +1000)
bin/tests/system/feature-test.c

index 00d78f8f207a901f80fdcd54ee75a2efda1b7363..5b3c504d62628116933ee9fa42cdf6b5cf958816 100644 (file)
@@ -198,17 +198,15 @@ main(int argc, char **argv) {
        }
 
        if (strcmp(argv[1], "--md5") == 0) {
-               unsigned char digest[ISC_MAX_MD_SIZE];
-               const unsigned char test[] = "test";
-               unsigned int size = sizeof(digest);
+               isc_mem_t *mctx = NULL;
+               int answer;
 
-               if (isc_md(ISC_MD_MD5, test, sizeof(test), digest, &size) ==
-                   ISC_R_SUCCESS)
-               {
-                       return (0);
-               } else {
-                       return (1);
-               }
+               isc_mem_create(&mctx);
+               dst_lib_init(mctx, NULL);
+               answer = dst_algorithm_supported(DST_ALG_HMACMD5) ? 0 : 1;
+               dst_lib_destroy();
+               isc_mem_detach(&mctx);
+               return (answer);
        }
 
        if (strcmp(argv[1], "--ipv6only=no") == 0) {