Skip to content

Commit faad712

Browse files
committed
If we are sure we don't have sslv2 we don't need to test any RC4 SSLv2 ciphers
1 parent 3cd1273 commit faad712

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

testssl.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17870,7 +17870,8 @@ run_rc4() {
1787017870
return 0
1787117871
fi
1787217872

17873-
# get a list of all the cipher suites to test
17873+
# Get a list of all the cipher suites to test. #FIXME: This is rather ineffective as RC4 ciphers won't change.
17874+
# We should instead build a fixed list here like @ other functions
1787417875
if "$using_sockets" || [[ $OSSL_VER_MAJOR -lt 1 ]]; then
1787517876
for (( i=0; i < TLS_NR_CIPHERS; i++ )); do
1787617877
if [[ "${TLS_CIPHER_RFC_NAME[i]}" =~ RC4 ]] && ( "$using_sockets" || "${TLS_CIPHER_OSSL_SUPPORTED[i]}" ); then
@@ -17925,7 +17926,7 @@ run_rc4() {
1792517926
done < <($OPENSSL ciphers $OSSL_CIPHERS_S -V 'ALL:COMPLEMENTOFALL:@STRENGTH' 2>>$ERRFILE)
1792617927
fi
1792717928

17928-
if "$using_sockets" && [[ -n "$sslv2_ciphers_hex" ]]; then
17929+
if "$using_sockets" && [[ -n "$sslv2_ciphers_hex" ]] && [[ $(has_server_protocol ssl2) -ne 1 ]]; then
1792917930
sslv2_sockets "${sslv2_ciphers_hex:2}" "true"
1793017931
if [[ $? -eq 3 ]] && [[ "$V2_HELLO_CIPHERSPEC_LENGTH" -ne 0 ]]; then
1793117932
supported_sslv2_ciphers="$(grep "Supported cipher: " "$TEMPDIR/$NODEIP.parse_sslv2_serverhello.txt")"
@@ -17938,7 +17939,7 @@ run_rc4() {
1793817939
fi
1793917940
done
1794017941
fi
17941-
elif "$HAS_SSL2" && [[ -n "$sslv2_ciphers_ossl" ]]; then
17942+
elif "$HAS_SSL2" && [[ -n "$sslv2_ciphers_ossl" ]] && [[ $(has_server_protocol ssl2) -ne 1 ]]; then
1794217943
$OPENSSL s_client -cipher "${sslv2_ciphers_ossl:1}" $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY -ssl2 >$TMPFILE 2>$ERRFILE </dev/null
1794317944
sclient_connect_successful $? "$TMPFILE"
1794417945
if [[ $? -eq 0 ]]; then

0 commit comments

Comments
 (0)