Skip to content

Commit d6decc7

Browse files
authored
Merge pull request #2905 from testssl/fix_2884
Consistency for function ciphers_by_strength()
2 parents d66b67b + 78ecf53 commit d6decc7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

testssl.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4486,6 +4486,7 @@ run_allciphers() {
44864486
# test for all ciphers per protocol locally configured (w/o distinguishing whether they are good or bad)
44874487
# for the specified protocol, test for all ciphers locally configured (w/o distinguishing whether they
44884488
# are good or bad) and list them in order to encryption strength.
4489+
#
44894490
ciphers_by_strength() {
44904491
local proto="$1" proto_hex="$2" proto_text="$3"
44914492
local using_sockets="$4" wide="$5" serverpref_known="$6"
@@ -4911,7 +4912,7 @@ run_cipher_per_proto() {
49114912
while read proto proto_hex proto_text; do
49124913
pr_underline "$(printf -- "%b" "$proto_text")"
49134914
ciphers_by_strength "$proto" "$proto_hex" "$proto_text" "$using_sockets" "true" "false"
4914-
done <<< "$(tm_out " -ssl2 22 SSLv2\n -ssl3 00 SSLv3\n -tls1 01 TLS 1\n -tls1_1 02 TLS 1.1\n -tls1_2 03 TLS 1.2\n -tls1_3 04 TLS 1.3")"
4915+
done <<< "$(tm_out " -ssl2 22 SSLv2\n -ssl3 00 SSLv3\n -tls1 01 TLSv1\n -tls1_1 02 TLSv1.1\n -tls1_2 03 TLSv1.2\n -tls1_3 04 TLSv1.3")"
49154916
return 0
49164917
#FIXME: no error condition
49174918
}
@@ -4930,6 +4931,7 @@ run_cipher_per_proto() {
49304931
# then either:
49314932
# 1) replace it with one corresponding to $SNI; or
49324933
# 2) remove it, if $SNI is empty
4934+
#
49334935
modify_clienthello() {
49344936
local tls_handshake_ascii="$1"
49354937
local new_key_share="$2" cookie="$3"
@@ -7321,15 +7323,15 @@ run_server_preference() {
73217323
if "$TLS13_ONLY" && ! "$has_tls13_cipher_order"; then
73227324
terminal_msg="no (TLS 1.3 only)"
73237325
limitedsense=" (limited sense as client will pick)"
7324-
fileout_msg="not a cipher order for TLS 1.3 configured"
7326+
fileout_msg="not a server cipher order for TLS 1.3 configured"
73257327
elif ! "$TLS13_ONLY" && [[ -z "$cipher2" ]]; then
73267328
pr_warning "unable to determine"
73277329
elif ! "$has_cipher_order" && ! "$has_tls13_cipher_order"; then
73287330
# server used the different ends (ciphers) from the client hello
73297331
terminal_msg="no (NOT ok)"
73307332
[[ "$fileout_rating" == INFO ]] && terminal_msg="no"
73317333
limitedsense=" (limited sense as client will pick)"
7332-
fileout_msg="NOT a cipher order configured"
7334+
fileout_msg="NOT a server cipher order configured"
73337335
elif "$has_cipher_order" && ! "$has_tls13_cipher_order" && [[ "$default_proto" == TLSv1.3 ]]; then
73347336
if [[ $NO_CIPHER_ORDER_LEVEL -eq 5 ]]; then
73357337
pr_svrty_good "yes (OK)"; out " -- only for < TLS 1.3"
@@ -7404,6 +7406,7 @@ run_server_preference() {
74047406
}
74057407

74067408
# arg1: true if the list that is returned does not need to be ordered by preference.
7409+
#
74077410
check_tls12_pref() {
74087411
local unordered_list_ok="$1"
74097412
local chacha20_ciphers="" non_chacha20_ciphers=""
@@ -7499,6 +7502,7 @@ check_tls12_pref() {
74997502
}
75007503

75017504
# At the moment only called from run_server_preference()
7505+
#
75027506
cipher_pref_check() {
75037507
local proto="$1" proto_hex="$2" proto_text="$3"
75047508
local using_sockets="$4"

0 commit comments

Comments
 (0)