[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 51/220: md4: Use the Curl_md4it() function for Open
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 51/220: md4: Use the Curl_md4it() function for OpenSSL based NTLM |
Date: |
Thu, 12 Sep 2019 17:26:51 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 24c298fb4db4c97d477f806a269f2ee524ceb814
Author: Steve Holme <address@hidden>
AuthorDate: Sun Apr 14 02:25:50 2019 +0100
md4: Use the Curl_md4it() function for OpenSSL based NTLM
---
lib/curl_md4.h | 8 +++-----
lib/curl_ntlm_core.c | 13 +------------
lib/md4.c | 18 +++++++++---------
3 files changed, 13 insertions(+), 26 deletions(-)
diff --git a/lib/curl_md4.h b/lib/curl_md4.h
index f41e3921d..979a82b62 100644
--- a/lib/curl_md4.h
+++ b/lib/curl_md4.h
@@ -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 */
diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c
index d1b508cb7..9ad0de8f7 100644
--- a/lib/curl_ntlm_core.c
+++ b/lib/curl_ntlm_core.c
@@ -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)
diff --git a/lib/md4.c b/lib/md4.c
index 6bc2c6f65..1b1e31540 100644
--- a/lib/md4.c
+++ b/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)) */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 61/220: quiche: initial h3 request send/receive, (continued)
- [GNUnet-SVN] [gnurl] 61/220: quiche: initial h3 request send/receive, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 63/220: quiche: first working HTTP/3 request, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 76/220: quiche: flush egress in h3_stream_recv() too, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 82/220: docs/ALTSVC.md: first basic file format description, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 75/220: RELEASE-NOTES: synced, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 83/220: CURLINFO_RETRY_AFTER: parse the Retry-After header value, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 32/220: plan9: add support for running on Plan 9, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 74/220: os400: take care of CURLOPT_SASL_AUTHZID in curl_easy_setopt_ccsid()., gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 87/220: docs/ALTSVC: remove what works and the experimental explanation, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 102/220: configure: avoid undefined check_for_ca_bundle, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 51/220: md4: Use the Curl_md4it() function for OpenSSL based NTLM,
gnunet <=
- [GNUnet-SVN] [gnurl] 56/220: md4: No need to include Curl_md4.h for each TLS library, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 53/220: md4: Move the WinCrypt implementation out of the NTLM code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 54/220: md4: Move the mbed TLS MD4 implementation out of the NTLM code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 59/220: altsvc: fix removal of expired cache entry, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 58/220: RELEASE-NOTES: synced, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 69/220: docs/HTTP3: refreshed as it is now in master and HTTP/3 can be tested, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 78/220: quiche: make POSTFIELDS posts work, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 77/220: quiche: improved error handling and memory cleanups, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 67/220: curl_multi_poll: a sister to curl_multi_wait() that waits more, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 70/220: sasl: Implement SASL authorisation identity via CURLOPT_SASL_AUTHZID, gnunet, 2019/09/12