diff options
Diffstat (limited to 'lib/vtls/vtls.c')
-rw-r--r-- | lib/vtls/vtls.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index def1d30cb..7ad18a3df 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -831,8 +831,12 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, sha256sumdigest = malloc(CURL_SHA256_DIGEST_LENGTH); if(!sha256sumdigest) return CURLE_OUT_OF_MEMORY; - Curl_ssl->sha256sum(pubkey, pubkeylen, + encode = Curl_ssl->sha256sum(pubkey, pubkeylen, sha256sumdigest, CURL_SHA256_DIGEST_LENGTH); + + if(encode != CURLE_OK) + return encode; + encode = Curl_base64_encode(data, (char *)sha256sumdigest, CURL_SHA256_DIGEST_LENGTH, &encoded, &encodedlen); |