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

Don't do handshake in mbedtls_ssl_read and mbedtls_ssl_write #9517

Closed
gilles-peskine-arm opened this issue Aug 29, 2024 · 1 comment
Closed
Labels
api-break This issue/PR breaks the API and must wait for a new major version component-tls enhancement needs-design-approval size-m Estimated task size: medium (~1w)

Comments

@gilles-peskine-arm
Copy link
Contributor

Don't perform handshake steps inside mbedtls_ssl_read() or mbedtls_ssl_write(). Instead, have the user call mbedtls_ssl_handshake().

The goal is to simplify these functions and reduce the errors (especially “non-error errors” like MBEDTLS_SSL_WANT_READ and MBEDTLS_SSL_WANT_WRITE).

I am personally not convinced by this, especially if we do #9516. It wouldn't simplify the code that much: we can have read() be do { do_read(); if (handshake_needed) handshake_step(); } while (more_handshake_needed()).

@gilles-peskine-arm gilles-peskine-arm added enhancement needs-design-approval component-tls api-break This issue/PR breaks the API and must wait for a new major version size-m Estimated task size: medium (~1w) labels Aug 29, 2024
@gilles-peskine-arm gilles-peskine-arm moved this to Design needed in Mbed TLS 4.0 planning Aug 29, 2024
@gilles-peskine-arm
Copy link
Contributor Author

Having chatted with @mpg, whose idea I believe this originally was: the main intent is to reduce the complexity on application handling of non-error errors. #9516 solves this problem better, solves more and is not more work. So let's focus our effort on #9516 and remove this from consideration.

@gilles-peskine-arm gilles-peskine-arm closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
@github-project-automation github-project-automation bot moved this from Design needed to Done in Mbed TLS 4.0 planning Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-break This issue/PR breaks the API and must wait for a new major version component-tls enhancement needs-design-approval size-m Estimated task size: medium (~1w)
Projects
None yet
Development

No branches or pull requests

1 participant