diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2017-06-23 01:04:56 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-08-28 14:56:56 +0200 |
commit | 0a083a66bcae51a485d45ba416eac1d1fbe4ca15 (patch) | |
tree | 4c8eca6382c89812045f2475a35b5c26ec97df54 /lib/vtls/openssl.c | |
parent | e35205a0c4f8d80dc9e878049a0fb0eb18f61dbf (diff) | |
download | curl-0a083a66bcae51a485d45ba416eac1d1fbe4ca15.tar.gz |
vtls: move sha256sum into the Curl_ssl struct
The SHA-256 checksumming is also an SSL backend-specific function.
Let's include it in the struct declaring the functionality of SSL
backends.
In contrast to MD5, there is no fall-back code. To indicate this, the
respective entries are NULL for those backends that offer no support for
SHA-256 checksumming.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'lib/vtls/openssl.c')
-rw-r--r-- | lib/vtls/openssl.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index e24c79515..eeecd9da6 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -3364,10 +3364,10 @@ static CURLcode Curl_ossl_md5sum(unsigned char *tmp, /* input */ } #if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && !defined(OPENSSL_NO_SHA256) -void Curl_ossl_sha256sum(const unsigned char *tmp, /* input */ - size_t tmplen, - unsigned char *sha256sum /* output */, - size_t unused) +static void Curl_ossl_sha256sum(const unsigned char *tmp, /* input */ + size_t tmplen, + unsigned char *sha256sum /* output */, + size_t unused) { SHA256_CTX SHA256pw; (void)unused; @@ -3407,7 +3407,12 @@ const struct Curl_ssl Curl_ssl_openssl = { Curl_ossl_set_engine_default, /* set_engine_default */ Curl_ossl_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ - Curl_ossl_md5sum /* md5sum */ + Curl_ossl_md5sum, /* md5sum */ +#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && !defined(OPENSSL_NO_SHA256) + Curl_ossl_sha256sum /* sha256sum */ +#else + NULL /* sha256sum */ +#endif }; const struct Curl_ssl *Curl_ssl = &Curl_ssl_openssl; |