Module: kamailio Branch: master Commit: 4d6e37fa048a1aaa2d2fc6655985b4bcb9754258 URL: https://github.com/kamailio/kamailio/commit/4d6e37fa048a1aaa2d2fc6655985b4bc...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2024-02-06T14:24:08+01:00
core: added tls_threads_mode global parameter
- control how to execute functions that may be using libssl3 behind
---
Modified: src/core/cfg.lex Modified: src/core/cfg.y Modified: src/core/globals.h Modified: src/main.c
---
Diff: https://github.com/kamailio/kamailio/commit/4d6e37fa048a1aaa2d2fc6655985b4bc... Patch: https://github.com/kamailio/kamailio/commit/4d6e37fa048a1aaa2d2fc6655985b4bc...
---
diff --git a/src/core/cfg.lex b/src/core/cfg.lex index be4467efa88..aa998d37985 100644 --- a/src/core/cfg.lex +++ b/src/core/cfg.lex @@ -442,6 +442,7 @@ TCP_WAIT_DATA "tcp_wait_data" TCP_SCRIPT_MODE "tcp_script_mode" DISABLE_TLS "disable_tls"|"tls_disable" ENABLE_TLS "enable_tls"|"tls_enable" +TLS_THREADS_MODE "tls_threads_mode" TLSLOG "tlslog"|"tls_log" TLS_PORT_NO "tls_port_no" TLS_METHOD "tls_method" @@ -960,6 +961,7 @@ IMPORTFILE "import_file" <INITIAL>{TCP_SCRIPT_MODE} { count(); yylval.strval=yytext; return TCP_SCRIPT_MODE; } <INITIAL>{DISABLE_TLS} { count(); yylval.strval=yytext; return DISABLE_TLS; } <INITIAL>{ENABLE_TLS} { count(); yylval.strval=yytext; return ENABLE_TLS; } +<INITIAL>{TLS_THREADS_MODE} { count(); yylval.strval=yytext; return TLS_THREADS_MODE; } <INITIAL>{TLSLOG} { count(); yylval.strval=yytext; return TLS_PORT_NO; } <INITIAL>{TLS_PORT_NO} { count(); yylval.strval=yytext; return TLS_PORT_NO; } <INITIAL>{TLS_METHOD} { count(); yylval.strval=yytext; return TLS_METHOD; } diff --git a/src/core/cfg.y b/src/core/cfg.y index c357faa927d..799c95697df 100644 --- a/src/core/cfg.y +++ b/src/core/cfg.y @@ -472,6 +472,7 @@ extern char *default_routename; %token TCP_SCRIPT_MODE %token DISABLE_TLS %token ENABLE_TLS +%token TLS_THREADS_MODE %token TLSLOG %token TLS_PORT_NO %token TLS_METHOD @@ -1467,6 +1468,14 @@ assign_stm: #endif } | ENABLE_TLS EQUAL error { yyerror("boolean value expected"); } + | TLS_THREADS_MODE EQUAL NUMBER { + #ifdef USE_TLS + ksr_tls_threads_mode = $3; + #else + warn("tls support not compiled in"); + #endif + } + | TLS_THREADS_MODE EQUAL error { yyerror("int value expected"); } | TLSLOG EQUAL NUMBER { #ifdef CORE_TLS tls_log=$3; diff --git a/src/core/globals.h b/src/core/globals.h index f8b77edb328..0ec87c89a12 100644 --- a/src/core/globals.h +++ b/src/core/globals.h @@ -109,6 +109,7 @@ extern int ksr_tcp_script_mode; #ifdef USE_TLS extern int tls_disable; extern unsigned short tls_port_no; +extern int ksr_tls_threads_mode; #endif #ifdef USE_SCTP extern int sctp_disable; diff --git a/src/main.c b/src/main.c index fc1570c3b7a..1856bf7bc03 100644 --- a/src/main.c +++ b/src/main.c @@ -338,8 +338,9 @@ int tcp_disable = 0; /* 1 if tcp is disabled */ int tls_disable = 0; /* tls enabled by default */ #else int tls_disable = 1; /* tls disabled by default */ -#endif /* CORE_TLS */ -#endif /* USE_TLS */ +#endif /* CORE_TLS */ +int ksr_tls_threads_mode = 0; /* threads execution mode for tls with libssl */ +#endif /* USE_TLS */ #ifdef USE_SCTP int sctp_children_no = 0; int sctp_disable = 2; /* 1 if sctp is disabled, 2 if auto mode, 0 enabled */