diff options
author | Curl Upstream <curl-library@cool.haxx.se> | 2018-05-15 14:43:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-05-18 14:16:12 (GMT) |
commit | d431136e029c652f5913bcebeaab3b9236b114c4 (patch) | |
tree | c0838b4432a3786a323c94a680bb16f644198311 /lib/sha256.c | |
parent | af9e654045f11028e50dac4781e297834129a749 (diff) | |
download | CMake-d431136e029c652f5913bcebeaab3b9236b114c4.zip CMake-d431136e029c652f5913bcebeaab3b9236b114c4.tar.gz CMake-d431136e029c652f5913bcebeaab3b9236b114c4.tar.bz2 |
curl 2018-05-15 (cb013830)
Code extracted from:
https://github.com/curl/curl.git
at commit cb013830383f1ccc9757aba36bc32df5ec281c02 (curl-7_60_0).
Diffstat (limited to 'lib/sha256.c')
-rw-r--r-- | lib/sha256.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/sha256.c b/lib/sha256.c index cd81c02..55716c6 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -29,9 +29,17 @@ #if defined(USE_OPENSSL) +#include <openssl/opensslv.h> + +#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) +#define USE_OPENSSL_SHA256 +#endif + +#endif + +#ifdef USE_OPENSSL_SHA256 /* When OpenSSL is available we use the SHA256-function from OpenSSL */ #include <openssl/sha.h> - #else /* When no other crypto library is available we use this code segment */ @@ -234,7 +242,7 @@ static int SHA256_Final(unsigned char *out, sha256_compress(md, md->buf); md->curlen = 0; } - /* pad upto 56 bytes of zeroes */ + /* pad up to 56 bytes of zeroes */ while(md->curlen < 56) { md->buf[md->curlen++] = (unsigned char)0; } |