]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
md4: fix compilation with OpenSSL 1.x with md4 disabled
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>
Thu, 18 Jul 2024 04:41:51 +0000 (07:41 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 19 Jul 2024 16:27:30 +0000 (18:27 +0200)
If OpenSSL 1.x is used, and it is configured with md4 disabled,
OPENSSL_NO_MD4 is defined in opensslconf.h, but this header was not
included before checking for this define.

Later in md4.c, openssl/md4.h is included, and it includes that header
indirectly, leading to inconsistency within md4.c.

Since the md4.h branch was taken, wincrypt.h (or others) is not
included, and later below the USE_WIN32_CRYPTO branch is taken, but the
types are not defined.

Closes #14218

lib/md4.c

index 489b9e199ace482d10f8ca23331235c80e01b591..f006bdcf052370a5c3e4d42b06b520f8d6fe3669 100644 (file)
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -37,6 +37,9 @@
 #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) && !defined(USE_AMISSL)
 /* OpenSSL 3.0.0 marks the MD4 functions as deprecated */
 #define OPENSSL_NO_MD4
+#else
+/* Cover also OPENSSL_NO_MD4 configured in openssl */
+#include <openssl/opensslconf.h>
 #endif
 #endif /* USE_OPENSSL */