Skip to content

Commit 8e184b8

Browse files
author
David Cooper
committed
Fix #2615
The server mentioned in #2615 has a bug, which results in it sending a handshake_failure alert rather than a successful connection if the signature_algorithms extension lists RSA+MD5 before one of the signature algorithms that it supports. This commit works around this issue by reversing the order in which it lists the signature algorithms in the signature_algorithms extension, thus (generally) listing stronger options first. This change should not affect the testing, except that it will result in the order of the supported signature algorithms being reversed in the output, if the server respects the client's preferences.
1 parent ef92cc7 commit 8e184b8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

testssl.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11079,25 +11079,27 @@ run_fs() {
1107911079
# A few servers get confused if the signature_algorithms extension contains too many entries. So:
1108011080
# * For TLS 1.3, break the list into two and test each half separately.
1108111081
# * For TLS 1.2, generally limit the signature_algorithms extension to algorithms that are consistent with the key type.
11082+
# At least one server gets confused if RSA+MD5 is offered first. So, the ordering is reversed so that the strongest
11083+
# options appear in $sigalgs_to_test first.
1108211084
for hexc in "${sigalgs_hex[@]}"; do
1108311085
if [[ "$proto" == 04* ]]; then
1108411086
if ! "${tls13_supported_sigalgs[i]}"; then
1108511087
if [[ "${proto##*-}" == 01 ]]; then
11086-
[[ $i -le 16 ]] && sigalgs_to_test+=", $hexc"
11088+
[[ $i -le 16 ]] && sigalgs_to_test=", $hexc$sigalgs_to_test"
1108711089
else
11088-
[[ $i -gt 16 ]] && sigalgs_to_test+=", $hexc"
11090+
[[ $i -gt 16 ]] && sigalgs_to_test=", $hexc$sigalgs_to_test"
1108911091
fi
1109011092
fi
1109111093
elif ! "${tls12_supported_sigalgs[i]}"; then
1109211094
if [[ "$proto" =~ rsa ]]; then
1109311095
if [[ "${hexc:3:2}" == 01 ]] || [[ "${hexc:0:2}" == 08 ]]; then
11094-
sigalgs_to_test+=", $hexc"
11096+
sigalgs_to_test=", $hexc$sigalgs_to_test"
1109511097
fi
1109611098
elif [[ "$proto" =~ dss ]]; then
11097-
[[ "${hexc:3:2}" == 02 ]] && sigalgs_to_test+=", $hexc"
11099+
[[ "${hexc:3:2}" == 02 ]] && sigalgs_to_test=", $hexc$sigalgs_to_test"
1109811100
else
1109911101
if [[ "${hexc:3:2}" == 03 ]] || [[ "${hexc:0:2}" == 08 ]]; then
11100-
sigalgs_to_test+=", $hexc"
11102+
sigalgs_to_test=", $hexc$sigalgs_to_test"
1110111103
fi
1110211104
fi
1110311105
fi

0 commit comments

Comments
 (0)