-
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
Backport 2.x: fix SHA384 guards in TLS #4503
Backport 2.x: fix SHA384 guards in TLS #4503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just spotted a very minor miss.
e6cbd7e
to
2a98b7e
Compare
Fix Mbed-TLS#4472 Signed-off-by: Gilles Peskine <[email protected]>
They depended on MBEDTLS_SHA512_C only. A check for !MBEDTLS_SHA512_NO_SHA384 was missing. Fix Mbed-TLS#4499. Signed-off-by: Gilles Peskine <[email protected]>
TLS code specific to SHA-384 was gated on MBEDTLS_SHA512_C. But SHA-384 also requires that MBEDTLS_SHA512_NO_SHA384 is not defined. This lead to dead code in TLS when MBEDTLS_SHA512_C and MBEDTLS_SHA512_NO_SHA384 were both defined (i.e. when SHA-512 was enabled but not SHA-384). Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
2a98b7e
to
c54010c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good to me now. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good
Even after the addition of
MBEDTLS_SHA512_NO_SHA384
, the TLS code gated the availability of SHA384 ciphersuites onMBEDTLS_SHA512_C
alone, and in one case due to a typo onMBEDTLS_SHA1_C
. Fix #4472, #4499.For 3.0 this is fixed in #4304 (the issues were discovered while reviewing that PR).
I have not fixed a similar issue in
ssl_cookie.c
because I'm not sure what the fix is and it remains partly open in 3.0. It is filed as #4501.There are no non-regression tests because I don't think it's easy to add them. I've filed the lack of tests as #4500. To test manually, build
development_2.x
withMBEDTLS_SHA512_NO_SHA384
defined and observe thatprograms/ssl/ssl_client2 help
lists SHA384 cipher suites but they do not work. With this patch, the ciphersuites are no longer offered.