[asterisk-commits] tcptls: Avoiding ERR remove state in OpenSSL. (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 8 15:55:46 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: tcptls: Avoiding ERR_remove_state in OpenSSL.
......................................................................


tcptls: Avoiding ERR_remove_state in OpenSSL.

ERR_remove_state was deprecated with OpenSSL 1.0.0 and was replaced by 
ERR_remove_thread_state. ERR_load_SSL_strings and ERR_load_BIO_strings were 
called by SSL_load_error_strings already and got removed. These changes allow 
OpenSSL forks like BoringSSL to be used with Asterisk.

ASTERISK-25043 #close
Reported by: Alexander Traud
patches:
  asterisk_with_BoringSSL.patch uploaded by Alexander Traud (License 6520)

Change-Id: If1c0871ece21a7e0763fafbd2fa023ae49d4d629
(cherry picked from commit 247fef66537b59649e7571d64e2c574a106dbd65)
---
M main/libasteriskssl.c
M main/tcptls.c
2 files changed, 4 insertions(+), 35 deletions(-)

Approvals:
  Matt Jordan: Looks good to me, approved; Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c
index ca3fb56..b326701 100644
--- a/main/libasteriskssl.c
+++ b/main/libasteriskssl.c
@@ -93,33 +93,6 @@
 #endif
 }
 
-void ERR_load_SSL_strings(void)
-{
-#if defined(AST_DEVMODE)
-	if (startup_complete) {
-		ast_debug(1, "Called after startup... ignoring!\n");
-	}
-#endif
-}
-
-void ERR_load_crypto_strings(void)
-{
-#if defined(AST_DEVMODE)
-	if (startup_complete) {
-		ast_debug(1, "Called after startup... ignoring!\n");
-	}
-#endif
-}
-
-void ERR_load_BIO_strings(void)
-{
-#if defined(AST_DEVMODE)
-	if (startup_complete) {
-		ast_debug(1, "Called after startup... ignoring!\n");
-	}
-#endif
-}
-
 void CRYPTO_set_id_callback(unsigned long (*func)(void))
 {
 #if defined(AST_DEVMODE)
@@ -157,8 +130,6 @@
 	void (*real_CRYPTO_set_id_callback)(unsigned long (*)(void));
 	void (*real_CRYPTO_set_locking_callback)(void (*)(int, int, const char *, int));
 	void (*real_SSL_load_error_strings)(void);
-	void (*real_ERR_load_SSL_strings)(void);
-	void (*real_ERR_load_BIO_strings)(void);
 	const char *errstr;
 
 	/* clear any previous dynamic linker errors */
@@ -215,12 +186,6 @@
 
 	get_OpenSSL_function(SSL_load_error_strings);
 	real_SSL_load_error_strings();
-
-	get_OpenSSL_function(ERR_load_SSL_strings);
-	real_ERR_load_SSL_strings();
-
-	get_OpenSSL_function(ERR_load_BIO_strings);
-	real_ERR_load_BIO_strings();
 
 	startup_complete = 1;
 
diff --git a/main/tcptls.c b/main/tcptls.c
index 92fee60..1b0c26a 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -400,7 +400,11 @@
 
 			if (!stream->ssl->server) {
 				/* For client threads, ensure that the error stack is cleared */
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+				ERR_remove_thread_state(NULL);
+#else
 				ERR_remove_state(0);
+#endif	/* OPENSSL_VERSION_NUMBER >= 0x10000000L */
 			}
 
 			SSL_free(stream->ssl);

-- 
To view, visit https://gerrit.asterisk.org/405
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If1c0871ece21a7e0763fafbd2fa023ae49d4d629
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list