File: wrong_ctx_storage.vtc

package info (click to toggle)
haproxy 3.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 24,600 kB
  • sloc: ansic: 275,217; sh: 3,607; xml: 1,756; python: 1,345; makefile: 1,162; perl: 168; cpp: 21
file content (56 lines) | stat: -rw-r--r-- 1,572 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# commit 28962c9
# BUG/MAJOR: ssl: OpenSSL context is stored in non-reserved memory slot
#
# We never saw unexplicated crash with SSL, so I suppose that we are
# luck, or the slot 0 is always reserved. Anyway the usage of the macro
# SSL_get_app_data() and SSL_set_app_data() seem wrong. This patch change
# the deprecated functions SSL_get_app_data() and SSL_set_app_data()
# by the new functions SSL_get_ex_data() and SSL_set_ex_data(), and
# it reserves the slot in the SSL memory space.
#
# For information, this is the two declaration which seems wrong or
# incomplete in the OpenSSL ssl.h file. We can see the usage of the
# slot 0 whoch is hardcoded, but never reserved.
#
#    #define SSL_set_app_data(s,arg)     (SSL_set_ex_data(s,0,(char *)arg))
#    #define SSL_get_app_data(s)      (SSL_get_ex_data(s,0))

#REGTEST_TYPE=bug

varnishtest "OpenSSL bug: Random crashes"
#REQUIRE_OPTIONS=OPENSSL
feature ignore_unknown_macro


haproxy h1 -conf {
  global
    .if feature(THREAD)
        thread-groups 1
    .endif

  .if !ssllib_name_startswith(AWS-LC)
    tune.ssl.default-dh-param 2048
  .endif
    tune.ssl.capture-buffer-size 1

  defaults
    timeout client 30s
    timeout server 30s
    timeout connect 30s

  listen frt
    mode http
    bind "fd@${frt}" ssl crt ${testdir}/common.pem
    http-request redirect location /
} -start

shell {
    HOST=${h1_frt_addr}
    if [ "${h1_frt_addr}" = "::1" ] ; then
        HOST="\[::1\]"
    fi
    for i in 1 2 3 4 5; do
        curl -i -k https://$HOST:${h1_frt_port} & pids="$pids $!"
    done
    wait $pids
}