mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
md4, md5: switch to wolfCrypt API in wolfSSL builds
Replacing the OpenSSL-like compatibility interface, and syncing with other hashes, when building with wolfSSL. Also: stop stomping on OpenSSL public MD4 symbols. This makes the wolfSSL coexist workaround unnecessary, while also syncing up with MD5 sources. After this patch the only remaining reference to wolfSSL's OpenSSL compatibility layer is in `lib/curl_ntlm_core.c`. Closes #21093
This commit is contained in:
parent
486334509f
commit
bf6a34d8eb
2 changed files with 64 additions and 50 deletions
20
lib/md5.c
20
lib/md5.c
|
|
@ -67,14 +67,9 @@ static void my_md5_final(unsigned char *digest, void *ctx)
|
|||
md5_digest(ctx, 16, digest);
|
||||
}
|
||||
|
||||
#elif (defined(USE_OPENSSL) && \
|
||||
!defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_DEPRECATED_3_0)) || \
|
||||
(defined(USE_WOLFSSL) && !defined(NO_MD5) && !defined(OPENSSL_COEXIST))
|
||||
#ifdef USE_OPENSSL
|
||||
#elif defined(USE_OPENSSL) && \
|
||||
!defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||
#include <openssl/md5.h>
|
||||
#else
|
||||
#include <wolfssl/openssl/md5.h>
|
||||
#endif
|
||||
|
||||
typedef MD5_CTX my_md5_ctx;
|
||||
|
||||
|
|
@ -98,27 +93,26 @@ static void my_md5_final(unsigned char *digest, void *ctx)
|
|||
}
|
||||
|
||||
#elif defined(USE_WOLFSSL) && !defined(NO_MD5)
|
||||
#include <wolfssl/openssl/md5.h>
|
||||
#include <wolfssl/wolfcrypt/md5.h>
|
||||
|
||||
typedef WOLFSSL_MD5_CTX my_md5_ctx;
|
||||
typedef wc_Md5 my_md5_ctx;
|
||||
|
||||
static CURLcode my_md5_init(void *ctx)
|
||||
{
|
||||
if(!wolfSSL_MD5_Init(ctx))
|
||||
if(wc_InitMd5(ctx))
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static void my_md5_update(void *ctx,
|
||||
const unsigned char *input, unsigned int len)
|
||||
{
|
||||
(void)wolfSSL_MD5_Update(ctx, input, len);
|
||||
(void)wc_Md5Update(ctx, input, (word32)len);
|
||||
}
|
||||
|
||||
static void my_md5_final(unsigned char *digest, void *ctx)
|
||||
{
|
||||
(void)wolfSSL_MD5_Final(digest, ctx);
|
||||
(void)wc_Md5Final(ctx, digest);
|
||||
}
|
||||
|
||||
#elif defined(USE_MBEDTLS) && \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue