mirror of
https://github.com/drwetter/testssl.sh.git
synced 2024-12-29 04:49:44 +01:00
Merge pull request #2281 from dcooper16/fix_whitespace
Fix whitespace issues
This commit is contained in:
commit
9304bb80b8
40
testssl.sh
40
testssl.sh
@ -874,22 +874,22 @@ strip_quote() (
|
|||||||
|
|
||||||
# Converts a string containing PEM encoded data to one line.
|
# Converts a string containing PEM encoded data to one line.
|
||||||
pem_to_one_line() {
|
pem_to_one_line() {
|
||||||
local pem="$1"
|
local pem="$1"
|
||||||
local header="" footer=""
|
local header="" footer=""
|
||||||
|
|
||||||
if [[ "$pem" =~ .*-+BEGIN\ [A-Za-z0-9]+-+ ]]; then
|
if [[ "$pem" =~ .*-+BEGIN\ [A-Za-z0-9]+-+ ]]; then
|
||||||
header="$BASH_REMATCH"
|
header="$BASH_REMATCH"
|
||||||
pem="${pem/$header/}"
|
pem="${pem/$header/}"
|
||||||
fi
|
fi
|
||||||
if [[ "$pem" =~ -+END\ [A-Za-z0-9]+-+.* ]]; then
|
if [[ "$pem" =~ -+END\ [A-Za-z0-9]+-+.* ]]; then
|
||||||
footer="$BASH_REMATCH"
|
footer="$BASH_REMATCH"
|
||||||
pem="${pem/$footer/}"
|
pem="${pem/$footer/}"
|
||||||
fi
|
fi
|
||||||
pem="$(strip_spaces "$(newline_to_spaces "$pem")")"
|
pem="$(strip_spaces "$(newline_to_spaces "$pem")")"
|
||||||
[[ -n "$header" ]] && pem="$header\\\n$pem"
|
[[ -n "$header" ]] && pem="$header\\\n$pem"
|
||||||
[[ -n "$footer" ]] && pem+="\\\n$footer"
|
[[ -n "$footer" ]] && pem+="\\\n$footer"
|
||||||
printf -- "%s" "$pem"
|
printf -- "%s" "$pem"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
is_ipv4addr() {
|
is_ipv4addr() {
|
||||||
@ -4562,7 +4562,7 @@ ciphers_by_strength() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ $difference_rating -lt $NO_CIPHER_ORDER_LEVEL ]] && NO_CIPHER_ORDER_LEVEL=$difference_rating
|
[[ $difference_rating -lt $NO_CIPHER_ORDER_LEVEL ]] && NO_CIPHER_ORDER_LEVEL=$difference_rating
|
||||||
id="cipher_order${proto}"
|
id="cipher_order${proto}"
|
||||||
case $difference_rating in
|
case $difference_rating in
|
||||||
@ -4573,7 +4573,7 @@ ciphers_by_strength() {
|
|||||||
4)
|
4)
|
||||||
prln_svrty_low " (no server order, thus listed by strength)"
|
prln_svrty_low " (no server order, thus listed by strength)"
|
||||||
fileout "$id" "LOW" "NOT a cipher order configured"
|
fileout "$id" "LOW" "NOT a cipher order configured"
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
prln_svrty_medium " (no server order, thus listed by strength)"
|
prln_svrty_medium " (no server order, thus listed by strength)"
|
||||||
fileout "$id" "MEDIUM" "NOT a cipher order configured"
|
fileout "$id" "MEDIUM" "NOT a cipher order configured"
|
||||||
@ -21354,9 +21354,9 @@ extract_calist() {
|
|||||||
certtypes="${certreq:2:len}"
|
certtypes="${certreq:2:len}"
|
||||||
certreq="${certreq:$((len+2))}"
|
certreq="${certreq:$((len+2))}"
|
||||||
if "$is_tls12"; then
|
if "$is_tls12"; then
|
||||||
len=2*$(hex2dec "${certreq:0:4}")
|
len=2*$(hex2dec "${certreq:0:4}")
|
||||||
sigalgs="${certreq:4:len}"
|
sigalgs="${certreq:4:len}"
|
||||||
certreq="${certreq:$((len+4))}"
|
certreq="${certreq:$((len+4))}"
|
||||||
fi
|
fi
|
||||||
len=2*$(hex2dec "${certreq:0:4}")
|
len=2*$(hex2dec "${certreq:0:4}")
|
||||||
calist="${certreq:4:len}"
|
calist="${certreq:4:len}"
|
||||||
|
Loading…
Reference in New Issue
Block a user