check_config: add missing check for TLS 1.3 key exchanges#10650
check_config: add missing check for TLS 1.3 key exchanges#10650valeriosetti wants to merge 2 commits intoMbed-TLS:developmentfrom
Conversation
ronald-cron-arm
left a comment
There was a problem hiding this comment.
This seems to be for a configuration where MBEDTLS_SSL_PROTO_TLS1_3 and MBEDTLS_SSL_SRV_C are defined but none of MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED, MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED and MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED.
In that case, I'd say that we rather miss in mbedtls_check_config.h for TLS 1.3 a check similar to the TLS 1.2 one:
mbedtls/library/mbedtls_check_config.h
Lines 135 to 143 in 8426c9b
fdd3316 to
319bf4d
Compare
I just reshaped the PR to implement what you proposed here ;)
Wdyt? |
ronald-cron-arm
left a comment
There was a problem hiding this comment.
LGTM apart from the pre-processor error.
| #if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \ | ||
| !(defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED) || \ | ||
| defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) || \ | ||
| defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED) ) \ |
There was a problem hiding this comment.
| defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED) ) \ | |
| defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED) ) |
When MBEDTLS_SSL_PROTO_TLS1_3 is enabled ensure that at least one of the related key exchanges is also enabled. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Align the error message to the one used for the same check in TLS 1.3. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
319bf4d to
c3d52b9
Compare
|
Since the goal of the PR changed recently, I updated the title to make it more accurate of the content of the PR |
Description
Add a check to ensure that at least 1 key exchange is selected when TLS 1.3 is also enabled.
PR checklist