summaryrefslogtreecommitdiffstats
path: root/lib/md4.c
diff options
context:
space:
mode:
authorCurl Upstream <curl-library@cool.haxx.se>2017-06-14 06:08:56 (GMT)
committerBrad King <brad.king@kitware.com>2017-06-14 14:46:35 (GMT)
commit06d6d6c4aee149cd6560b919ef6935ef0867d921 (patch)
treed62adabf2b4b10030abf4a759b520e5edb6dd517 /lib/md4.c
parentfd7d521c9d70655618db8232d45e5aaf81700f91 (diff)
downloadCMake-06d6d6c4aee149cd6560b919ef6935ef0867d921.zip
CMake-06d6d6c4aee149cd6560b919ef6935ef0867d921.tar.gz
CMake-06d6d6c4aee149cd6560b919ef6935ef0867d921.tar.bz2
curl 2017-06-14 (54b636f1)
Code extracted from: https://github.com/curl/curl.git at commit 54b636f14546d3fde9f9c67c3b32701d78563161 (curl-7_54_1).
Diffstat (limited to 'lib/md4.c')
-rw-r--r--lib/md4.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/md4.c b/lib/md4.c
index 1bdc9f3..2bb7dcc 100644
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -37,9 +37,10 @@
#include "curl_setup.h"
-/* NSS and OS/400 crypto library do not provide the MD4 hash algorithm, so
- * that we have a local implementation of it */
-#if defined(USE_NSS) || defined(USE_OS400CRYPTO)
+/* The NSS, OS/400 and sometimes mbed TLS crypto libraries do not provide the
+ * MD4 hash algorithm, so we have a local implementation of it */
+#if defined(USE_NSS) || defined(USE_OS400CRYPTO) || \
+ (defined(USE_MBEDTLS) && !defined(MBEDTLS_MD4_C))
#include "curl_md4.h"
#include "warnless.h"
@@ -89,7 +90,7 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx);
*/
#if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
#define SET(n) \
- (*(MD4_u32plus *)&ptr[(n) * 4])
+ (*(MD4_u32plus *)(void *)&ptr[(n) * 4])
#define GET(n) \
SET(n)
#else
@@ -302,4 +303,5 @@ void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len)
MD4_Update(&ctx, input, curlx_uztoui(len));
MD4_Final(output, &ctx);
}
-#endif /* defined(USE_NSS) || defined(USE_OS400CRYPTO) */
+#endif /* defined(USE_NSS) || defined(USE_OS400CRYPTO) ||
+ (defined(USE_MBEDTLS) && !defined(MBEDTLS_MD4_C)) */