diff options
author | Curl Upstream <curl-library@cool.haxx.se> | 2020-06-23 21:41:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-06-24 11:55:09 (GMT) |
commit | 5717fdc114a704cddae629e20e6588191360e98a (patch) | |
tree | 36545299412c5cafb4d3e3eb464598af465ea4c8 /lib/md4.c | |
parent | 735ea3001ae98636a4cb7caf15a40960c0da39a1 (diff) | |
download | CMake-5717fdc114a704cddae629e20e6588191360e98a.zip CMake-5717fdc114a704cddae629e20e6588191360e98a.tar.gz CMake-5717fdc114a704cddae629e20e6588191360e98a.tar.bz2 |
curl 2020-06-23 (e9db32a0)
Code extracted from:
https://github.com/curl/curl.git
at commit e9db32a09af03f27e86d1251a9e68e9b7486d371 (curl-7_71_0).
Diffstat (limited to 'lib/md4.c')
-rw-r--r-- | lib/md4.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -29,6 +29,10 @@ #ifdef USE_OPENSSL #include <openssl/opensslconf.h> +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) +/* OpenSSL 3.0.0 marks the MD4 functions as deprecated */ +#define OPENSSL_NO_MD4 +#endif #endif /* USE_OPENSSL */ #ifdef USE_MBEDTLS @@ -135,10 +139,11 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) /* The last #include file should be: */ #include "memdebug.h" -typedef struct { +struct md4_ctx { HCRYPTPROV hCryptProv; HCRYPTHASH hHash; -} MD4_CTX; +}; +typedef struct md4_ctx MD4_CTX; static void MD4_Init(MD4_CTX *ctx) { @@ -146,7 +151,7 @@ static void MD4_Init(MD4_CTX *ctx) ctx->hHash = 0; if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT)) { + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { CryptCreateHash(ctx->hCryptProv, CALG_MD4, 0, 0, &ctx->hHash); } } @@ -180,10 +185,11 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) /* The last #include file should be: */ #include "memdebug.h" -typedef struct { +struct md4_ctx { void *data; unsigned long size; -} MD4_CTX; +}; +typedef struct md4_ctx MD4_CTX; static void MD4_Init(MD4_CTX *ctx) { @@ -262,12 +268,13 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) /* Any 32-bit or wider unsigned integer data type will do */ typedef unsigned int MD4_u32plus; -typedef struct { +struct md4_ctx { MD4_u32plus lo, hi; MD4_u32plus a, b, c, d; unsigned char buffer[64]; MD4_u32plus block[16]; -} MD4_CTX; +}; +typedef struct md4_ctx MD4_CTX; static void MD4_Init(MD4_CTX *ctx); static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size); |