From d6ff35b5a5b141eb60b4e68f355353ae26674f1d Mon Sep 17 00:00:00 2001 From: x2018 Date: Fri, 10 Dec 2021 21:33:39 +0800 Subject: sha256/md5: return errors when init fails Closes #8133 --- lib/vauth/digest.c | 4 ++-- lib/vauth/ntlm.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/vauth') diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index 52179c265..62484be9d 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -666,8 +666,8 @@ static CURLcode auth_create_digest_http_message( struct digestdata *digest, char **outptr, size_t *outlen, void (*convert_to_ascii)(unsigned char *, unsigned char *), - void (*hash)(unsigned char *, const unsigned char *, - const size_t)) + CURLcode (*hash)(unsigned char *, const unsigned char *, + const size_t)) { CURLcode result; unsigned char hashbuf[32]; /* 32 bytes/256 bits */ diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 0aa3f1c8c..04f6590ac 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -603,7 +603,9 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, memcpy(tmp, &ntlm->nonce[0], 8); memcpy(tmp + 8, entropy, 8); - Curl_md5it(md5sum, tmp, 16); + result = Curl_md5it(md5sum, tmp, 16); + if(result) + return result; /* We shall only use the first 8 bytes of md5sum, but the des code in Curl_ntlm_core_lm_resp only encrypt the first 8 bytes */ -- cgit v1.2.1