Gilles Peskine cc794d8501 Tighten CSR extensionRequest bounds
Don't allow parts of a compound (SEQUENCE or SET) to go beyond the
containing compound.

The inline CSR regression test is derived from the existing "X509 CSR
ASN.1 (OK)" DER test vector. In the extensionRequest attribute, the original
well-formed fragment is:

    a029 3027 06092a864886f70d01090e 311a 3018 ...

where 31 1a is the SET containing the Extensions sequence and 30 18 is the
contained Extensions sequence. The malformed test changes only the SET
length byte, from 1a to 19:

    a029 3027 06092a864886f70d01090e 3119 3018 ...

The attribute SEQUENCE length and the inner Extensions sequence length are
left unchanged. This makes the SET one byte too short for its containing
attribute, so the parser must reject it with
MBEDTLS_ERR_ASN1_LENGTH_MISMATCH instead of parsing the trailing byte as
data outside the SET.

There is no known security impact, just some risk reduction.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:38 +02: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 Fix dependencies 2026-03-16 12:28:36 +00:00
opt-testcases Do not check fail cases for verify skipped 2026-03-13 18:04:16 +00:00
scripts Merge pull request #10631 from yiwu0b11/destdir_install_env_support 2026-04-29 14:37:29 +00:00
src Fix some compile time guards 2026-03-16 12:27:21 +00:00
suites Tighten CSR extensionRequest bounds 2026-06-05 11:35:38 +02: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 Revert "ssl_server2.c: DTLS: Attempt to read the response to the close notification" 2026-03-24 18:38:37 +01: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 Remove PSA status coverage log test 2026-03-12 10:18:33 +01:00
ssl-opt.sh ssl: narrow TLS 1.2 RSA-PSS handling and add interop coverage 2026-04-16 04:36:48 +03:00