diff --git a/asterisk-openssl.patch b/asterisk-openssl.patch new file mode 100644 index 0000000..494bf8a --- /dev/null +++ b/asterisk-openssl.patch @@ -0,0 +1,83 @@ +commit b9b82f067dd2372dda3ecd83411c7b58800b80a2 +Author: Tom Hughes +Date: Fri Mar 10 22:46:33 2017 +0000 + + Fixes for OpenSSL 1.1.x support + +diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c +index 4e6ea1a..9f6b98c 100644 +--- a/main/libasteriskssl.c ++++ b/main/libasteriskssl.c +@@ -74,7 +74,7 @@ static void ssl_lock(int mode, int n, const char *file, int line) + } + } + +-#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + int SSL_library_init(void) + { + #if defined(AST_DEVMODE) +@@ -116,7 +116,7 @@ void ERR_free_strings(void) + { + /* we can't allow this to be called, ever */ + } +-#endif /* !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L */ ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + + #endif /* HAVE_OPENSSL */ + +diff --git a/main/tcptls.c b/main/tcptls.c +index 513676c..4e131f2 100644 +--- a/main/tcptls.c ++++ b/main/tcptls.c +@@ -40,6 +40,8 @@ ASTERISK_REGISTER_FILE() + #include + #include + ++#include ++ + #include "asterisk/compat.h" + #include "asterisk/tcptls.h" + #include "asterisk/http.h" +@@ -399,19 +401,17 @@ static int tcptls_stream_close(void *cookie) + SSL_get_error(stream->ssl, res)); + } + +-#if defined(OPENSSL_API_COMPAT) && OPENSSL_API_COMPAT >= 0x10100000L ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L + if (!SSL_is_server(stream->ssl)) { + #else + if (!stream->ssl->server) { + #endif + /* For client threads, ensure that the error stack is cleared */ +-#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L +-#if OPENSSL_VERSION_NUMBER >= 0x10000000L +- ERR_remove_thread_state(NULL); +-#else ++#if OPENSSL_VERSION_NUMBER < 0x10000000L + ERR_remove_state(0); +-#endif /* OPENSSL_VERSION_NUMBER >= 0x10000000L */ +-#endif /* !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L */ ++#elif OPENSSL_VERSION_NUMBER < 0x10100000L ++ ERR_remove_thread_state(NULL); ++#endif + } + + SSL_free(stream->ssl); +@@ -850,12 +850,16 @@ static int __ssl_setup(struct ast_tls_config *cfg, int client) + cfg->ssl_ctx = SSL_CTX_new(SSLv3_client_method()); + } else + #endif ++#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L) ++ cfg->ssl_ctx = SSL_CTX_new(TLS_client_method()); ++#else + if (ast_test_flag(&cfg->flags, AST_SSL_TLSV1_CLIENT)) { + cfg->ssl_ctx = SSL_CTX_new(TLSv1_client_method()); + } else { + disable_ssl = 1; + cfg->ssl_ctx = SSL_CTX_new(SSLv23_client_method()); + } ++#endif + } else { + disable_ssl = 1; + cfg->ssl_ctx = SSL_CTX_new(SSLv23_server_method()); diff --git a/menuselect.makeopts b/menuselect.makeopts index 701cd73..fe632d8 100644 --- a/menuselect.makeopts +++ b/menuselect.makeopts @@ -5,7 +5,7 @@ MENUSELECT_CDR=cdr_sqlite MENUSELECT_CEL=cel_radius MENUSELECT_CFLAGS=LOADABLE_MODULES MENUSELECT_CHANNELS=chan_nbs chan_vpb -MENUSELECT_CODECS= +MENUSELECT_CODECS=codec_opus codec_silk codec_siren7 codec_siren14 codec_g729a MENUSELECT_CORE_SOUNDS= MENUSELECT_EMBED= MENUSELECT_EXTRA_SOUNDS= @@ -14,11 +14,10 @@ MENUSELECT_FUNCS= MENUSELECT_MOH= MENUSELECT_OPTS_app_voicemail=FILE_STORAGE MENUSELECT_PBX= -MENUSELECT_RES=res_config_sqlite res_timing_kqueue res_stasis_test res_mwi_external res_mwi_external_ami res_stasis_mailbox res_ari_mailboxes -MENUSELECT_TESTS=test_skel test_heap test_sched test_astobj2 test_dlinklists test_acl test_aoc test_app test_ast_format_str_reduce test_devicestate test_event test_func_file test_gosub test_named_lock test_pbx test_stringfields test_strings test_substitution test_time test_utils test_amihooks test_locale test_logger test_security_events test_poll test_expr test_netsock2 test_db test_linkedlists test_config test_voicemail_api test_jitterbuf test_abstract_jb test_astobj2_thrash test_hashtab_thrash test_xml_escape test_callerid test_ari test_ari_model test_bucket test_cdr test_cel test_channel_feature_hooks test_core_codec test_core_format test_endpoints test_format_cache test_format_cap test_json test_message test_optional_api test_res_pjsip_scheduler test_res_stasis test_scoped_lock test_sorcery test_sorcery_astdb test_sorcery_realtime test_stasis test_stasis_channels test_stasis_endpoints test_taskprocessor test_threadpool test_uri test_uuid test_websocket_client test_vector test_sorcery_memory_cache_thrash +MENUSELECT_RES=res_config_sqlite res_timing_kqueue res_stasis_test res_mwi_external res_mwi_external_ami res_stasis_mailbox res_ari_mailboxes res_digium_phone res_resolver_unbound +MENUSELECT_TESTS=test_skel test_heap test_sched test_astobj2 test_dlinklists test_acl test_aoc test_app test_ast_format_str_reduce test_devicestate test_event test_func_file test_gosub test_named_lock test_pbx test_stringfields test_strings test_substitution test_time test_utils test_amihooks test_locale test_logger test_security_events test_poll test_expr test_netsock2 test_db test_linkedlists test_config test_voicemail_api test_jitterbuf test_abstract_jb test_astobj2_thrash test_hashtab_thrash test_xml_escape test_callerid test_ari test_ari_model test_bucket test_cdr test_cel test_channel_feature_hooks test_core_codec test_core_format test_endpoints test_format_cache test_format_cap test_json test_message test_optional_api test_res_pjsip_scheduler test_res_stasis test_scoped_lock test_sorcery test_sorcery_astdb test_sorcery_realtime test_stasis test_stasis_channels test_stasis_endpoints test_taskprocessor test_threadpool test_uri test_uuid test_websocket_client test_vector test_sorcery_memory_cache_thrash test_astobj2_weaken test_dns test_dns_naptr test_dns_query_set test_dns_recurring test_dns_srv test_file test_http_media_cache test_media_cache MENUSELECT_UTILS=aelparse astcanary astdb2sqlite3 astman check_expr check_expr2 conf2ael muted smsq stereorize streamplayer MENUSELECT_DEPSFAILED=MENUSELECT_APPS=app_osplookup -MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_h323 MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_nbs MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_vpb MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_radius