-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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_ssl_send_alert_message() not re-entrant when underlying transport is not ready #1916
Labels
Comments
ARM Internal Ref: IOTSSL-2464 |
hanno-becker
pushed a commit
to hanno-becker/mbedtls
that referenced
this issue
Aug 6, 2018
hanno-becker
pushed a commit
to hanno-becker/mbedtls
that referenced
this issue
Aug 14, 2018
hanno-becker
pushed a commit
to hanno-becker/mbedtls
that referenced
this issue
Aug 14, 2018
hanno-becker
pushed a commit
to hanno-becker/mbedtls
that referenced
this issue
Aug 14, 2018
hanno-becker
pushed a commit
to hanno-becker/mbedtls
that referenced
this issue
Aug 14, 2018
hanno-becker
pushed a commit
to hanno-becker/mbedtls
that referenced
this issue
Aug 14, 2018
This was referenced Aug 14, 2018
daverodgman
pushed a commit
to hanno-becker/mbedtls
that referenced
this issue
Apr 8, 2022
Fixes Mbed-TLS#1916 Signed-off-by: Dave Rodgman <[email protected]>
daverodgman
pushed a commit
to daverodgman/mbedtls
that referenced
this issue
Apr 8, 2022
Fixes Mbed-TLS#1916 Signed-off-by: Dave Rodgman <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context: Functions returning
MBEDTLS_ERR_SSL_WANT_READ/WRITE
are supposed to be re-called with the same parameters until they succeed. This is usually implemented by having these functions first check if a flush is currently in progress, and if yes, solely attempt to complete it (in particular: not writing the respective message again). As long as the user does not mix unfinished calls of such functions, this is fine.Issue: The alert sending function
mbedtls_ssl_send_alert_message()
does not follow this pattern:This code always writes a new record, regardless of the state of flushing, i.e. ignoring potentially only partially completed previous attempts to send the alert. This can lead to corrupted data being dispatched to the underlying stream transport, as e.g. it is possible to have a first call to
mbedtls_ssl_send_alert_message()
send a partial record header, followed by a second call which sends an entire alert message again.The closely related function
mbedtls_ssl_close_notify()
behaves correctly:Suggestion for fix: Move the code
from
mbedtls_ssl_close_notify()
tombedtls_ssl_send_alert_message()
.The text was updated successfully, but these errors were encountered: