]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
tcptls: Handle new OpenSSL compile time option to disable SSLv3
authorMatthew Jordan <mjordan@digium.com>
Thu, 19 Feb 2015 15:21:06 +0000 (15:21 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 19 Feb 2015 15:21:06 +0000 (15:21 +0000)
Some distributions are going to disable SSLv3 at compile time. This option can
be checked using the directive OPENSSL_NO_SSL3_METHOD. This patch updates the
TCP/TLS handling in Asterisk to look for that directive before attempting to
use the SSLv3 specific methods.

ASTERISK-24799 #close
Reported by: Alexander Traud
patches:
  no-ssl3-method.patch uploaded by Alexander Traud (License 6520)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@431936 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/tcptls.c

index a480508e39d8fd6b86d7b4c0f4d48b2624b771ca..a1d1ef72cfc03a76faaab321b18858ffb4194abb 100644 (file)
@@ -768,10 +768,13 @@ static int __ssl_setup(struct ast_tls_config *cfg, int client)
                        cfg->ssl_ctx = SSL_CTX_new(SSLv2_client_method());
                } else
 #endif
+#ifndef OPENSSL_NO_SSL3_METHOD
                if (ast_test_flag(&cfg->flags, AST_SSL_SSLV3_CLIENT)) {
                        ast_log(LOG_WARNING, "Usage of SSLv3 is discouraged due to known vulnerabilities. Please use 'tlsv1' or leave the TLS method unspecified!\n");
                        cfg->ssl_ctx = SSL_CTX_new(SSLv3_client_method());
-               } else if (ast_test_flag(&cfg->flags, AST_SSL_TLSV1_CLIENT)) {
+               } else
+#endif
+               if (ast_test_flag(&cfg->flags, AST_SSL_TLSV1_CLIENT)) {
                        cfg->ssl_ctx = SSL_CTX_new(TLSv1_client_method());
                } else {
                        disable_ssl = 1;