aboutsummaryrefslogtreecommitdiff
path: root/lib/vtls
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vtls')
-rw-r--r--lib/vtls/vtls.c11
-rw-r--r--lib/vtls/vtls.h8
2 files changed, 11 insertions, 8 deletions
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
index 6973de42a..12427c17c 100644
--- a/lib/vtls/vtls.c
+++ b/lib/vtls/vtls.c
@@ -828,10 +828,10 @@ CURLcode Curl_pin_peer_pubkey(const char *pinnedpubkey,
}
#ifndef CURL_DISABLE_CRYPTO_AUTH
-void Curl_ssl_md5sum(unsigned char *tmp, /* input */
- size_t tmplen,
- unsigned char *md5sum, /* output */
- size_t md5len)
+CURLcode Curl_ssl_md5sum(unsigned char *tmp, /* input */
+ size_t tmplen,
+ unsigned char *md5sum, /* output */
+ size_t md5len)
{
#ifdef curlssl_md5sum
curlssl_md5sum(tmp, tmplen, md5sum, md5len);
@@ -841,9 +841,12 @@ void Curl_ssl_md5sum(unsigned char *tmp, /* input */
(void) md5len;
MD5pw = Curl_MD5_init(Curl_DIGEST_MD5);
+ if(!MD5pw)
+ return CURLE_OUT_OF_MEMORY;
Curl_MD5_update(MD5pw, tmp, curlx_uztoui(tmplen));
Curl_MD5_final(MD5pw, md5sum);
#endif
+ return CURLE_OK;
}
#endif
diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h
index 1a5f54fe4..b9741d7af 100644
--- a/lib/vtls/vtls.h
+++ b/lib/vtls/vtls.h
@@ -108,10 +108,10 @@ void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid);
in */
int Curl_ssl_random(struct SessionHandle *data, unsigned char *buffer,
size_t length);
-void Curl_ssl_md5sum(unsigned char *tmp, /* input */
- size_t tmplen,
- unsigned char *md5sum, /* output */
- size_t md5len);
+CURLcode Curl_ssl_md5sum(unsigned char *tmp, /* input */
+ size_t tmplen,
+ unsigned char *md5sum, /* output */
+ size_t md5len);
/* Check pinned public key. */
CURLcode Curl_pin_peer_pubkey(const char *pinnedpubkey,
const unsigned char *pubkey, size_t pubkeylen);