Skip to content

Commit 19c9536

Browse files
Add more TLS ciphersuite tests
To make sure multiple ciphersuites are exercised in the tests (not just the ones that are negociated by the server+client), add more cases for explicit ciphersuites. Signed-off-by: Ilie Halip <ilie.halip@nxp.com>
1 parent f2f1bc1 commit 19c9536

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

tests/ttls

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,35 @@ run_tests() {
168168
title PARA "Run test with TLS 1.2 (ECDSA)"
169169
run_test "$ECPRIURI" "$ECCRTURI" "-tls1_2" "-tls1_2"
170170

171-
title PARA "Run test with TLS 1.2 and ECDH"
172-
run_test "$ECPRIURI" "$ECCRTURI" "" "-tls1_2 -cipher ECDHE-ECDSA-AES128-GCM-SHA256 -groups secp256r1"
173-
174-
title PARA "Run test with TLS 1.3 and specific suite"
175-
run_test "$ECPRIURI" "$ECCRTURI" "" "-tls1_3 -ciphersuites TLS_AES_256_GCM_SHA384 -groups secp256r1"
171+
TLS12_CIPHERS=(
172+
ECDHE-ECDSA-AES128-SHA256
173+
ECDHE-ECDSA-AES256-SHA384
174+
ECDHE-ECDSA-AES128-GCM-SHA256
175+
ECDHE-ECDSA-AES256-GCM-SHA384
176+
ECDHE-ECDSA-CHACHA20-POLY1305
177+
)
178+
for cipher in "${TLS12_CIPHERS[@]}"; do
179+
if $OPENSSL ciphers -s -v -tls1_2 2>/dev/null | grep -q "$cipher"; then
180+
title PARA "Run test with TLS 1.2 and $cipher"
181+
run_test "$ECPRIURI" "$ECCRTURI" "" "-tls1_2 -cipher ${cipher} -groups secp256r1"
182+
else
183+
title PARA "Skipping test with TLS 1.2 and $cipher"
184+
fi
185+
done
186+
187+
TLS13_CIPHERS=(
188+
TLS_AES_128_GCM_SHA256
189+
TLS_AES_256_GCM_SHA384
190+
TLS_CHACHA20_POLY1305_SHA256
191+
)
192+
for cipher in "${TLS13_CIPHERS[@]}"; do
193+
if $OPENSSL ciphers -s -v -tls1_3 2>/dev/null | grep -q "$cipher"; then
194+
title PARA "Run test with TLS 1.3 and $cipher"
195+
run_test "$ECPRIURI" "$ECCRTURI" "" "-tls1_3 -ciphersuites ${cipher} -groups secp256r1"
196+
else
197+
title PARA "Skipping test with TLS 1.3 and $cipher"
198+
fi
199+
done
176200
}
177201

178202
title SECTION "TLS with key in provider"

0 commit comments

Comments
 (0)