Skip to content

Add input length validation in dummy_ticket_parse() - #10831

Open
honma89 wants to merge 1 commit into
Mbed-TLS:developmentfrom
honma89:fix-memory-errors
Open

Add input length validation in dummy_ticket_parse()#10831
honma89 wants to merge 1 commit into
Mbed-TLS:developmentfrom
honma89:fix-memory-errors

Conversation

@honma89

@honma89 honma89 commented Jul 14, 2026

Copy link
Copy Markdown

Description

This pull request adds a length check in dummy_ticket_parse() before parsing the TLS session ticket.

Previously, the function assumed that the ticket buffer was always large enough and directly used len - 4. If a smaller buffer was provided, this could cause an unsigned integer underflow and pass an invalid length value to mbedtls_ssl_session_load().

This change ensures invalid ticket buffers are rejected early by returning MBEDTLS_ERR_SSL_BAD_INPUT_DATA.

PR checklist

  • changelog provided | not required because this is a small internal TLS test helper fix
  • framework PR provided | not required
  • TF-PSA-Crypto development PR provided | not required
  • TF-PSA-Crypto 1.1 PR provided | not required
  • mbedtls development PR provided | not required
  • mbedtls 4.1 PR provided | not required
  • tests provided | not required

Signed-off-by: Nim Dorji Subba <nimdorjisubba2003@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant