md4: fix compilation with OpenSSL 1.x with md4 disabled

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
This commit is contained in:
Orgad Shaneh 2024-07-18 07:41:51 +03:00 committed by Daniel Stenberg
parent 8e13837e0e
commit 1f877b0fba
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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 */