mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
md4: drop mbedtls implementation (not available in mbedtls v3+)
Follow-up to 01a2308236 #18254
Closes #19202
This commit is contained in:
parent
0d1d35fa34
commit
3ac38a6b80
1 changed files with 0 additions and 43 deletions
43
lib/md4.c
43
lib/md4.c
|
|
@ -51,14 +51,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_MBEDTLS
|
||||
#include <mbedtls/version.h>
|
||||
#if MBEDTLS_VERSION_NUMBER < 0x04000000 && defined(MBEDTLS_MD4_C)
|
||||
#define USE_MBEDTLS_MD4
|
||||
#include <mbedtls/mbedtls_config.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* When OpenSSL or wolfSSL is available, we use their MD4 functions. */
|
||||
#if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
|
||||
#include <wolfssl/openssl/md4.h>
|
||||
|
|
@ -78,8 +70,6 @@
|
|||
#include <wincrypt.h>
|
||||
#elif defined(USE_GNUTLS)
|
||||
#include <nettle/md4.h>
|
||||
#elif defined(USE_MBEDTLS_MD4)
|
||||
#include <mbedtls/md4.h>
|
||||
#endif
|
||||
|
||||
/* The last 2 #include files should be in this order */
|
||||
|
|
@ -187,39 +177,6 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
|
|||
md4_digest(ctx, MD4_DIGEST_SIZE, result);
|
||||
}
|
||||
|
||||
#elif defined(USE_MBEDTLS_MD4)
|
||||
|
||||
struct md4_ctx {
|
||||
void *data;
|
||||
unsigned long size;
|
||||
};
|
||||
typedef struct md4_ctx MD4_CTX;
|
||||
|
||||
static int MD4_Init(MD4_CTX *ctx)
|
||||
{
|
||||
ctx->data = NULL;
|
||||
ctx->size = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
|
||||
{
|
||||
if(!ctx->data) {
|
||||
ctx->data = Curl_memdup(data, size);
|
||||
if(ctx->data)
|
||||
ctx->size = size;
|
||||
}
|
||||
}
|
||||
|
||||
static void MD4_Final(unsigned char *result, MD4_CTX *ctx)
|
||||
{
|
||||
if(ctx->data) {
|
||||
mbedtls_md4(ctx->data, ctx->size, result);
|
||||
Curl_safefree(ctx->data);
|
||||
ctx->size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
/* When no other crypto library is available, or the crypto library does not
|
||||
* support MD4, we use this code segment this implementation of it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue