Browse code

openssl: don't use deprecated SSLEAY/SSLeay symbols

Compiling our current master against OpenSSL 1.1 with
-DOPENSSL_API_COMPAT=0x10100000L screams bloody murder. This patch fixes
the errors about the deprecated SSLEAY/SSLeay symbols and defines.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20171126150401.28565-1-steffan@karger.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15934.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Steffan Karger authored on 2017/11/27 00:04:00
Showing 3 changed files
... ...
@@ -918,6 +918,7 @@ if test "${with_crypto_library}" = "openssl"; then
918 918
 			EVP_MD_CTX_new \
919 919
 			EVP_MD_CTX_free \
920 920
 			EVP_MD_CTX_reset \
921
+			OpenSSL_version \
921 922
 			SSL_CTX_get_default_passwd_cb \
922 923
 			SSL_CTX_get_default_passwd_cb_userdata \
923 924
 			SSL_CTX_set_security_level \
... ...
@@ -657,6 +657,14 @@ EC_GROUP_order_bits(const EC_GROUP *group)
657 657
 #endif
658 658
 
659 659
 /* SSLeay symbols have been renamed in OpenSSL 1.1 */
660
+#ifndef OPENSSL_VERSION
661
+#define OPENSSL_VERSION SSLEAY_VERSION
662
+#endif
663
+
664
+#ifndef HAVE_OPENSSL_VERSION
665
+#define OpenSSL_version SSLeay_version
666
+#endif
667
+
660 668
 #if !defined(RSA_F_RSA_OSSL_PRIVATE_ENCRYPT)
661 669
 #define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT       RSA_F_RSA_EAY_PRIVATE_ENCRYPT
662 670
 #endif
... ...
@@ -2037,7 +2037,7 @@ get_highest_preference_tls_cipher(char *buf, int size)
2037 2037
 const char *
2038 2038
 get_ssl_library_version(void)
2039 2039
 {
2040
-    return SSLeay_version(SSLEAY_VERSION);
2040
+    return OpenSSL_version(OPENSSL_VERSION);
2041 2041
 }
2042 2042
 
2043 2043
 #endif /* defined(ENABLE_CRYPTO_OPENSSL) */