diff options
author | x2018 <xkernel.wang@foxmail.com> | 2021-12-10 21:33:39 +0800 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-12-13 15:54:16 +0100 |
commit | d6ff35b5a5b141eb60b4e68f355353ae26674f1d (patch) | |
tree | d3f906abd1e554159e78768f04a7ad33eb3368f1 /lib/vauth | |
parent | da973165965962a435a23ade336d9a17daf044ef (diff) | |
download | curl-d6ff35b5a5b141eb60b4e68f355353ae26674f1d.tar.gz |
sha256/md5: return errors when init fails
Closes #8133
Diffstat (limited to 'lib/vauth')
-rw-r--r-- | lib/vauth/digest.c | 4 | ||||
-rw-r--r-- | lib/vauth/ntlm.c | 4 |
2 files changed, 5 insertions, 3 deletions
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 */ |