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

Null pointer usage in ssl_tls.c in a non-default config #3998

Closed
AndrzejKurek opened this issue Jan 11, 2021 · 1 comment · Fixed by #4989
Closed

Null pointer usage in ssl_tls.c in a non-default config #3998

AndrzejKurek opened this issue Jan 11, 2021 · 1 comment · Fixed by #4989

Comments

@AndrzejKurek
Copy link
Contributor

AndrzejKurek commented Jan 11, 2021

When not using MBEDTLS_SSL_HW_RECORD_ACCEL, MBEDTLS_SSL_EXPORT_KEYS and MBEDTLS_DEBUG_C, but using the DTLS CID feature - a null pointer was accessed in line 917 of ssl-tls.c.
Fix available: see #3991 for details.

gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Apr 13, 2022
In configurations with MBEDTLS_SSL_DTLS_CONNECTION_ID enabled but none of
MBEDTLS_SSL_HW_RECORD_ACCEL, MBEDTLS_SSL_EXPORT_KEYS or MBEDTLS_DEBUG_C,
DTLS handshakes using CID would crash due to a null pointer dereference.
Fix this. Fixes Mbed-TLS#3998.

Detected by running compat.sh in config-ccm-psk-dtls1_2.h.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm
Copy link
Contributor

2.28.x fix in #5730

gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Apr 13, 2022
The fix was in Mbed-TLS#4989.
We forgot to add a changelog entry.

Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Apr 13, 2022
component_test_CID_no_debug was added specifically to be a non-regression
test for Mbed-TLS#3998. Running compat.sh
in the newly introduced config-ccm-psk-dtls1_2.h is also a non-regression
test for that bug. Therefore component_test_CID_no_debug is redundant for
its primary purpose.

Of course every configuration is different, but the additional coverage from
component_test_CID_no_debug is minimal, unlike config-ccm-psk-dtls1_2.h
which is a plausible real-world configuration.

In mbedtls-2.28, component_test_CID_no_debug was never added, and running
the unit tests in that configuration does not trigger the Mbed-TLS#3998 bug, only
compat.sh does. So, rather than backport component_test_CID_no_debug to
2.28.2, I am removing it from 3.2.

Signed-off-by: Gilles Peskine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants