Browse code

Revert "tls: added define condition on version functions"

This reverts commit 99c6a68dea60ca745dfdfa33085bb6acbcee846a.

Victor Seva authored on 02/09/2020 12:27:24
Showing 2 changed files
... ...
@@ -63,11 +63,9 @@ static void setup_ecdh(SSL_CTX *ctx)
63 63
 {
64 64
    EC_KEY *ecdh;
65 65
 
66
-#if OPENSSL_VERSION_NUMBER < 0x010100000L
67
-   if (SSLeay() < 0x1000005fL) {
66
+   if (OpenSSL_version_num() < 0x1000005fL) {
68 67
       return;
69 68
    }
70
-#endif
71 69
 
72 70
    ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
73 71
    SSL_CTX_set_options(ctx, SSL_OP_SINGLE_ECDH_USE);
... ...
@@ -645,7 +645,6 @@ int tls_h_mod_init_f(void)
645 645
 {
646 646
 	/*struct socket_info* si;*/
647 647
 	long ssl_version;
648
-	const char *ssl_version_txt;
649 648
 #if OPENSSL_VERSION_NUMBER < 0x010100000L && !defined(LIBRESSL_VERSION_NUMBER)
650 649
 	int lib_kerberos;
651 650
 	int lib_zlib;
... ...
@@ -668,15 +667,7 @@ int tls_h_mod_init_f(void)
668 667
 #if OPENSSL_VERSION_NUMBER < 0x00907000L
669 668
 	LM_WARN("You are using an old version of OpenSSL (< 0.9.7). Upgrade!\n");
670 669
 #endif
671
-
672
-#if OPENSSL_VERSION_NUMBER < 0x010100000L
673
-	ssl_version=SSLeay();
674
-	ssl_version_txt=SSLeay_version(SSLEAY_VERSION);
675
-#else
676 670
 	ssl_version=OpenSSL_version_num();
677
-	ssl_version_txt=OpenSSL_version(OPENSSL_VERSION);
678
-#endif
679
-
680 671
 	/* check if version have the same major minor and fix level
681 672
 	 * (e.g. 0.9.8a & 0.9.8c are ok, but 0.9.8 and 0.9.9x are not)
682 673
 	 * - values is represented as 0xMMNNFFPPS: major minor fix patch status
... ...
@@ -688,7 +679,7 @@ int tls_h_mod_init_f(void)
688 679
 				" compiled \"%s\" (0x%08lx).\n"
689 680
 				" Please make sure a compatible version is used"
690 681
 				" (tls_force_run in kamailio.cfg will override this check)\n",
691
-				ssl_version_txt, ssl_version,
682
+				OpenSSL_version(OPENSSL_VERSION), ssl_version,
692 683
 				OPENSSL_VERSION_TEXT, (long)OPENSSL_VERSION_NUMBER);
693 684
 		if (cfg_get(tls, tls_cfg, force_run))
694 685
 			LM_WARN("tls_force_run turned on, ignoring "