mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-07 17:20:57 +01:00
Rearrange code
Just a slight rearrangement of the code in order to remove some redundancy.
This commit is contained in:
parent
76c34dd148
commit
e2161aef5e
15
testssl.sh
15
testssl.sh
@ -5013,24 +5013,15 @@ run_server_preference() {
|
|||||||
|
|
||||||
for i in 1 2 3 4 5 6; do
|
for i in 1 2 3 4 5 6; do
|
||||||
if [[ -n "${cipher[i]}" ]]; then # cipher not empty
|
if [[ -n "${cipher[i]}" ]]; then # cipher not empty
|
||||||
if [[ -z "$prev_cipher" ]]; then # previous one empty
|
if [[ -z "$prev_cipher" ]] || [[ "$prev_cipher" != "${cipher[i]}" ]]; then
|
||||||
#outln
|
[[ -n "$prev_cipher" ]] && outln
|
||||||
if [[ -z "$SHOW_RFC" ]]; then
|
if [[ -z "$SHOW_RFC" ]]; then
|
||||||
printf -- " %-30s %s" "${cipher[i]}:" "${proto[i]}" # print out both
|
printf -- " %-30s %s" "${cipher[i]}:" "${proto[i]}" # print out both
|
||||||
else
|
else
|
||||||
printf -- " %-51s %s" "${cipher[i]}:" "${proto[i]}" # print out both
|
printf -- " %-51s %s" "${cipher[i]}:" "${proto[i]}" # print out both
|
||||||
fi
|
fi
|
||||||
else # previous NOT empty
|
else
|
||||||
if [[ "$prev_cipher" == "${cipher[i]}" ]]; then # and previous protocol same cipher
|
|
||||||
out ", ${proto[i]}" # same cipher --> only print out protocol behind it
|
out ", ${proto[i]}" # same cipher --> only print out protocol behind it
|
||||||
else
|
|
||||||
outln
|
|
||||||
if [[ -z "$SHOW_RFC" ]]; then
|
|
||||||
printf -- " %-30s %s" "${cipher[i]}:" "${proto[i]}" # print out both
|
|
||||||
else
|
|
||||||
printf -- " %-51s %s" "${cipher[i]}:" "${proto[i]}" # print out both
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
prev_cipher="${cipher[i]}"
|
prev_cipher="${cipher[i]}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user