blob: 30030e3617a2a254fb9277e1dd6a8e393acfe329 [file] [log] [blame]
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +02001# commit 28962c9
2# BUG/MAJOR: ssl: OpenSSL context is stored in non-reserved memory slot
3#
4# We never saw unexplicated crash with SSL, so I suppose that we are
5# luck, or the slot 0 is always reserved. Anyway the usage of the macro
6# SSL_get_app_data() and SSL_set_app_data() seem wrong. This patch change
7# the deprecated functions SSL_get_app_data() and SSL_set_app_data()
8# by the new functions SSL_get_ex_data() and SSL_set_ex_data(), and
9# it reserves the slot in the SSL memory space.
10#
11# For information, this is the two declaration which seems wrong or
12# incomplete in the OpenSSL ssl.h file. We can see the usage of the
13# slot 0 whoch is hardcoded, but never reserved.
14#
15# #define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg))
16# #define SSL_get_app_data(s) (SSL_get_ex_data(s,0))
17
18
19varnishtest "OpenSSL bug: Random crashes"
20feature ignore_unknown_macro
21
22
23haproxy h1 -conf {
24 global
25 tune.ssl.default-dh-param 2048
26 tune.ssl.capture-cipherlist-size 1
27
28 listen frt
29 mode http
Christopher Faulet8f161482018-12-19 11:49:39 +010030 ${no-htx} option http-use-htx
Frédéric Lécaille9b53b4c2018-06-20 07:26:44 +020031 bind "fd@${frt}" ssl crt ${testdir}/common.pem
32 http-request redirect location /
33} -start
34
Frédéric Lécaille49076c32018-07-12 10:48:06 +020035shell {
36 HOST=${h1_frt_addr}
37 if [ "${h1_frt_addr}" = "::1" ] ; then
Frédéric Lécaillefaf4aac2018-07-13 10:44:12 +020038 HOST="\[::1\]"
Frédéric Lécaille49076c32018-07-12 10:48:06 +020039 fi
40 for i in 1 2 3 4 5; do
41 curl -i -k https://$HOST:${h1_frt_port} & pids="$pids $!"
42 done
43 wait $pids
44}