Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET breaks backwards-compatibility? #9134

Closed
sfan5 opened this issue May 13, 2024 · 1 comment
Closed

Comments

@sfan5
Copy link

sfan5 commented May 13, 2024

Summary

mbedTLS functions can now return MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET.
Applications are likely to treat unknown error codes as failures and are not prepared for this.

System information

Mbed TLS version (number or commit id): 3.6.0
Operating system and version: Linux x86_64
Configuration (if not default, please attach mbedtls_config.h): cmake default
Compiler and options (if you used a pre-built binary, please indicate how you obtained it): gcc 13.2.1
Additional environment information: n/a

Expected behavior

mbedTLS doesn't add mandatory-to-handle new errors in minor versions.

Actual behavior

it did.

Steps to reproduce

  1. have application logic that looks like this:
int ret;
char buf[1234];

if ((ret = mbedtls_ssl_read(&ssl_context, buf, sizeof(buf))) > 0) {
    // use data
}

if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
	// try again later
} else {
	// report error and quit
}
  1. upgrade to mbedtls 3.6.0
  2. witness random failures

Additional information

The first affected version is 3.6.0 because that one enables TLS 1.3 by default (and with it also session tickets).
Enabling session tickets by default seems dubious because going by what ssl_client2.c does applications need to add explicit code to support them anyway.

@tom-daubney-arm tom-daubney-arm self-assigned this May 15, 2024
@tom-daubney-arm
Copy link
Contributor

Hi @sfan5, thanks for creating this issue.

You are right that this is a mistake on our part and we are looking to sort out a way of solving it soon. This problem is already tracked in #8749 and thus I will be closing this ticket as a duplicate.

@tom-daubney-arm tom-daubney-arm closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
@tom-daubney-arm tom-daubney-arm removed their assignment May 16, 2024
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

No branches or pull requests

2 participants