diff --git a/testssl.sh b/testssl.sh index 043d7b0..0c843d3 100755 --- a/testssl.sh +++ b/testssl.sh @@ -11566,7 +11566,7 @@ run_npn() { if "$HAS_NPN"; then # TLS 1.3 s_client doesn't support -nextprotoneg when connecting with TLS 1.3. So we need to make sure it won't be used # TLS13_ONLY is tested here again, just to be sure, see npn_pre - if "$HAS_TLS13" && ! $TLS13_ONLY ]] ; then + if "$HAS_TLS13" && ! "$TLS13_ONLY"; then proto="-no_tls1_3" fi $OPENSSL s_client $(s_client_options "$proto -connect $NODEIP:$PORT $BUGS $SNI -nextprotoneg "$NPN_PROTOs"") $ERRFILE >$TMPFILE @@ -18666,7 +18666,7 @@ run_freak() { return 0 ;; 1|2|3) - addtl_warning=" ($magenta""tested only with $nr_supported_ciphers out of 9 ciphers only!$off)" ;; + addtl_warning=" (tested only with $nr_supported_ciphers out of 9 ciphers only!)" ;; 4|5|6|7) addtl_warning=" (tested with $nr_supported_ciphers/9 ciphers)" ;; 8|9|10|11) @@ -18704,7 +18704,12 @@ run_freak() { pr_svrty_critical "VULNERABLE (NOT ok)"; out ", uses EXPORT RSA ciphers" fileout "$jsonID" "CRITICAL" "VULNERABLE, uses EXPORT RSA ciphers" "$cve" "$cwe" "$hint" else - pr_svrty_best "not vulnerable (OK)"; out "$addtl_warning" + pr_svrty_best "not vulnerable (OK)" + if [[ -n "$addtl_warning" ]] && [[ $nr_supported_ciphers -le 3 ]]; then + out " ("; pr_warning "${addtl_warning:2:-1}"; out ")" + else + out "$addtl_warning" + fi fileout "$jsonID" "OK" "not vulnerable $addtl_warning" "$cve" "$cwe" fi outln @@ -18867,7 +18872,7 @@ run_logjam() { out "$spaces" openssl_no_expdhciphers=true ;; - 1|2|3) addtl_warning=" ($magenta""tested w/ $nr_supported_ciphers/4 ciphers only!$off)" ;; + 1|2|3) addtl_warning=" (tested w/ $nr_supported_ciphers/4 ciphers only!)" ;; 4) ;; esac fi @@ -18973,16 +18978,16 @@ run_logjam() { out_common_prime "$jsonID2" "$cve" "$cwe" if ! "$openssl_no_expdhciphers"; then outln "," - out "${spaces}but no DH EXPORT ciphers${addtl_warning}" + out "${spaces}but no DH EXPORT ciphers" fileout "$jsonID" "OK" "not vulnerable, no DH EXPORT ciphers,$addtl_warning" "$cve" "$cwe" fi elif [[ $subret -eq 3 ]]; then - pr_svrty_good "not vulnerable (OK):"; out " no DH EXPORT ciphers${addtl_warning}" + pr_svrty_good "not vulnerable (OK):"; out " no DH EXPORT ciphers" fileout "$jsonID" "OK" "not vulnerable, no DH EXPORT ciphers,$addtl_warning" "$cve" "$cwe" out ", no DH key detected with <= TLS 1.2" fileout "$jsonID2" "OK" "no DH key with <= TLS 1.2" "$cve" "$cwe" elif [[ $subret -eq 0 ]]; then - pr_svrty_good "not vulnerable (OK):"; out " no DH EXPORT ciphers${addtl_warning}" + pr_svrty_good "not vulnerable (OK):"; out " no DH EXPORT ciphers" fileout "$jsonID" "OK" "not vulnerable, no DH EXPORT ciphers,$addtl_warning" "$cve" "$cwe" # we issue a special warning if there's no common prime but the bit length is too low if [[ $DH_GROUP_LEN_P -le 1024 ]]; then @@ -18998,9 +19003,12 @@ run_logjam() { fileout "$jsonID2" "OK" "--" "$cve" "$cwe" fi elif [[ $ret -eq 1 ]]; then - pr_svrty_good "partly not vulnerable:"; out " no DH EXPORT ciphers${addtl_warning}" + pr_svrty_good "partly not vulnerable:"; out " no DH EXPORT ciphers" fileout "$jsonID" "OK" "not vulnerable, no DH EXPORT ciphers,$addtl_warning" "$cve" "$cwe" fi + if [[ -n "$addtl_warning" ]]; then + out " ("; pr_warning "${addtl_warning:2:-1}"; out ")" + fi fi [[ $DH_GROUP_LEN_P -gt 0 ]] && set_key_str_score "DHE" $DH_GROUP_LEN_P @@ -22339,7 +22347,7 @@ determine_rdns() { # circumstances (see #1506) can show up here. The blacklist is taken from RFC 1912 ("Allowable characters in a # label for a host name are only ASCII, letters, digits, and the `-' character") while read -r line; do - line="$(tr -dc '[a-zA-Z0-9-_.]' <<< "$line")" + line="$(tr -dc 'a-zA-Z0-9-_.' <<< "$line")" [[ -z "$rdns" ]] && rdns="$line" || rdns="$rdns $line" done <<< "$rDNS" rDNS="$rdns"