summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2018-10-26 13:43:28 +1100
committerDamien Miller <djm@mindrot.org>2018-10-26 13:43:28 +1100
commit406a24b25d6a2bdd70cacd16de7e899dcb2a8829 (patch)
tree28390a7c41589960400dc9beb41aa77ad3e8db7a
parent859754bdeb41373d372e36b5dc89c547453addb3 (diff)
fix builds on OpenSSL <= 1.0.x
I thought OpenSSL 1.0.x offered the new-style OpenSSL_version_num() API to obtain version number, but they don't.
-rw-r--r--configure.ac9
-rw-r--r--openbsd-compat/openssl-compat.h6
2 files changed, 14 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 0d55bece5..a4109effc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2601,7 +2601,11 @@ if test "x$openssl" = "xyes" ; then
2601 fd = fopen(DATA,"w"); 2601 fd = fopen(DATA,"w");
2602 if(fd == NULL) 2602 if(fd == NULL)
2603 exit(1); 2603 exit(1);
2604 2604#if OPENSSL_VERSION_NUMBER < 0x10100000L
2605# define OpenSSL_version_num SSLeay
2606# define OpenSSL_version SSLeay_version
2607# define OPENSSL_VERSION SSLEAY_VERSION
2608#endif
2605 if ((rc = fprintf(fd, "%08lx (%s)\n", 2609 if ((rc = fprintf(fd, "%08lx (%s)\n",
2606 (unsigned long)OpenSSL_version_num(), 2610 (unsigned long)OpenSSL_version_num(),
2607 OpenSSL_version(OPENSSL_VERSION))) < 0) 2611 OpenSSL_version(OPENSSL_VERSION))) < 0)
@@ -2646,6 +2650,9 @@ if test "x$openssl" = "xyes" ; then
2646 #include <openssl/opensslv.h> 2650 #include <openssl/opensslv.h>
2647 #include <openssl/crypto.h> 2651 #include <openssl/crypto.h>
2648 ]], [[ 2652 ]], [[
2653#if OPENSSL_VERSION_NUMBER < 0x10100000L
2654# define OpenSSL_version_num SSLeay
2655#endif
2649 exit(OpenSSL_version_num() == OPENSSL_VERSION_NUMBER ? 0 : 1); 2656 exit(OpenSSL_version_num() == OPENSSL_VERSION_NUMBER ? 0 : 1);
2650 ]])], 2657 ]])],
2651 [ 2658 [
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h
index 9e0264c04..0fbf60df4 100644
--- a/openbsd-compat/openssl-compat.h
+++ b/openbsd-compat/openssl-compat.h
@@ -33,6 +33,12 @@ int ssh_compatible_openssl(long, long);
33# error OpenSSL 0.9.8f or greater is required 33# error OpenSSL 0.9.8f or greater is required
34#endif 34#endif
35 35
36#if OPENSSL_VERSION_NUMBER < 0x10100000L
37# define OpenSSL_version_num SSLeay
38# define OpenSSL_version SSLeay_version
39# define OPENSSL_VERSION SSLEAY_VERSION
40#endif
41
36#if OPENSSL_VERSION_NUMBER < 0x10000001L 42#if OPENSSL_VERSION_NUMBER < 0x10000001L
37# define LIBCRYPTO_EVP_INL_TYPE unsigned int 43# define LIBCRYPTO_EVP_INL_TYPE unsigned int
38#else 44#else