mirror of
https://github.com/moparisthebest/curl
synced 2025-01-10 21:48:10 -05:00
md4: Use the Curl_md4it() function for OpenSSL based NTLM
This commit is contained in:
parent
c89365929b
commit
24c298fb4d
@ -24,9 +24,8 @@
|
||||
|
||||
#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
|
||||
@ -34,8 +33,7 @@
|
||||
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 */
|
||||
|
@ -55,11 +55,6 @@
|
||||
#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>
|
||||
@ -75,6 +70,7 @@
|
||||
# define DESKEYARG(x) *x
|
||||
# define DESKEY(x) &x
|
||||
# endif
|
||||
# include "curl_md4.h"
|
||||
|
||||
#elif defined(USE_GNUTLS_NETTLE)
|
||||
|
||||
@ -569,14 +565,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
|
||||
{
|
||||
/* 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)
|
||||
|
18
lib/md4.c
18
lib/md4.c
@ -85,6 +85,13 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
|
||||
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))
|
||||
@ -131,8 +138,6 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
|
||||
#include "curl_md4.h"
|
||||
#include "warnless.h"
|
||||
|
||||
#ifndef HAVE_OPENSSL
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Any 32-bit or wider unsigned integer data type will do */
|
||||
@ -381,13 +386,10 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
|
||||
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))
|
||||
|
||||
@ -400,7 +402,5 @@ 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_OS400CRYPTO) ||
|
||||
(defined(USE_OPENSSL) && defined(OPENSSL_NO_MD4)) ||
|
||||
defined(USE_OPENSSL) || defined(USE_NSS) || defined(USE_OS400CRYPTO) || \
|
||||
(defined(USE_MBEDTLS) && !defined(MBEDTLS_MD4_C)) */
|
||||
|
Loading…
Reference in New Issue
Block a user