From af9ff4ab9d430b39cfe770029e4fbd2df5a07ab3 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 24 Jul 2019 11:40:53 +0100 Subject: [PATCH] tinyCrypt: Enforce matching setting of MBEDTLS_SSL_CONF_SINGLE_EC We support only Secp256r1 through tinyCrypt, so enforce this by requiring that MBEDTLS_SSL_CONF_SINGLE_EC is set and fixes that curve. --- include/mbedtls/check_config.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index 94ce3d1bc..f28345d2f 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -103,6 +103,13 @@ #error "MBEDTLS_USE_TINYCRYPT defined, but it cannot be defined with MBEDTLS_NO_64BIT_MULTIPLICATION" #endif +#if defined(MBEDTLS_USE_TINYCRYPT) && \ + !( defined(MBEDTLS_SSL_CONF_SINGLE_EC) && \ + MBEDTLS_SSL_CONF_SINGLE_EC_TLS_ID == 23 && \ + MBEDTLS_SSL_CONF_SINGLE_EC_GRP_ID == MBEDTLS_ECP_DP_SECP256R1 ) +#error "MBEDTLS_USE_TINYCRYPT requires the use of MBEDTLS_SSL_CONF_SINGLE_EC to hardcode the choice of Secp256r1" +#endif + #if defined(MBEDTLS_USE_TINYCRYPT) && \ !defined(MBEDTLS_SSL_CONF_RNG) #error "MBEDTLS_USE_TINYCRYPT defined, but not all prerequesites"