Module: kamailio
Branch: 5.3
Commit: 3c11a405344af55aa4b9c8d35e1c181473cbdf42
URL: https://github.com/kamailio/kamailio/commit/3c11a405344af55aa4b9c8d35e1c181…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-10-07T10:52:03+02:00
tls: docs for rand_engine parameter
(cherry picked from commit 787b95a5a0573d4e81b2475a84bad59076e34faf)
---
Modified: src/modules/tls/doc/params.xml
---
Diff: https://github.com/kamailio/kamailio/commit/3c11a405344af55aa4b9c8d35e1c181…
Patch: https://github.com/kamailio/kamailio/commit/3c11a405344af55aa4b9c8d35e1c181…
---
diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml
index 6ef2d4123f..6028642b5f 100644
--- a/src/modules/tls/doc/params.xml
+++ b/src/modules/tls/doc/params.xml
@@ -1241,6 +1241,39 @@ end
</example>
</section>
+ <section id="tls.p.rand_engine">
+ <title><varname>rand_engine</varname> (str)</title>
+ <para>
+ Set the ranondom number generator engine for libssl.
+ </para>
+ <para>
+ Note: the default random number generator (PRNG) engine of libssl v1.1.x
+ is not designed for multi-process applications and can result in a crash.
+ Therefore set the PRNG engine to one of the options listed in this
+ section. If libssl 1.1.x (or newer) is detected at compile time, then
+ the PRNG engine is set to "fastrand".
+ </para>
+ <para>
+ The following options are avaialble:
+ </para>
+ <itemizedlist>
+ <listitem><para>krand - use internal kam_rand() function</para></listitem>
+ <listitem><para>fastrand - use internal fastrand function</para></listitem>
+ </itemizedlist>
+ <para>
+ The default value is empty (not set) for libssl v1.0.x or older, and
+ "fastrand" for libssl v1.1.x or newer.
+ </para>
+ <example>
+ <title>Set <varname>rand_engine</varname> parameter</title>
+ <programlisting>
+...
+modparam("tls", "rand_engine", "fastrand")
+...
+ </programlisting>
+ </example>
+ </section>
+
<section id="tls.p.engine">
<title><varname>engine</varname> (string)</title>
<para>
Module: kamailio
Branch: 5.2
Commit: 254d66b0a1b88ba91dabffc3b55a0b10430a18e1
URL: https://github.com/kamailio/kamailio/commit/254d66b0a1b88ba91dabffc3b55a0b1…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2019-10-07T11:01:53+02:00
modules: readme files regenerated - modules ... [skip ci]
---
Modified: src/modules/db_cassandra/README
---
Diff: https://github.com/kamailio/kamailio/commit/254d66b0a1b88ba91dabffc3b55a0b1…
Patch: https://github.com/kamailio/kamailio/commit/254d66b0a1b88ba91dabffc3b55a0b1…
---
diff --git a/src/modules/db_cassandra/README b/src/modules/db_cassandra/README
index 99cb2bac5b..443f91f1fc 100644
--- a/src/modules/db_cassandra/README
+++ b/src/modules/db_cassandra/README
@@ -61,6 +61,13 @@ Chapter 1. Admin Guide
1. Overview
+ Note: the module requires old version of external library, not
+ compiling with those available out of the stock in the Linux
+ distributions. It is going to be kept for a while in case someone wants
+ to pick it up and upgrade. Also, the module was never extensively
+ tested, therefore take the appropriate actions in case you plan to use
+ it.
+
Db_cassandra is one of the Kamailio database modules. It does not
export any functions executable from the configuration scripts, but it
exports a subset of functions using the database API, and thus, other
### Description
After the upgrade of our system to Debian Buster, kamailio started crashing due to TLS module. The issue look similar to the one described in https://github.com/kamailio/kamailio/issues/1860
In Debian Stretch everything was working fine because we compiled kamailio using openssl-1.0 as suggested in the linked issue. Unfortunately Debian Buster doesn't support that old version of the package so we compiled it with openssl-1.1 and we put in place the workaround suggested here https://github.com/kamailio/kamailio/commit/efdc141ecb5ff72e3224e47deaaa79f… but this didn't solved the issue.
#### Debugging Data
At the moment I don have full access to the system so I can provide only the following backtrace:
(gdb) bt full
#0 aesni_ecb_encrypt () at crypto/aes/aesni-x86_64.s:624
No locals.
0000001 0x00007fe7b2159917 in aesni_ecb_cipher (len=16, in=0x7fe7ae3052d0 "\271a\321\064vGKiB\337\344\070\353\220\005\245\020O", <incomplete sequence \323>,
out=0x7fe7ae58d068 "", ctx=0x7fe7ae3053b8) at ../crypto/evp/e_aes.c:319
bl = <optimized out>
bl = <optimized out>
#2 aesni_ecb_cipher (ctx=0x7fe7ae3053b8, out=0x7fe7ae58d068 "", in=0x7fe7ae3052d0 "\271a\321\064vGKiB\337\344\070\353\220\005\245\020O", <incomplete sequence \323>,
len=16) at ../crypto/evp/e_aes.c:311
bl = <optimized out>
0000003 0x00007fe7b2165533 in evp_EncryptDecryptUpdate (ctx=0x7fe7ae3053b8, out=0x7fe7ae58d068 "", outl=0x7fff207dc534,
in=0x7fe7ae3052d0 "\271a\321\064vGKiB\337\344\070\353\220\005\245\020O", <incomplete sequence \323>, inl=16) at ../crypto/evp/evp_enc.c:333
i = <optimized out>
j = <optimized out>
bl = 16
cmpl = <optimized out>
#4 0x00007fe7b219830f in drbg_ctr_generate (drbg=0x7fe7ae3051e8, out=0x7fe7ae58d068 "", outlen=32, adin=0x0, adinlen=0) at ../crypto/rand/drbg_ctr.c:340
outl = 16
ctr = 0x7fe7ae305290
#5 0x00007fe7b21991fb in RAND_DRBG_generate (drbg=drbg@entry=0x7fe7ae3051e8, out=out@entry=0x7fe7ae58d068 "", outlen=outlen@entry=32,
prediction_resistance=prediction_resistance@entry=0, adin=0x0, adinlen=adinlen@entry=0) at ../crypto/rand/drbg_lib.c:638
reseed_required = <optimized out>
#6 0x00007fe7b2199481 in RAND_DRBG_bytes (drbg=0x7fe7ae3051e8, out=0x7fe7ae58d068 "", outlen=32) at ../crypto/rand/drbg_lib.c:679
additional = 0x0
additional_len = 0
chunk = 32
ret = <optimized out>
0000007 0x00007fe7b22f96fd in ssl_fill_hello_random (s=s@entry=0x7fe7ae588de0, server=server@entry=0, result=0x7fe7ae58d068 "", len=len@entry=32,
dgrd=dgrd@entry=DOWNGRADE_NONE) at ../ssl/s3_lib.c:4589
send_time = <optimized out>
ret = <optimized out>
#8 0x00007fe7b231b06e in tls_construct_client_hello (s=0x7fe7ae588de0, pkt=0x7fff207dc700) at ../ssl/statem/statem_clnt.c:1153
p = <optimized out>
sess_id_len = <optimized out>
i = <optimized out>
protverr = 0
comp = <optimized out>
sess = 0x0
session_id = <optimized out>
0000009 0x00007fe7b231a33f in write_state_machine (s=0x7fe7ae588de0) at ../ssl/statem/statem.c:843
post_work = 0x7fe7b231f5a0 <ossl_statem_client_post_work>
mt = 1
pkt = {buf = 0x7fe7ae59fc90, staticbuf = 0x0, curr = 4, written = 4, maxsize = 18446744073709551615, subs = 0x7fe7ae58be30}
ret = <optimized out>
pre_work = 0x7fe7b231d180 <ossl_statem_client_pre_work>
--Type <RET> for more, q to quit, c to continue without paging--
get_construct_message_f = 0x7fe7b231d250 <ossl_statem_client_construct_message>
confunc = 0x7fe7b231ad20 <tls_construct_client_hello>
st = 0x7fe7ae588e28
transition = 0x7fe7b231cde0 <ossl_statem_client_write_transition>
cb = 0x7fe7b2375fb0
st = <optimized out>
ret = <optimized out>
transition = <optimized out>
pre_work = <optimized out>
post_work = <optimized out>
get_construct_message_f = <optimized out>
cb = <optimized out>
confunc = <optimized out>
mt = <optimized out>
pkt = <optimized out>
#10 state_machine (s=0x7fe7ae588de0, server=0) at ../ssl/statem/statem.c:443
buf = 0x0
cb = 0x7fe7b2375fb0
st = <optimized out>
ret = <optimized out>
ssret = <optimized out>
0000011 0x00007fe7b2306264 in SSL_do_handshake (s=0x7fe7ae588de0) at ../ssl/ssl_lib.c:3599
ret = 1
#12 0x00007fe7b23a40b4 in tls_connect () from /usr/lib/x86_64-linux-gnu/kamailio/modules/tls.so
No symbol table info available.
0000013 0x00007fe7b23a568d in tls_encode_f () from /usr/lib/x86_64-linux-gnu/kamailio/modules/tls.so
No symbol table info available.
#14 0x000055f60cceaf7e in tcp_send ()
No symbol table info available.
0000015 0x00007fe7b4e65920 in send_pr_buffer () from /usr/lib/x86_64-linux-gnu/kamailio/modules/tm.so
No symbol table info available.
#16 0x00007fe7b4e826e8 in t_send_branch () from /usr/lib/x86_64-linux-gnu/kamailio/modules/tm.so
No symbol table info available.
0000017 0x00007fe7b4e85adf in t_forward_nonack () from /usr/lib/x86_64-linux-gnu/kamailio/modules/tm.so
No symbol table info available.
#18 0x00007fe7b4e69452 in t_relay_to () from /usr/lib/x86_64-linux-gnu/kamailio/modules/tm.so
No symbol table info available.
#19 0x00007fe7b4e340ea in ?? () from /usr/lib/x86_64-linux-gnu/kamailio/modules/tm.so
No symbol table info available.
#20 0x000055f60cc50f29 in do_action ()
No symbol table info available.
0000021 0x000055f60cc4fa1a in run_actions ()
No symbol table info available.
#22 0x000055f60cc517e2 in do_action ()
--Type <RET> for more, q to quit, c to continue without paging--
No symbol table info available.
0000023 0x000055f60cc4fa1a in run_actions ()
No symbol table info available.
#24 0x000055f60cc5154f in do_action ()
No symbol table info available.
0000025 0x000055f60cc4fa1a in run_actions ()
No symbol table info available.
#26 0x000055f60cc5d46f in run_top_route ()
No symbol table info available.
0000027 0x000055f60cd594cf in receive_msg ()
No symbol table info available.
#28 0x000055f60cc7ab45 in udp_rcv_loop ()
No symbol table info available.
0000029 0x000055f60cc0febb in main_loop ()
No symbol table info available.
#30 0x000055f60cc07415 in main ()
No symbol table info available.
(gdb)
### Additional Information
Kamailio version 5.2.3
Debian Buster 10.1
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2077
Module: kamailio
Branch: master
Commit: d0743460f68c0dfcb807319dc9e2247eb51ee1ba
URL: https://github.com/kamailio/kamailio/commit/d0743460f68c0dfcb807319dc9e2247…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-10-07T10:49:16+02:00
tls: add cryptorand engine also to tls_mod and documentation, enable as default
---
Modified: src/modules/tls/doc/params.xml
Modified: src/modules/tls/tls_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/d0743460f68c0dfcb807319dc9e2247…
Patch: https://github.com/kamailio/kamailio/commit/d0743460f68c0dfcb807319dc9e2247…
---
diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml
index 6028642b5f..72d3278ed7 100644
--- a/src/modules/tls/doc/params.xml
+++ b/src/modules/tls/doc/params.xml
@@ -1251,7 +1251,7 @@ end
is not designed for multi-process applications and can result in a crash.
Therefore set the PRNG engine to one of the options listed in this
section. If libssl 1.1.x (or newer) is detected at compile time, then
- the PRNG engine is set to "fastrand".
+ the PRNG engine is set to "cryptorand".
</para>
<para>
The following options are avaialble:
@@ -1259,10 +1259,13 @@ end
<itemizedlist>
<listitem><para>krand - use internal kam_rand() function</para></listitem>
<listitem><para>fastrand - use internal fastrand function</para></listitem>
+ <listitem><para>cryptorand - use internal cryptorand function</para></listitem>
</itemizedlist>
<para>
The default value is empty (not set) for libssl v1.0.x or older, and
- "fastrand" for libssl v1.1.x or newer.
+ "cryptorand" for libssl v1.1.x or newer. The krand and fastrand engines are
+ not recommended for production use, as they will not generate secure enough
+ random numbers.
</para>
<example>
<title>Set <varname>rand_engine</varname> parameter</title>
diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c
index 75d8aa8fd2..5784ce4842 100644
--- a/src/modules/tls/tls_mod.c
+++ b/src/modules/tls/tls_mod.c
@@ -453,6 +453,9 @@ int ksr_rand_engine_param(modparam_t type, void* val)
} else if(reng->len == 8 && strncasecmp(reng->s, "fastrand", 8) == 0) {
LM_DBG("setting fastrand random engine\n");
RAND_set_rand_method(RAND_ksr_fastrand_method());
+ } else if (reng->len == 10 && strncasecmp(reng->s, "cryptorand", 10) == 0) {
+ LM_DBG("setting cryptorand random engine\n");
+ RAND_set_rand_method(RAND_ksr_cryptorand_method());
}
#endif
return 0;
@@ -564,7 +567,7 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2)
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
LM_DBG("setting fastrand random engine\n");
- RAND_set_rand_method(RAND_ksr_fastrand_method());
+ RAND_set_rand_method(RAND_ksr_cryptorand_method());
#endif
sr_kemi_modules_add(sr_kemi_tls_exports);