summaryrefslogtreecommitdiffstats
path: root/openbsd-compat
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2018-10-28 04:34:12 +0100
committerDarren Tucker <dtucker@dtucker.net>2018-10-28 04:34:12 +0100
commitc801b0e38eae99427f37869370151b78f8e15c5d (patch)
treeda55d831767cad4054f881c94f5f5298410be8e0 /openbsd-compat
parentCheck for the existence of openssl version funcs. (diff)
downloadopenssh-c801b0e38eae99427f37869370151b78f8e15c5d.tar.xz
openssh-c801b0e38eae99427f37869370151b78f8e15c5d.zip
Use detected version functions in openssl compat.
Use detected functions in compat layer instead of guessing based on versions. Really fixes builds with LibreSSL, not just configure.
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/openssl-compat.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h
index 0fbf60df4..28e4fc360 100644
--- a/openbsd-compat/openssl-compat.h
+++ b/openbsd-compat/openssl-compat.h
@@ -21,6 +21,7 @@
#ifdef WITH_OPENSSL
#include <openssl/opensslv.h>
+#include <openssl/crypto.h>
#include <openssl/evp.h>
#include <openssl/rsa.h>
#include <openssl/dsa.h>
@@ -33,12 +34,18 @@ int ssh_compatible_openssl(long, long);
# error OpenSSL 0.9.8f or greater is required
#endif
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
-# define OpenSSL_version_num SSLeay
-# define OpenSSL_version SSLeay_version
+#ifndef OPENSSL_VERSION
# define OPENSSL_VERSION SSLEAY_VERSION
#endif
+#ifndef HAVE_OPENSSL_VERSION
+# define OpenSSL_version(x) SSLeay_version(x)
+#endif
+
+#ifndef HAVE_OPENSSL_VERSION_NUM
+# define OpenSSL_version_num SSLeay
+#endif
+
#if OPENSSL_VERSION_NUMBER < 0x10000001L
# define LIBCRYPTO_EVP_INL_TYPE unsigned int
#else