Skip to content

Commit 2baaf61

Browse files
authored
Merge pull request #2657 from dcooper16/fix_pattern_match
Fix pattern matches
2 parents f085fd1 + acf4897 commit 2baaf61

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

testssl.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3370,7 +3370,7 @@ run_cookie_flags() { # ARG1: Path
33703370
fi
33713371

33723372
if [[ ! "$HTTP_STATUS_CODE" =~ 20 ]]; then
3373-
if [[ "$HTTP_STATUS_CODE" =~ [301|302] ]]; then
3373+
if [[ "$HTTP_STATUS_CODE" =~ 301|302 ]]; then
33743374
msg302=" -- maybe better try target URL of 30x"
33753375
msg302_=" (30x detected, better try target URL of 30x)"
33763376
else
@@ -11323,7 +11323,7 @@ run_npn() {
1132311323
fileout "$jsonID" "INFO" "not offered"
1132411324
else
1132511325
# now comes a strange thing: "Protocols advertised by server:" is empty but connection succeeded
11326-
if [[ "$tmpstr" =~ [h2|spdy|http] ]]; then
11326+
if [[ "$tmpstr" =~ h2|spdy|http ]]; then
1132711327
out "$tmpstr"
1132811328
outln " (advertised)"
1132911329
fileout "$jsonID" "INFO" "offered with $tmpstr (advertised)"
@@ -16865,7 +16865,7 @@ run_ccs_injection(){
1686516865
fileout "$jsonID" "OK" "not vulnerable" "$cve" "$cwe"
1686616866
fi
1686716867
elif [[ "${tls_hello_ascii:0:4}" == "1503" ]]; then
16868-
if [[ ! "${tls_hello_ascii:5:2}" =~ [03|02|01|00] ]]; then
16868+
if [[ ! "${tls_hello_ascii:5:2}" =~ 03|02|01|00 ]]; then
1686916869
pr_warning "test failed "
1687016870
out "no proper TLS reply (debug info: protocol sent: 1503${tls_hexcode#x03, x}, reply: ${tls_hello_ascii:0:14}"
1687116871
fileout "$jsonID" "DEBUG" "test failed, around line $LINENO, debug info (${tls_hello_ascii:0:14})" "$cve" "$cwe" "$hint"

0 commit comments

Comments
 (0)