summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/md5.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-26 13:30:18 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-26 13:30:25 (GMT)
commit42d9b3dc6af8a70f1238fce5f5db2e5910452f0b (patch)
tree8701572d53316e111fec262c78450ecc22e8762d /Utilities/cmcurl/lib/md5.c
parent1f47a65c7ac1b09f013543d2bd2ca38d2502f3a1 (diff)
parente5ff413f41877dc46498c384fa4f6e5b23ec1476 (diff)
downloadCMake-42d9b3dc6af8a70f1238fce5f5db2e5910452f0b.zip
CMake-42d9b3dc6af8a70f1238fce5f5db2e5910452f0b.tar.gz
CMake-42d9b3dc6af8a70f1238fce5f5db2e5910452f0b.tar.bz2
Merge topic 'update-curl' into release-3.18
e5ff413f41 curl: Set build options the way we need for CMake 0ef8fa5000 Merge branch 'upstream-curl' into update-curl 5717fdc114 curl 2020-06-23 (e9db32a0) 39f7cfad31 curl: Update script to get curl 7.71.0 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4937
Diffstat (limited to 'Utilities/cmcurl/lib/md5.c')
-rw-r--r--Utilities/cmcurl/lib/md5.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/Utilities/cmcurl/lib/md5.c b/Utilities/cmcurl/lib/md5.c
index 3f601b3..557a51e 100644
--- a/Utilities/cmcurl/lib/md5.c
+++ b/Utilities/cmcurl/lib/md5.c
@@ -179,15 +179,16 @@ static void MD5_Final(unsigned char *digest, MD5_CTX *ctx)
/* The last #include file should be: */
#include "memdebug.h"
-typedef struct {
+struct md5_ctx {
HCRYPTPROV hCryptProv;
HCRYPTHASH hHash;
-} MD5_CTX;
+};
+typedef struct md5_ctx MD5_CTX;
static void MD5_Init(MD5_CTX *ctx)
{
- if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL,
- PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
+ if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL,
+ CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
CryptCreateHash(ctx->hCryptProv, CALG_MD5, 0, 0, &ctx->hHash);
}
}
@@ -261,12 +262,13 @@ static void MD5_Final(unsigned char *digest, MD5_CTX *ctx)
/* Any 32-bit or wider unsigned integer data type will do */
typedef unsigned int MD5_u32plus;
-typedef struct {
+struct md5_ctx {
MD5_u32plus lo, hi;
MD5_u32plus a, b, c, d;
unsigned char buffer[64];
MD5_u32plus block[16];
-} MD5_CTX;
+};
+typedef struct md5_ctx MD5_CTX;
static void MD5_Init(MD5_CTX *ctx);
static void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);
@@ -528,7 +530,7 @@ static void MD5_Final(unsigned char *result, MD5_CTX *ctx)
#endif /* CRYPTO LIBS */
-const HMAC_params Curl_HMAC_MD5[] = {
+const struct HMAC_params Curl_HMAC_MD5[] = {
{
/* Hash initialization function. */
CURLX_FUNCTION_CAST(HMAC_hinit_func, MD5_Init),
@@ -545,7 +547,7 @@ const HMAC_params Curl_HMAC_MD5[] = {
}
};
-const MD5_params Curl_DIGEST_MD5[] = {
+const struct MD5_params Curl_DIGEST_MD5[] = {
{
/* Digest initialization function */
CURLX_FUNCTION_CAST(Curl_MD5_init_func, MD5_Init),
@@ -573,9 +575,9 @@ void Curl_md5it(unsigned char *outbuffer, const unsigned char *input,
MD5_Final(outbuffer, &ctx);
}
-MD5_context *Curl_MD5_init(const MD5_params *md5params)
+struct MD5_context *Curl_MD5_init(const struct MD5_params *md5params)
{
- MD5_context *ctxt;
+ struct MD5_context *ctxt;
/* Create MD5 context */
ctxt = malloc(sizeof(*ctxt));
@@ -597,7 +599,7 @@ MD5_context *Curl_MD5_init(const MD5_params *md5params)
return ctxt;
}
-CURLcode Curl_MD5_update(MD5_context *context,
+CURLcode Curl_MD5_update(struct MD5_context *context,
const unsigned char *data,
unsigned int len)
{
@@ -606,7 +608,7 @@ CURLcode Curl_MD5_update(MD5_context *context,
return CURLE_OK;
}
-CURLcode Curl_MD5_final(MD5_context *context, unsigned char *result)
+CURLcode Curl_MD5_final(struct MD5_context *context, unsigned char *result)
{
(*context->md5_hash->md5_final_func)(result, context->md5_hashctx);