From b1d04bba5ea94f6014786cec86082672dcbd925e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Duda?= Date: Tue, 21 May 2024 11:46:19 +0200 Subject: [PATCH] [mbedts] revert previous changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TBD.. Signed-off-by: Ɓukasz Duda --- third_party/mbedtls/CMakeLists.txt | 4 ++-- third_party/mbedtls/repo/include/psa/crypto_struct.h | 2 +- third_party/mbedtls/repo/library/pk.c | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/third_party/mbedtls/CMakeLists.txt b/third_party/mbedtls/CMakeLists.txt index 270b20c5779..edda48e900a 100644 --- a/third_party/mbedtls/CMakeLists.txt +++ b/third_party/mbedtls/CMakeLists.txt @@ -44,7 +44,7 @@ if(UNIFDEF_EXE) endif() find_program(SED_EXE sed) -#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") string(REPLACE "-Wconversion" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REPLACE "-Wconversion" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") @@ -92,7 +92,7 @@ else() configure_file(psa-crypto-config.h openthread-psa-crypto-config.h COPYONLY) endif() -target_include_directories(ot-config +target_include_directories(ot-config SYSTEM INTERFACE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/repo/include) diff --git a/third_party/mbedtls/repo/include/psa/crypto_struct.h b/third_party/mbedtls/repo/include/psa/crypto_struct.h index 8ca999cc27d..3913551aa88 100644 --- a/third_party/mbedtls/repo/include/psa/crypto_struct.h +++ b/third_party/mbedtls/repo/include/psa/crypto_struct.h @@ -226,7 +226,7 @@ static inline struct psa_key_derivation_s psa_key_derivation_operation_init( struct psa_key_production_parameters_s { /* Future versions may add other fields in this structure. */ uint32_t flags; - uint8_t *data; + uint8_t data[]; }; /** The default production parameters for key generation or key derivation. diff --git a/third_party/mbedtls/repo/library/pk.c b/third_party/mbedtls/repo/library/pk.c index 18be67da442..097777f2c09 100644 --- a/third_party/mbedtls/repo/library/pk.c +++ b/third_party/mbedtls/repo/library/pk.c @@ -868,9 +868,7 @@ static int copy_from_psa(mbedtls_svc_key_id_t key_id, psa_status_t status; psa_key_attributes_t key_attr = PSA_KEY_ATTRIBUTES_INIT; psa_key_type_t key_type; -#if defined(MBEDTLS_RSA_C) psa_algorithm_t alg_type; -#endif size_t key_bits; /* Use a buffer size large enough to contain either a key pair or public key. */ unsigned char exp_key[PSA_EXPORT_KEY_PAIR_OR_PUBLIC_MAX_SIZE]; @@ -901,10 +899,9 @@ static int copy_from_psa(mbedtls_svc_key_id_t key_id, key_type = PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(key_type); } key_bits = psa_get_key_bits(&key_attr); - -#if defined(MBEDTLS_RSA_C) alg_type = psa_get_key_algorithm(&key_attr); +#if defined(MBEDTLS_RSA_C) if ((key_type == PSA_KEY_TYPE_RSA_KEY_PAIR) || (key_type == PSA_KEY_TYPE_RSA_PUBLIC_KEY)) {