-
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
crash on long PSK identity #238
Comments
Thanks for your report! I'll investigate. |
Nice catch! Just curious, how did you discover that? |
Thank you! At Zabbix, we are in the process of adding TLS encryption to the communication between Zabbix components. I was testing one of the components to see how it behaves with long PSK identities and noticed a crash. My colleague then discovered that it was a bug in mbed TLS, rather than Zabbix, so we reported a problem here. See subissue (74) on this particular problem and ZBXNEXT-1263 for the whole feature request. |
Thanks for the info. FYI, in case it isn't obvious from the patch, |
…mpatibility_fix-crypto HMAC DRBG: Split entropy-gathering requests to reduce request sizes
configure changes and improvements
Function ssl_set_psk() seems to allow to set a PSK identity of arbitrary length. However, after that PSK identity is used in a TLS handshake and is attempted to be freed, a TLS client program crashes.
The crash is easiest to reproduce using example programs provided with mbed TLS. For instance, start the server using the following command:
Here, "psk_identity" and "psk" are set to arbitrary values, and "force_ciphersuite" is specified to force the use of PSK, rather than certificates.
Now, here is the behavior of the TLS client with varying lengths of "psk_identity":
The most important are the first two cases, where mbed TLS crashes, presumably when trying to free something. The third case is notable, too, because the server says that an invalid TLS record was received (which the client probably should not have sent):
Tested with mbed TLS versions 1.3.11, 1.3.12, and 2.0.0.
The text was updated successfully, but these errors were encountered: