From e2942966d2dc83f4a809cd82711dbfcbe577994c Mon Sep 17 00:00:00 2001 From: David Cooper Date: Fri, 25 Nov 2022 07:44:48 -0800 Subject: [PATCH] Fix whitespace issues This commit fixes incorrect indentations introduced in #2276 and #2278, and also removes the extra whitespace that would have been removed by #2279. --- testssl.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/testssl.sh b/testssl.sh index 68914e5..d0a952c 100755 --- a/testssl.sh +++ b/testssl.sh @@ -874,22 +874,22 @@ strip_quote() ( # Converts a string containing PEM encoded data to one line. pem_to_one_line() { - local pem="$1" - local header="" footer="" + local pem="$1" + local header="" footer="" - if [[ "$pem" =~ .*-+BEGIN\ [A-Za-z0-9]+-+ ]]; then - header="$BASH_REMATCH" - pem="${pem/$header/}" - fi - if [[ "$pem" =~ -+END\ [A-Za-z0-9]+-+.* ]]; then - footer="$BASH_REMATCH" - pem="${pem/$footer/}" - fi - pem="$(strip_spaces "$(newline_to_spaces "$pem")")" - [[ -n "$header" ]] && pem="$header\\\n$pem" - [[ -n "$footer" ]] && pem+="\\\n$footer" - printf -- "%s" "$pem" - return 0 + if [[ "$pem" =~ .*-+BEGIN\ [A-Za-z0-9]+-+ ]]; then + header="$BASH_REMATCH" + pem="${pem/$header/}" + fi + if [[ "$pem" =~ -+END\ [A-Za-z0-9]+-+.* ]]; then + footer="$BASH_REMATCH" + pem="${pem/$footer/}" + fi + pem="$(strip_spaces "$(newline_to_spaces "$pem")")" + [[ -n "$header" ]] && pem="$header\\\n$pem" + [[ -n "$footer" ]] && pem+="\\\n$footer" + printf -- "%s" "$pem" + return 0 } is_ipv4addr() { @@ -4562,7 +4562,7 @@ ciphers_by_strength() { ;; esac fi - + [[ $difference_rating -lt $NO_CIPHER_ORDER_LEVEL ]] && NO_CIPHER_ORDER_LEVEL=$difference_rating id="cipher_order${proto}" case $difference_rating in @@ -4573,7 +4573,7 @@ ciphers_by_strength() { 4) prln_svrty_low " (no server order, thus listed by strength)" fileout "$id" "LOW" "NOT a cipher order configured" - ;; + ;; 3) prln_svrty_medium " (no server order, thus listed by strength)" fileout "$id" "MEDIUM" "NOT a cipher order configured" @@ -21354,9 +21354,9 @@ extract_calist() { certtypes="${certreq:2:len}" certreq="${certreq:$((len+2))}" if "$is_tls12"; then - len=2*$(hex2dec "${certreq:0:4}") - sigalgs="${certreq:4:len}" - certreq="${certreq:$((len+4))}" + len=2*$(hex2dec "${certreq:0:4}") + sigalgs="${certreq:4:len}" + certreq="${certreq:$((len+4))}" fi len=2*$(hex2dec "${certreq:0:4}") calist="${certreq:4:len}"