2
0

md4.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. /***************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. *
  10. * This software is licensed as described in the file COPYING, which
  11. * you should have received as part of this distribution. The terms
  12. * are also available at https://curl.se/docs/copyright.html.
  13. *
  14. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. * copies of the Software, and permit persons to whom the Software is
  16. * furnished to do so, under the terms of the COPYING file.
  17. *
  18. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. * KIND, either express or implied.
  20. *
  21. * SPDX-License-Identifier: curl
  22. *
  23. ***************************************************************************/
  24. #include "curl_setup.h"
  25. #if defined(USE_CURL_NTLM_CORE)
  26. #include <string.h>
  27. #include "strdup.h"
  28. #include "curl_md4.h"
  29. #include "warnless.h"
  30. #ifdef USE_OPENSSL
  31. #include <openssl/opensslv.h>
  32. #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) && !defined(USE_AMISSL)
  33. /* OpenSSL 3.0.0 marks the MD4 functions as deprecated */
  34. #define OPENSSL_NO_MD4
  35. #else
  36. /* Cover also OPENSSL_NO_MD4 configured in openssl */
  37. #include <openssl/opensslconf.h>
  38. #endif
  39. #endif /* USE_OPENSSL */
  40. #ifdef USE_WOLFSSL
  41. #include <wolfssl/options.h>
  42. #define VOID_MD4_INIT
  43. #ifdef NO_MD4
  44. #define WOLFSSL_NO_MD4
  45. #endif
  46. #endif
  47. #ifdef USE_MBEDTLS
  48. #include <mbedtls/version.h>
  49. #if MBEDTLS_VERSION_NUMBER >= 0x03000000
  50. #include <mbedtls/mbedtls_config.h>
  51. #else
  52. #include <mbedtls/config.h>
  53. #endif
  54. #if(MBEDTLS_VERSION_NUMBER >= 0x02070000) && \
  55. (MBEDTLS_VERSION_NUMBER < 0x03000000)
  56. #define HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS
  57. #endif
  58. #endif /* USE_MBEDTLS */
  59. #if defined(USE_GNUTLS)
  60. #include <nettle/md4.h>
  61. /* When OpenSSL or wolfSSL is available, we use their MD4 functions. */
  62. #elif defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
  63. #include <wolfssl/openssl/md4.h>
  64. #elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
  65. #include <openssl/md4.h>
  66. #elif (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \
  67. (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1040) && \
  68. defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
  69. (__MAC_OS_X_VERSION_MIN_REQUIRED < 101500)) || \
  70. (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \
  71. (__IPHONE_OS_VERSION_MAX_ALLOWED >= 20000) && \
  72. defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && \
  73. (__IPHONE_OS_VERSION_MIN_REQUIRED < 130000))
  74. #define AN_APPLE_OS
  75. #include <CommonCrypto/CommonDigest.h>
  76. #elif defined(USE_WIN32_CRYPTO)
  77. #include <wincrypt.h>
  78. #elif(defined(USE_MBEDTLS) && defined(MBEDTLS_MD4_C))
  79. #include <mbedtls/md4.h>
  80. #endif
  81. /* The last 3 #include files should be in this order */
  82. #include "curl_printf.h"
  83. #include "curl_memory.h"
  84. #include "memdebug.h"
  85. #if defined(USE_GNUTLS)
  86. typedef struct md4_ctx MD4_CTX;
  87. static int MD4_Init(MD4_CTX *ctx)
  88. {
  89. md4_init(ctx);
  90. return 1;
  91. }
  92. static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
  93. {
  94. md4_update(ctx, size, data);
  95. }
  96. static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
  97. {
  98. md4_digest(ctx, MD4_DIGEST_SIZE, result);
  99. }
  100. #elif defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
  101. #elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
  102. #elif defined(AN_APPLE_OS)
  103. typedef CC_MD4_CTX MD4_CTX;
  104. static int MD4_Init(MD4_CTX *ctx)
  105. {
  106. return CC_MD4_Init(ctx);
  107. }
  108. static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
  109. {
  110. (void)CC_MD4_Update(ctx, data, (CC_LONG)size);
  111. }
  112. static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
  113. {
  114. (void)CC_MD4_Final(result, ctx);
  115. }
  116. #elif defined(USE_WIN32_CRYPTO)
  117. struct md4_ctx {
  118. HCRYPTPROV hCryptProv;
  119. HCRYPTHASH hHash;
  120. };
  121. typedef struct md4_ctx MD4_CTX;
  122. static int MD4_Init(MD4_CTX *ctx)
  123. {
  124. ctx->hCryptProv = 0;
  125. ctx->hHash = 0;
  126. if(!CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL,
  127. CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
  128. return 0;
  129. if(!CryptCreateHash(ctx->hCryptProv, CALG_MD4, 0, 0, &ctx->hHash)) {
  130. CryptReleaseContext(ctx->hCryptProv, 0);
  131. ctx->hCryptProv = 0;
  132. return 0;
  133. }
  134. return 1;
  135. }
  136. static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
  137. {
  138. CryptHashData(ctx->hHash, (BYTE *)data, (unsigned int) size, 0);
  139. }
  140. static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
  141. {
  142. unsigned long length = 0;
  143. CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0);
  144. if(length == MD4_DIGEST_LENGTH)
  145. CryptGetHashParam(ctx->hHash, HP_HASHVAL, result, &length, 0);
  146. if(ctx->hHash)
  147. CryptDestroyHash(ctx->hHash);
  148. if(ctx->hCryptProv)
  149. CryptReleaseContext(ctx->hCryptProv, 0);
  150. }
  151. #elif(defined(USE_MBEDTLS) && defined(MBEDTLS_MD4_C))
  152. struct md4_ctx {
  153. void *data;
  154. unsigned long size;
  155. };
  156. typedef struct md4_ctx MD4_CTX;
  157. static int MD4_Init(MD4_CTX *ctx)
  158. {
  159. ctx->data = NULL;
  160. ctx->size = 0;
  161. return 1;
  162. }
  163. static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
  164. {
  165. if(!ctx->data) {
  166. ctx->data = Curl_memdup(data, size);
  167. if(ctx->data)
  168. ctx->size = size;
  169. }
  170. }
  171. static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
  172. {
  173. if(ctx->data) {
  174. #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS)
  175. mbedtls_md4(ctx->data, ctx->size, result);
  176. #else
  177. (void) mbedtls_md4_ret(ctx->data, ctx->size, result);
  178. #endif
  179. Curl_safefree(ctx->data);
  180. ctx->size = 0;
  181. }
  182. }
  183. #else
  184. /* When no other crypto library is available, or the crypto library does not
  185. * support MD4, we use this code segment this implementation of it
  186. *
  187. * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
  188. * MD4 Message-Digest Algorithm (RFC 1320).
  189. *
  190. * Homepage:
  191. https://openwall.info/wiki/people/solar/software/public-domain-source-code/md4
  192. *
  193. * Author:
  194. * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>
  195. *
  196. * This software was written by Alexander Peslyak in 2001. No copyright is
  197. * claimed, and the software is hereby placed in the public domain. In case
  198. * this attempt to disclaim copyright and place the software in the public
  199. * domain is deemed null and void, then the software is Copyright (c) 2001
  200. * Alexander Peslyak and it is hereby released to the general public under the
  201. * following terms:
  202. *
  203. * Redistribution and use in source and binary forms, with or without
  204. * modification, are permitted.
  205. *
  206. * There is ABSOLUTELY NO WARRANTY, express or implied.
  207. *
  208. * (This is a heavily cut-down "BSD license".)
  209. *
  210. * This differs from Colin Plumb's older public domain implementation in that
  211. * no exactly 32-bit integer data type is required (any 32-bit or wider
  212. * unsigned integer data type will do), there is no compile-time endianness
  213. * configuration, and the function prototypes match OpenSSL's. No code from
  214. * Colin Plumb's implementation has been reused; this comment merely compares
  215. * the properties of the two independent implementations.
  216. *
  217. * The primary goals of this implementation are portability and ease of use.
  218. * It is meant to be fast, but not as fast as possible. Some known
  219. * optimizations are not included to reduce source code size and avoid
  220. * compile-time configuration.
  221. */
  222. /* Any 32-bit or wider unsigned integer data type will do */
  223. typedef unsigned int MD4_u32plus;
  224. struct md4_ctx {
  225. MD4_u32plus lo, hi;
  226. MD4_u32plus a, b, c, d;
  227. unsigned char buffer[64];
  228. MD4_u32plus block[16];
  229. };
  230. typedef struct md4_ctx MD4_CTX;
  231. static int MD4_Init(MD4_CTX *ctx);
  232. static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size);
  233. static void MD4_Final(unsigned char *result, MD4_CTX *ctx);
  234. /*
  235. * The basic MD4 functions.
  236. *
  237. * F and G are optimized compared to their RFC 1320 definitions, with the
  238. * optimization for F borrowed from Colin Plumb's MD5 implementation.
  239. */
  240. #define MD4_F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
  241. #define MD4_G(x, y, z) (((x) & ((y) | (z))) | ((y) & (z)))
  242. #define MD4_H(x, y, z) ((x) ^ (y) ^ (z))
  243. /*
  244. * The MD4 transformation for all three rounds.
  245. */
  246. #define MD4_STEP(f, a, b, c, d, x, s) \
  247. (a) += f((b), (c), (d)) + (x); \
  248. (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s))));
  249. /*
  250. * SET reads 4 input bytes in little-endian byte order and stores them
  251. * in a properly aligned word in host byte order.
  252. *
  253. * The check for little-endian architectures that tolerate unaligned
  254. * memory accesses is just an optimization. Nothing will break if it
  255. * does not work.
  256. */
  257. #if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
  258. #define MD4_SET(n) \
  259. (*(MD4_u32plus *)(void *)&ptr[(n) * 4])
  260. #define MD4_GET(n) \
  261. MD4_SET(n)
  262. #else
  263. #define MD4_SET(n) \
  264. (ctx->block[(n)] = \
  265. (MD4_u32plus)ptr[(n) * 4] | \
  266. ((MD4_u32plus)ptr[(n) * 4 + 1] << 8) | \
  267. ((MD4_u32plus)ptr[(n) * 4 + 2] << 16) | \
  268. ((MD4_u32plus)ptr[(n) * 4 + 3] << 24))
  269. #define MD4_GET(n) \
  270. (ctx->block[(n)])
  271. #endif
  272. /*
  273. * This processes one or more 64-byte data blocks, but does NOT update
  274. * the bit counters. There are no alignment requirements.
  275. */
  276. static const void *my_md4_body(MD4_CTX *ctx,
  277. const void *data, unsigned long size)
  278. {
  279. const unsigned char *ptr;
  280. MD4_u32plus a, b, c, d;
  281. ptr = (const unsigned char *)data;
  282. a = ctx->a;
  283. b = ctx->b;
  284. c = ctx->c;
  285. d = ctx->d;
  286. do {
  287. MD4_u32plus saved_a, saved_b, saved_c, saved_d;
  288. saved_a = a;
  289. saved_b = b;
  290. saved_c = c;
  291. saved_d = d;
  292. /* Round 1 */
  293. MD4_STEP(MD4_F, a, b, c, d, MD4_SET(0), 3)
  294. MD4_STEP(MD4_F, d, a, b, c, MD4_SET(1), 7)
  295. MD4_STEP(MD4_F, c, d, a, b, MD4_SET(2), 11)
  296. MD4_STEP(MD4_F, b, c, d, a, MD4_SET(3), 19)
  297. MD4_STEP(MD4_F, a, b, c, d, MD4_SET(4), 3)
  298. MD4_STEP(MD4_F, d, a, b, c, MD4_SET(5), 7)
  299. MD4_STEP(MD4_F, c, d, a, b, MD4_SET(6), 11)
  300. MD4_STEP(MD4_F, b, c, d, a, MD4_SET(7), 19)
  301. MD4_STEP(MD4_F, a, b, c, d, MD4_SET(8), 3)
  302. MD4_STEP(MD4_F, d, a, b, c, MD4_SET(9), 7)
  303. MD4_STEP(MD4_F, c, d, a, b, MD4_SET(10), 11)
  304. MD4_STEP(MD4_F, b, c, d, a, MD4_SET(11), 19)
  305. MD4_STEP(MD4_F, a, b, c, d, MD4_SET(12), 3)
  306. MD4_STEP(MD4_F, d, a, b, c, MD4_SET(13), 7)
  307. MD4_STEP(MD4_F, c, d, a, b, MD4_SET(14), 11)
  308. MD4_STEP(MD4_F, b, c, d, a, MD4_SET(15), 19)
  309. /* Round 2 */
  310. MD4_STEP(MD4_G, a, b, c, d, MD4_GET(0) + 0x5a827999, 3)
  311. MD4_STEP(MD4_G, d, a, b, c, MD4_GET(4) + 0x5a827999, 5)
  312. MD4_STEP(MD4_G, c, d, a, b, MD4_GET(8) + 0x5a827999, 9)
  313. MD4_STEP(MD4_G, b, c, d, a, MD4_GET(12) + 0x5a827999, 13)
  314. MD4_STEP(MD4_G, a, b, c, d, MD4_GET(1) + 0x5a827999, 3)
  315. MD4_STEP(MD4_G, d, a, b, c, MD4_GET(5) + 0x5a827999, 5)
  316. MD4_STEP(MD4_G, c, d, a, b, MD4_GET(9) + 0x5a827999, 9)
  317. MD4_STEP(MD4_G, b, c, d, a, MD4_GET(13) + 0x5a827999, 13)
  318. MD4_STEP(MD4_G, a, b, c, d, MD4_GET(2) + 0x5a827999, 3)
  319. MD4_STEP(MD4_G, d, a, b, c, MD4_GET(6) + 0x5a827999, 5)
  320. MD4_STEP(MD4_G, c, d, a, b, MD4_GET(10) + 0x5a827999, 9)
  321. MD4_STEP(MD4_G, b, c, d, a, MD4_GET(14) + 0x5a827999, 13)
  322. MD4_STEP(MD4_G, a, b, c, d, MD4_GET(3) + 0x5a827999, 3)
  323. MD4_STEP(MD4_G, d, a, b, c, MD4_GET(7) + 0x5a827999, 5)
  324. MD4_STEP(MD4_G, c, d, a, b, MD4_GET(11) + 0x5a827999, 9)
  325. MD4_STEP(MD4_G, b, c, d, a, MD4_GET(15) + 0x5a827999, 13)
  326. /* Round 3 */
  327. MD4_STEP(MD4_H, a, b, c, d, MD4_GET(0) + 0x6ed9eba1, 3)
  328. MD4_STEP(MD4_H, d, a, b, c, MD4_GET(8) + 0x6ed9eba1, 9)
  329. MD4_STEP(MD4_H, c, d, a, b, MD4_GET(4) + 0x6ed9eba1, 11)
  330. MD4_STEP(MD4_H, b, c, d, a, MD4_GET(12) + 0x6ed9eba1, 15)
  331. MD4_STEP(MD4_H, a, b, c, d, MD4_GET(2) + 0x6ed9eba1, 3)
  332. MD4_STEP(MD4_H, d, a, b, c, MD4_GET(10) + 0x6ed9eba1, 9)
  333. MD4_STEP(MD4_H, c, d, a, b, MD4_GET(6) + 0x6ed9eba1, 11)
  334. MD4_STEP(MD4_H, b, c, d, a, MD4_GET(14) + 0x6ed9eba1, 15)
  335. MD4_STEP(MD4_H, a, b, c, d, MD4_GET(1) + 0x6ed9eba1, 3)
  336. MD4_STEP(MD4_H, d, a, b, c, MD4_GET(9) + 0x6ed9eba1, 9)
  337. MD4_STEP(MD4_H, c, d, a, b, MD4_GET(5) + 0x6ed9eba1, 11)
  338. MD4_STEP(MD4_H, b, c, d, a, MD4_GET(13) + 0x6ed9eba1, 15)
  339. MD4_STEP(MD4_H, a, b, c, d, MD4_GET(3) + 0x6ed9eba1, 3)
  340. MD4_STEP(MD4_H, d, a, b, c, MD4_GET(11) + 0x6ed9eba1, 9)
  341. MD4_STEP(MD4_H, c, d, a, b, MD4_GET(7) + 0x6ed9eba1, 11)
  342. MD4_STEP(MD4_H, b, c, d, a, MD4_GET(15) + 0x6ed9eba1, 15)
  343. a += saved_a;
  344. b += saved_b;
  345. c += saved_c;
  346. d += saved_d;
  347. ptr += 64;
  348. } while(size -= 64);
  349. ctx->a = a;
  350. ctx->b = b;
  351. ctx->c = c;
  352. ctx->d = d;
  353. return ptr;
  354. }
  355. static int MD4_Init(MD4_CTX *ctx)
  356. {
  357. ctx->a = 0x67452301;
  358. ctx->b = 0xefcdab89;
  359. ctx->c = 0x98badcfe;
  360. ctx->d = 0x10325476;
  361. ctx->lo = 0;
  362. ctx->hi = 0;
  363. return 1;
  364. }
  365. static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
  366. {
  367. MD4_u32plus saved_lo;
  368. unsigned long used;
  369. saved_lo = ctx->lo;
  370. ctx->lo = (saved_lo + size) & 0x1fffffff;
  371. if(ctx->lo < saved_lo)
  372. ctx->hi++;
  373. ctx->hi += (MD4_u32plus)size >> 29;
  374. used = saved_lo & 0x3f;
  375. if(used) {
  376. unsigned long available = 64 - used;
  377. if(size < available) {
  378. memcpy(&ctx->buffer[used], data, size);
  379. return;
  380. }
  381. memcpy(&ctx->buffer[used], data, available);
  382. data = (const unsigned char *)data + available;
  383. size -= available;
  384. my_md4_body(ctx, ctx->buffer, 64);
  385. }
  386. if(size >= 64) {
  387. data = my_md4_body(ctx, data, size & ~(unsigned long)0x3f);
  388. size &= 0x3f;
  389. }
  390. memcpy(ctx->buffer, data, size);
  391. }
  392. static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
  393. {
  394. unsigned long used, available;
  395. used = ctx->lo & 0x3f;
  396. ctx->buffer[used++] = 0x80;
  397. available = 64 - used;
  398. if(available < 8) {
  399. memset(&ctx->buffer[used], 0, available);
  400. my_md4_body(ctx, ctx->buffer, 64);
  401. used = 0;
  402. available = 64;
  403. }
  404. memset(&ctx->buffer[used], 0, available - 8);
  405. ctx->lo <<= 3;
  406. ctx->buffer[56] = curlx_ultouc((ctx->lo)&0xff);
  407. ctx->buffer[57] = curlx_ultouc((ctx->lo >> 8)&0xff);
  408. ctx->buffer[58] = curlx_ultouc((ctx->lo >> 16)&0xff);
  409. ctx->buffer[59] = curlx_ultouc((ctx->lo >> 24)&0xff);
  410. ctx->buffer[60] = curlx_ultouc((ctx->hi)&0xff);
  411. ctx->buffer[61] = curlx_ultouc((ctx->hi >> 8)&0xff);
  412. ctx->buffer[62] = curlx_ultouc((ctx->hi >> 16)&0xff);
  413. ctx->buffer[63] = curlx_ultouc(ctx->hi >> 24);
  414. my_md4_body(ctx, ctx->buffer, 64);
  415. result[0] = curlx_ultouc((ctx->a)&0xff);
  416. result[1] = curlx_ultouc((ctx->a >> 8)&0xff);
  417. result[2] = curlx_ultouc((ctx->a >> 16)&0xff);
  418. result[3] = curlx_ultouc(ctx->a >> 24);
  419. result[4] = curlx_ultouc((ctx->b)&0xff);
  420. result[5] = curlx_ultouc((ctx->b >> 8)&0xff);
  421. result[6] = curlx_ultouc((ctx->b >> 16)&0xff);
  422. result[7] = curlx_ultouc(ctx->b >> 24);
  423. result[8] = curlx_ultouc((ctx->c)&0xff);
  424. result[9] = curlx_ultouc((ctx->c >> 8)&0xff);
  425. result[10] = curlx_ultouc((ctx->c >> 16)&0xff);
  426. result[11] = curlx_ultouc(ctx->c >> 24);
  427. result[12] = curlx_ultouc((ctx->d)&0xff);
  428. result[13] = curlx_ultouc((ctx->d >> 8)&0xff);
  429. result[14] = curlx_ultouc((ctx->d >> 16)&0xff);
  430. result[15] = curlx_ultouc(ctx->d >> 24);
  431. memset(ctx, 0, sizeof(*ctx));
  432. }
  433. #endif /* CRYPTO LIBS */
  434. CURLcode Curl_md4it(unsigned char *output, const unsigned char *input,
  435. const size_t len)
  436. {
  437. MD4_CTX ctx;
  438. #ifdef VOID_MD4_INIT
  439. MD4_Init(&ctx);
  440. #else
  441. if(!MD4_Init(&ctx))
  442. return CURLE_FAILED_INIT;
  443. #endif
  444. MD4_Update(&ctx, input, curlx_uztoui(len));
  445. MD4_Final(output, &ctx);
  446. return CURLE_OK;
  447. }
  448. #endif /* USE_CURL_NTLM_CORE */