mbedtls icon indicating copy to clipboard operation
mbedtls copied to clipboard

Fix incorrect use of mbedtls_ecp_group_id in test_suite_ssl.function

Open tom-cosgrove-arm opened this issue 3 years ago • 6 comments

MBEDTLS_SSL_IANA_TLS_GROUP_SECP192R1 and friends are not members of the mbedtls_ecp_group_id enum

Found by clang's -Wassign-enum

Signed-off-by: Tom Cosgrove [email protected]

Status

READY

Requires Backporting

NO (not applicable to 2.28)

tom-cosgrove-arm avatar Aug 03 '22 07:08 tom-cosgrove-arm

Can we enable this warning in our builds? At least with CMake where we can set flags based on the compiler version?

gilles-peskine-arm avatar Aug 03 '22 09:08 gilles-peskine-arm

I don't seem to be able to trigger this with clang 12, 13 or 14 on Linux, only with clang on macOS :(

tom-cosgrove-arm avatar Aug 03 '22 09:08 tom-cosgrove-arm

Weird. Is the difference actually macos vs linux, or arm vs x86?

gilles-peskine-arm avatar Aug 03 '22 09:08 gilles-peskine-arm

I think it's an "Apple messes with clang" thing - I get the same result on Intel and M1 macOS (but only have Apple clang version 12.0.0 (clang-1200.0.32.28) (on M1) and Apple clang version 13.0.0 (clang-1300.0.29.30) (M1 and Intel - actually, the Intel version is 1300.0.27.3)) (these are from Xcode). Both versions give the same result.

I get it with just

macos $ make -j8 CC=clang CFLAGS="-O2 -Werror -Wall -Wassign-enum"

(obviously originally found with -Weverything, but that's too much, but this is a real type error)

tom-cosgrove-arm avatar Aug 03 '22 09:08 tom-cosgrove-arm

For more "Apple clang is different" see (for example) https://github.com/Mbed-TLS/mbedtls/issues/6103, where there doesn't even seem to be a -W flag that can be enabled to get the warning

tom-cosgrove-arm avatar Aug 03 '22 10:08 tom-cosgrove-arm

CI failure is an internal network failure "ssh: connect to host github.com port 22: Connection timed out"

I've hit re-run on that job

tom-cosgrove-arm avatar Aug 04 '22 07:08 tom-cosgrove-arm

Force-pushed to get CI to re-run

tom-cosgrove-arm avatar Aug 19 '22 09:08 tom-cosgrove-arm