[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 57/220: md4: Use our own MD4 implementation when no
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 57/220: md4: Use our own MD4 implementation when no crypto libraries are available |
Date: |
Thu, 12 Sep 2019 17:26:57 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 850a295b41543a11c5a0b5f4943e9b4fbc20da59
Author: Steve Holme <address@hidden>
AuthorDate: Sun Apr 14 19:24:28 2019 +0100
md4: Use our own MD4 implementation when no crypto libraries are available
Closes #3780
---
lib/curl_md4.h | 10 ++--------
lib/curl_ntlm_core.c | 5 -----
lib/md4.c | 39 +++++++++------------------------------
3 files changed, 11 insertions(+), 43 deletions(-)
diff --git a/lib/curl_md4.h b/lib/curl_md4.h
index 60087803d..82df708ce 100644
--- a/lib/curl_md4.h
+++ b/lib/curl_md4.h
@@ -24,18 +24,12 @@
#include "curl_setup.h"
-#if defined(USE_GNUTLS_NETTLE) || defined(USE_GNUTLS) || \
- defined(USE_OPENSSL) || defined(USE_SECTRANSP) || \
- defined(USE_WIN32_CRYPTO) || defined(USE_NSS) || \
- defined(USE_OS400CRYPTO) || defined(USE_MBEDTLS)
+#if !defined(CURL_DISABLE_CRYPTO_AUTH)
#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_OPENSSL) || defined(USE_SECTRANSP) ||
- defined(USE_WIN32_CRYPTO) || defined(USE_NSS) ||
- defined(USE_OS400CRYPTO) || defined(USE_MBEDTLS) */
+#endif /* !defined(CURL_DISABLE_CRYPTO_AUTH) */
#endif /* HEADER_CURL_MD4_H */
diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c
index b2a6afc0c..19f9b61d8 100644
--- a/lib/curl_ntlm_core.c
+++ b/lib/curl_ntlm_core.c
@@ -556,12 +556,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
return result;
/* Create NT hashed password. */
-#if defined(USE_OPENSSL) || defined(USE_GNUTLS_NETTLE) || \
- defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_MBEDTLS) || \
- defined(USE_SECTRANSP) || defined(USE_OS400CRYPTO) || \
- defined(USE_WIN32_CRYPTO)
Curl_md4it(ntbuffer, pw, 2 * len);
-#endif
memset(ntbuffer + 16, 0, 21 - 16);
diff --git a/lib/md4.c b/lib/md4.c
index 0729c3954..bbf897508 100644
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -22,6 +22,11 @@
#include "curl_setup.h"
+#if !defined(CURL_DISABLE_CRYPTO_AUTH)
+
+#include "curl_md4.h"
+#include "warnless.h"
+
#ifdef USE_OPENSSL
#include <openssl/opensslconf.h>
#endif
@@ -33,8 +38,6 @@
#include <nettle/md4.h>
-#include "curl_md4.h"
-#include "warnless.h"
#include "curl_memory.h"
/* The last #include file should be: */
@@ -61,8 +64,6 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
#include <gcrypt.h>
-#include "curl_md4.h"
-#include "warnless.h"
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
@@ -89,15 +90,10 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
/* 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_SECTRANSP)
#include <CommonCrypto/CommonDigest.h>
-#include "curl_md4.h"
-#include "warnless.h"
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
@@ -138,8 +134,6 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
#include <wincrypt.h>
-#include "curl_md4.h"
-#include "warnless.h"
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
@@ -184,8 +178,6 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
#include <mbedtls/md4.h>
-#include "curl_md4.h"
-#include "warnless.h"
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
@@ -222,12 +214,9 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
}
}
-#elif defined(USE_NSS) || defined(USE_OS400CRYPTO) || \
- (defined(USE_OPENSSL) && defined(OPENSSL_NO_MD4)) || \
- (defined(USE_MBEDTLS) && !defined(MBEDTLS_MD4_C))
-/* The NSS, OS/400, and when not included, OpenSSL and mbed TLS crypto
- * libraries do not provide the MD4 hash algorithm, so we use this
- * implementation of it
+#else
+/* When no other crypto library is available, or the crypto library doesn't
+ * support MD4, we use this code segment this implementation of it
*
* This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
* MD4 Message-Digest Algorithm (RFC 1320).
@@ -265,8 +254,6 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
* compile-time configuration.
*/
-#include "curl_md4.h"
-#include "warnless.h"
#include <string.h>
@@ -518,11 +505,6 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
#endif /* CRYPTO LIBS */
-#if defined(USE_GNUTLS_NETTLE) || defined(USE_GNUTLS) || \
- defined(USE_OPENSSL) || defined(USE_SECTRANSP) || \
- defined(USE_WIN32_CRYPTO) || defined(USE_NSS) || \
- defined(USE_OS400CRYPTO) || defined(USE_MBEDTLS)
-
void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len)
{
MD4_CTX ctx;
@@ -531,7 +513,4 @@ void Curl_md4it(unsigned char *output, const unsigned char
*input, size_t len)
MD4_Final(output, &ctx);
}
-#endif /* defined(USE_GNUTLS_NETTLE) || defined(USE_GNUTLS) ||
- defined(USE_OPENSSL) || defined(USE_SECTRANSP) ||
- defined(USE_WIN32_CRYPTO) || defined(USE_NSS) ||
- defined(USE_OS400CRYPTO) || defined(USE_MBEDTLS) */
+#endif /* CURL_DISABLE_CRYPTO_AUTH */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 42/220: quiche: add failf() calls for two error cases, (continued)
- [GNUnet-SVN] [gnurl] 42/220: quiche: add failf() calls for two error cases, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 34/220: ROADMAP: parallel transfers are merged now, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 35/220: timediff: make it 64 bit (if possible) even with 32 bit time_t, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 50/220: md4: Move the GNU TLS gcrypt MD4 implementation out of the NTLM code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 47/220: url: make use of new HTTP version if alt-svc has one, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 48/220: OS400: Add CURLOPT_H3 symbols, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 55/220: md4: No need for the NTLM code to call Curl_md4it() for each TLS library, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 60/220: lib/Makefile.am: make checksrc run in vquic too, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 64/220: quiche: show the actual version number, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 49/220: md4: Move the GNU TLS Nettle MD4 implementation out of the NTLM code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 57/220: md4: Use our own MD4 implementation when no crypto libraries are available,
gnunet <=
- [GNUnet-SVN] [gnurl] 62/220: http09: disable HTTP/0.9 by default in both tool and library, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 68/220: mesalink: implement client authentication, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 80/220: curl.h: add CURL_HTTP_VERSION_3 to the version enum, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 79/220: quiche: make use of the connection timeout API properly, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 52/220: md4: Move the SecureTransport implementation out of the NTLM code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 65/220: altsvc: make quiche use h3-22 now, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 66/220: quiche:h3_stream_recv return 0 at end of stream, gnunet, 2019/09/12
- [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