Debian Codegraph @

tests/sndrcv_tls_ossl_anon_ciphers.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # This file is part of the rsyslog project, released under ASL 2.0
3 . ${srcdir:=.}/diag.sh init
4 # start up the instances
5 # uncomment for debugging support:
6 #export RSYSLOG_DEBUG="debug nostdout noprintmutexaction"
7 #export RSYSLOG_DEBUGLOG="$RSYSLOG_DYNNAME.receiver.debuglog"
8 generate_conf
9 add_conf '
10 global(
11 defaultNetstreamDriver="ossl"
12 debug.whitelist="on"
13 debug.files=["net_ossl.c", "nsd_ossl.c", "tcpsrv.c", "nsdsel_ossl.c", "nsdpoll_ptcp.c", "dnscache.c"]
14 )
15
16 module( load="../plugins/imtcp/.libs/imtcp"
17 StreamDriver.Name="ossl"
18 StreamDriver.Mode="1"
19 StreamDriver.AuthMode="anon"
20 StreamDriver.PermitExpiredCerts="off"
21 gnutlsPriorityString="CipherString=ECDHE-RSA-AES256-SHA384;Ciphersuites=TLS_AES_256_GCM_SHA384"
22 )
23 input( type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port")
24
25 action(type="omfile" file="'$RSYSLOG_OUT_LOG'")
26 '
27
28 startup
29 export PORT_RCVR=$TCPFLOOD_PORT # save this, will be rewritten with next config
30 export RSYSLOG_DEBUGLOG="$RSYSLOG_DYNNAME.sender.debuglog"
31 generate_conf 2
32 add_conf '
33 global(
34 defaultNetstreamDriver="ossl"
35 )
36
37 action( type="omfwd"
38 protocol="tcp"
39 target="127.0.0.1"
40 port="'$PORT_RCVR'"
41 StreamDriverMode="1"
42 StreamDriverAuthMode="anon"
43 gnutlsPriorityString="CipherString=ECDHE-RSA-AES256-SHA384;Ciphersuites=TLS_AES_128_GCM_SHA256"
44 )
45 ' 2
46 startup 2
47
48 # now inject the messages into instance 2. It will connect to instance 1,
49 # and that instance will record the data.
50 injectmsg 0 1
51 shutdown_when_empty 2
52 wait_shutdown 2
53 # now it is time to stop the receiver as well
54 shutdown_when_empty
55 wait_shutdown
56
57 # IMPORTANT: this test will generate many error messages. This is exactly it's
58 # intent. So do not think something is wrong. The content_check below checks
59 # these error codes.
60
61 content_check --check-only "TLS library does not support SSL_CONF_cmd"
62 ret=$?
63 if [scip-shell system . . `[`. $ret == 0 ]; then
64 echoscip-shell system . . echo. "SKIP: TLS library does not support SSL_CONF_cmd"
65 skip_test
66 else
67 # Kindly check for a failed session
68 content_check "OpenSSL Error Stack"
69 content_check "no shared cipher"
70 fi
71
72 exit_test