aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Mencken <dougmencken@gmail.com>2018-02-12 06:19:56 -0500
committerDaniel Stenberg <daniel@haxx.se>2018-02-12 14:16:37 +0100
commit50c0033a6c6fcef73a7a5fcbb7c46e077e546ce2 (patch)
treeb9e8329ddd292993ca48db92d28bd409628d5116 /lib
parentb9e323334d2f8afdb4998d22d16a7643981abc63 (diff)
sha256: build with OpenSSL < 0.9.8 too
support for SHA-2 was introduced in OpenSSL 0.9.8 Closes #2305
Diffstat (limited to 'lib')
-rw-r--r--lib/sha256.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/sha256.c b/lib/sha256.c
index cd81c0254..776bd2846 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -27,8 +27,20 @@
#include "warnless.h"
#include "curl_sha256.h"
+#define USE_OPENSSL_SHA256 0
+
#if defined(USE_OPENSSL)
+#include <openssl/opensslv.h>
+
+#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL)
+#define USE_OPENSSL_SHA256 1
+#endif
+
+#endif
+
+#if USE_OPENSSL_SHA256
+
/* When OpenSSL is available we use the SHA256-function from OpenSSL */
#include <openssl/sha.h>