sha256/md5: return errors when init fails

Closes #8133
This commit is contained in:
x2018 2021-12-10 21:33:39 +08:00 committed by Daniel Stenberg
parent da97316596
commit d6ff35b5a5
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 73 additions and 40 deletions

View file

@ -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 */

View file

@ -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 */