mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-01 06:27:24 +00:00
Add in tests for ECDHE-PSK integer overflow
Signed-off-by: Ben Taylor <[email protected]>
This commit is contained in:
@@ -8382,6 +8382,37 @@ run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \
|
||||
-s "Processing of the Certificate handshake message failed"
|
||||
# MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
|
||||
|
||||
# Miscellaneous PSK-related tests
|
||||
|
||||
psk_identity_max_minus_10=a$(printf "%$((MAX_OUT_LEN - 11))s" z | tr ' ' .)
|
||||
|
||||
run_test "Large PSK identity (MBEDTLS_SSL_OUT_CONTENT_LEN - 7)" \
|
||||
"$P_SRV debug_level=3 \
|
||||
psk_identity=${psk_identity_max_minus_10}987 psk=73776f726466697368" \
|
||||
"$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 debug_level=3 \
|
||||
psk_identity=${psk_identity_max_minus_10}987 psk=73776f726466697368" \
|
||||
1 \
|
||||
-s "! mbedtls_ssl_handshake returned" \
|
||||
-c "! mbedtls_ssl_handshake returned"
|
||||
|
||||
run_test "Large PSK identity (MBEDTLS_SSL_OUT_CONTENT_LEN - 6)" \
|
||||
"$P_SRV debug_level=3 \
|
||||
psk_identity=${psk_identity_max_minus_10}9876 psk=73776f726466697368" \
|
||||
"$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 debug_level=3 \
|
||||
psk_identity=${psk_identity_max_minus_10}9876 psk=73776f726466697368" \
|
||||
1 \
|
||||
-s "! mbedtls_ssl_handshake returned" \
|
||||
-c "! mbedtls_ssl_handshake returned"
|
||||
|
||||
run_test "Large PSK identity (MBEDTLS_SSL_OUT_CONTENT_LEN - 5)" \
|
||||
"$P_SRV debug_level=3 \
|
||||
psk_identity=${psk_identity_max_minus_10}98765 psk=73776f726466697368" \
|
||||
"$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 debug_level=3 \
|
||||
psk_identity=${psk_identity_max_minus_10}98765 psk=73776f726466697368" \
|
||||
1 \
|
||||
-s "! mbedtls_ssl_handshake returned" \
|
||||
-c "! mbedtls_ssl_handshake returned"
|
||||
|
||||
# Tests for PSK callback
|
||||
|
||||
run_test "PSK callback: psk, no callback" \
|
||||
|
||||
Reference in New Issue
Block a user