Skip to content

Commit 1b17a2c

Browse files
committed
Fix shellcheck warnings
1 parent 54dcecd commit 1b17a2c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

utils/00_unittest_baseline.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $OPENSSL version -a || exit 1
88
FILE=tmp.json
99

1010
remove_quotes() {
11-
sed -i 's/"//g' $FILE
11+
sed -i 's/"//g' "$FILE"
1212
}
1313

1414
# arg1: id_value
@@ -27,7 +27,7 @@ check_result() {
2727
local finding_value=""
2828

2929
remove_quotes
30-
json_result="$(awk '/id.*'"${1}"'/,/finding.*$/' $FILE)"
30+
json_result="$(awk '/id.*'"${1}"'/,/finding.*$/' "$FILE")"
3131
[[ -z $json_result ]] && exit 1
3232
# is4lines?
3333
finding_value="$(awk -F':' '/finding/ { print $2" "$3" "$4 }' <<< "$json_result")"
@@ -50,9 +50,9 @@ echo
5050
### 1) test protocol SSlv2:
5151
$OPENSSL s_server -www -ssl2 -key /tmp/server.pem -cert /tmp/server.crt &>/dev/null &
5252
pid=$!
53-
rm $FILE 2>/dev/null
53+
rm "$FILE" 2>/dev/null
5454
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
5656
check_result SSLv2 CRITICAL "vulnerable with 9 ciphers"
5757
[[ $? -eq 0 ]] && echo "SSLv2: PASSED" || echo "FAILED"
5858
echo
@@ -62,9 +62,9 @@ wait $pid 2>/dev/null
6262
### 2) test NPN + ALPN
6363
$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 &
6464
pid=$!
65-
rm $FILE
65+
rm "$FILE"
6666
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
6868
if check_result NPN "spdy/3, http/1.1"; then
6969
echo "SPDY/NPN: PASSED"
7070
else
@@ -78,19 +78,19 @@ else
7878
fi
7979
kill -9 $pid
8080
wait $pid 2>/dev/null
81-
rm $FILE
81+
rm "$FILE"
8282

8383
### 3) test almost all other stuff
8484
$OPENSSL s_server -cipher 'ALL:COMPLEMENTOFALL' -www -key /tmp/server.pem -cert /tmp/server.crt &>/dev/null &
8585
pid=$!
86-
rm $FILE
86+
rm "$FILE"
8787
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
8989
#check_result sslv2 CRITICAL "is offered"
9090
kill -9 $pid
9191
wait $pid 2>/dev/null
9292

93-
rm $FILE
93+
rm "$FILE"
9494

9595

9696
### test server defaults

0 commit comments

Comments
 (0)