v1rtu3x 83d132b47d tls13: server: reject zero-length psk_key_exchange_modes
RFC 8446 section 4.2.9 defines the ke_modes vector of the psk_key_exchange_modes extension as ke_modes<1..255>, so a zero-length vector is malformed.

ssl_tls13_parse_key_exchange_modes_ext() accepted such a vector, recording an empty set of PSK key exchange modes. This could lead to issuing session tickets that can never be used for resumption.

Reject the ClientHello with a decode_error alert, per RFC 8446 section 6: a vector shorter than its declared minimum violates the formal syntax of the extension (decode_error); it is not merely inconsistent with other fields (illegal_parameter).

Add a regression test that patches a ClientHello in flight to set the ke_modes vector length to zero, and checks that the server aborts with MBEDTLS_ERR_SSL_DECODE_ERROR and that the client receives the decode_error alert on the wire.

Fixes #10467

Signed-off-by: v1rtu3x <149050962+v1rtu3x@users.noreply.github.com>
2026-08-31 11:41:39 +03:00
..
.jenkins
configs Remove deprecated items 2025-08-01 11:45:14 +01:00
git-scripts Header updates 2023-11-03 12:21:36 +00:00
include tests: ssl_helpers: update TEST_AVAILABLE_ECC and TEST_UNAVAILABLE_ECC 2026-07-10 12:14:20 +02:00
opt-testcases Do not check fail cases for verify skipped 2026-03-13 18:04:16 +00:00
scripts Merge pull request #10848 from valeriosetti/issue10694 2026-08-13 14:53:27 +00:00
src tests: ssl_helpers: run ssl_context reset check only when the SSL context is setup 2026-06-24 15:37:00 +02:00
suites tls13: server: reject zero-length psk_key_exchange_modes 2026-08-31 11:41:39 +03:00
.gitignore cmake: Generate test_keys.h and test_certs.h in the build tree 2025-03-26 21:19:28 +01:00
CMakeLists.txt cmake: Introduce TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS 2026-03-09 08:28:51 +01:00
compat-in-docker.sh Header updates 2023-11-03 12:21:36 +00:00
compat.sh Merge pull request #10663 from yiwu0b11/remove_unused_ffdh_code 2026-05-13 16:49:20 +00:00
context-info.sh Fix test and formatting in ssl_context_info 2025-04-29 22:02:24 +02:00
Descriptions.txt
make-in-docker.sh Header updates 2023-11-03 12:21:36 +00:00
Makefile Make installable pqcp headers available to the libtestdriver1 build 2026-08-18 16:07:13 +02:00
ssl-opt.sh Merge pull request #10620 from mpg/ref-for-drivers 2026-08-13 09:56:09 +00:00