@@ -8,7 +8,7 @@ $OPENSSL version -a || exit 1
8
8
FILE=tmp.json
9
9
10
10
remove_quotes () {
11
- sed -i ' s/"//g' $FILE
11
+ sed -i ' s/"//g' " $FILE "
12
12
}
13
13
14
14
# arg1: id_value
@@ -27,7 +27,7 @@ check_result() {
27
27
local finding_value=" "
28
28
29
29
remove_quotes
30
- json_result=" $( awk ' /id.*' " ${1} " ' /,/finding.*$/' $FILE ) "
30
+ json_result=" $( awk ' /id.*' " ${1} " ' /,/finding.*$/' " $FILE " ) "
31
31
[[ -z $json_result ]] && exit 1
32
32
# is4lines?
33
33
finding_value=" $( awk -F' :' ' /finding/ { print $2" "$3" "$4 }' <<< " $json_result" ) "
50
50
# ## 1) test protocol SSlv2:
51
51
$OPENSSL s_server -www -ssl2 -key /tmp/server.pem -cert /tmp/server.crt & > /dev/null &
52
52
pid=$!
53
- rm $FILE 2> /dev/null
53
+ rm " $FILE " 2> /dev/null
54
54
echo " Running testssl.sh SSLv2 protocol check against localhost for SSLv2: "
55
- ./testssl.sh -p -q --warnings=off --jsonfile=$FILE localhost:4433
55
+ ./testssl.sh -p -q --warnings=off --jsonfile=" $FILE " localhost:4433
56
56
check_result SSLv2 CRITICAL " vulnerable with 9 ciphers"
57
57
[[ $? -eq 0 ]] && echo " SSLv2: PASSED" || echo " FAILED"
58
58
echo
@@ -62,9 +62,9 @@ wait $pid 2>/dev/null
62
62
# ## 2) test NPN + ALPN
63
63
$OPENSSL s_server -cipher ' ALL:COMPLEMENTOFALL' -alpn " h2" -nextprotoneg " spdy/3, http/1.1" -www -key /tmp/server.pem -cert /tmp/server.crt & > /dev/null &
64
64
pid=$!
65
- rm $FILE
65
+ rm " $FILE "
66
66
echo " Running testssl.sh HTTP/2 protocol checks against localhost: "
67
- ./testssl.sh -q --jsonfile=$FILE --protocols localhost:4433
67
+ ./testssl.sh -q --jsonfile=" $FILE " --protocols localhost:4433
68
68
if check_result NPN " spdy/3, http/1.1" ; then
69
69
echo " SPDY/NPN: PASSED"
70
70
else
78
78
fi
79
79
kill -9 $pid
80
80
wait $pid 2> /dev/null
81
- rm $FILE
81
+ rm " $FILE "
82
82
83
83
# ## 3) test almost all other stuff
84
84
$OPENSSL s_server -cipher ' ALL:COMPLEMENTOFALL' -www -key /tmp/server.pem -cert /tmp/server.crt & > /dev/null &
85
85
pid=$!
86
- rm $FILE
86
+ rm " $FILE "
87
87
echo " Running baseline check with testssl.sh against localhost"
88
- ./testssl.sh -q --jsonfile=$FILE localhost:4433
88
+ ./testssl.sh -q --jsonfile=" $FILE " localhost:4433
89
89
# check_result sslv2 CRITICAL "is offered"
90
90
kill -9 $pid
91
91
wait $pid 2> /dev/null
92
92
93
- rm $FILE
93
+ rm " $FILE "
94
94
95
95
96
96
# ## test server defaults
0 commit comments