Browse code

add test case(s) to notice 'openvpn --show-cipher' crashing

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20211210165543.77587-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23381.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Gert Doering authored on 2021/12/11 01:55:43
Showing 1 changed files
... ...
@@ -35,13 +35,18 @@ CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \
35 35
 # GD, 2014-07-06 do not test RC5-* either (fails on NetBSD w/o libcrypto_rc5)
36 36
 CIPHERS=$(echo "$CIPHERS" | egrep -v '^(DES-EDE3-CFB1|DES-CFB1|RC5-)' )
37 37
 
38
+e=0
39
+if [ -z "$CIPHERS" ] ; then
40
+    echo "'openvpn --show-ciphers' FAILED (empty list)"
41
+    e=1
42
+fi
43
+
38 44
 # Also test cipher 'none'
39 45
 CIPHERS=${CIPHERS}$(printf "\nnone")
40 46
 
41 47
 "${top_builddir}/src/openvpn/openvpn" --genkey secret key.$$
42 48
 set +e
43 49
 
44
-e=0
45 50
 for cipher in ${CIPHERS}
46 51
 do
47 52
     printf "Testing cipher ${cipher}... "