#include "curl_setup.h"
-#if defined(USE_GNUTLS_NETTLE) || defined(USE_NSS) || \
- defined(USE_OS400CRYPTO) || \
- (defined(USE_OPENSSL) && defined(OPENSSL_NO_MD4)) || \
+#if defined(USE_GNUTLS_NETTLE) || defined(USE_GNUTLS) || \
+ defined(USE_OPENSSL) || defined(USE_NSS) || defined(USE_OS400CRYPTO) || \
(defined(USE_MBEDTLS) && !defined(MBEDTLS_MD4_C))
#define MD4_DIGEST_LENGTH 16
void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len);
#endif /* defined(USE_GNUTLS_NETTLE) || defined(USE_GNUTLS) ||
- defined(USE_NSS) || defined(USE_OS400CRYPTO) ||
- (defined(USE_OPENSSL) && defined(OPENSSL_NO_MD4)) ||
+ defined(USE_OPENSSL) || defined(USE_NSS) || defined(USE_OS400CRYPTO) ||
(defined(USE_MBEDTLS) && !defined(MBEDTLS_MD4_C)) */
#endif /* HEADER_CURL_MD4_H */
#ifdef USE_OPENSSL
# include <openssl/des.h>
-# ifndef OPENSSL_NO_MD4
-# include <openssl/md4.h>
-# else
-# include "curl_md4.h"
-# endif
# include <openssl/md5.h>
# include <openssl/ssl.h>
# include <openssl/rand.h>
# define DESKEYARG(x) *x
# define DESKEY(x) &x
# endif
+# include "curl_md4.h"
#elif defined(USE_GNUTLS_NETTLE)
{
/* Create NT hashed password. */
#ifdef USE_OPENSSL
-#if !defined(OPENSSL_NO_MD4)
- MD4_CTX MD4pw;
- MD4_Init(&MD4pw);
- MD4_Update(&MD4pw, pw, 2 * len);
- MD4_Final(ntbuffer, &MD4pw);
-#else
Curl_md4it(ntbuffer, pw, 2 * len);
-#endif
#elif defined(USE_GNUTLS_NETTLE)
Curl_md4it(ntbuffer, pw, 2 * len);
#elif defined(USE_GNUTLS)
gcry_md_close(ctx);
}
+#elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
+/* When OpenSSL is available we use the MD4-functions from OpenSSL */
+#include <openssl/md4.h>
+
+#include "curl_md4.h"
+#include "warnless.h"
+
#elif defined(USE_NSS) || defined(USE_OS400CRYPTO) || \
(defined(USE_OPENSSL) && defined(OPENSSL_NO_MD4)) || \
(defined(USE_MBEDTLS) && !defined(MBEDTLS_MD4_C))
#include "curl_md4.h"
#include "warnless.h"
-#ifndef HAVE_OPENSSL
-
#include <string.h>
/* Any 32-bit or wider unsigned integer data type will do */
memset(ctx, 0, sizeof(*ctx));
}
-#endif
-
#endif /* CRYPTO LIBS */
#if defined(USE_GNUTLS_NETTLE) || defined(USE_GNUTLS) || \
- defined(USE_NSS) || defined(USE_OS400CRYPTO) || \
- (defined(USE_OPENSSL) && defined(OPENSSL_NO_MD4)) || \
+ defined(USE_OPENSSL) || defined(USE_NSS) || defined(USE_OS400CRYPTO) || \
(defined(USE_OPENSSL) && defined(OPENSSL_NO_MD4)) || \
(defined(USE_MBEDTLS) && !defined(MBEDTLS_MD4_C))
}
#endif /* defined(USE_GNUTLS_NETTLE) || defined(USE_GNUTLS) ||
- defined(USE_NSS) || defined(USE_OS400CRYPTO) ||
- defined(USE_OS400CRYPTO) ||
- (defined(USE_OPENSSL) && defined(OPENSSL_NO_MD4)) ||
+ defined(USE_OPENSSL) || defined(USE_NSS) || defined(USE_OS400CRYPTO) || \
(defined(USE_MBEDTLS) && !defined(MBEDTLS_MD4_C)) */