From 924815982aaaa4e164d738418935537baf6f0a26 Mon Sep 17 00:00:00 2001 From: Przemyslaw Stekiel Date: Tue, 4 Jan 2022 10:09:46 +0100 Subject: [PATCH] Workaround for VS compiler build error The following error was reported by CI for win32/release builds: 37>Done Building Project "C:\builds\workspace\mbed-tls-pr-head_PR-5139-head\worktrees\tmp_nn5muy8\visualc\VS2010\gen_entropy.vcxproj.metaproj" (Rebuild target(s)). 67>c:\builds\workspace\mbed-tls-pr-head_pr-5139-head\worktrees\tmp_nn5muy8\library\psa_crypto.c(4840): fatal error C1001: An internal error has occurred in the compiler. [C:\builds\workspace\mbed-tls-pr-head_PR-5139-head\worktrees\tmp_nn5muy8\visualc\VS2010\key_ladder_demo.vcxproj] (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 228) To work around this problem, try simplifying or changing the program near the locations listed above. Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information Signed-off-by: Przemyslaw Stekiel --- library/psa_crypto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 2b1e81ebe..fe46b0dc3 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -4966,7 +4966,8 @@ static psa_status_t psa_generate_derived_key_internal( defined(MBEDTLS_PSA_BUILTIN_ALG_ECDH) if ( PSA_KEY_TYPE_IS_ECC( slot->attr.type ) ) { - if ( PSA_KEY_TYPE_ECC_GET_FAMILY( slot->attr.type ) != PSA_ECC_FAMILY_MONTGOMERY ) + psa_ecc_family_t curve = PSA_KEY_TYPE_ECC_GET_FAMILY( slot->attr.type ); + if ( curve != PSA_ECC_FAMILY_MONTGOMERY ) { /* Weierstrass elliptic curve */ unsigned key_out_of_range = 0;