mirror of
https://github.com/curl/curl.git
synced 2026-07-28 15:03:06 +03:00
md4
This commit is contained in:
parent
80e74bd384
commit
c81b21a433
1 changed files with 3 additions and 13 deletions
16
lib/md4.c
16
lib/md4.c
|
|
@ -53,15 +53,10 @@
|
|||
|
||||
#ifdef USE_MBEDTLS
|
||||
#include <mbedtls/version.h>
|
||||
#if MBEDTLS_VERSION_NUMBER >= 0x03000000
|
||||
#if MBEDTLS_VERSION_NUMBER < 0x03000000
|
||||
#error "mbedTLS 3.0.0 or later required"
|
||||
#endif
|
||||
#include <mbedtls/mbedtls_config.h>
|
||||
#else
|
||||
#include <mbedtls/config.h>
|
||||
#endif
|
||||
#if(MBEDTLS_VERSION_NUMBER >= 0x02070000) && \
|
||||
(MBEDTLS_VERSION_NUMBER < 0x03000000)
|
||||
#define HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS
|
||||
#endif
|
||||
#endif /* USE_MBEDTLS */
|
||||
|
||||
/* When OpenSSL or wolfSSL is available, we use their MD4 functions. */
|
||||
|
|
@ -220,12 +215,7 @@ static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
|
|||
static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
|
||||
{
|
||||
if(ctx->data) {
|
||||
#ifndef HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS
|
||||
mbedtls_md4(ctx->data, ctx->size, result);
|
||||
#else
|
||||
(void)mbedtls_md4_ret(ctx->data, ctx->size, result);
|
||||
#endif
|
||||
|
||||
Curl_safefree(ctx->data);
|
||||
ctx->size = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue