Adjust guard for 3.6

In all.sh component test_psa_crypto_config_accel_rsa_crypto, where RSA
is provided only by a drivers, we were using a stack buffer. However
that was not correct, as "opaque" (PSA-held) RSA keys are still
possible. This was pointed by failing test cases in test_suite_pk, such
as "PSA import into PSA: opaque RSA, EXPORT (ok)".

As usual with 3.6, we need more complicated pre-processor conditions.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard
2026-02-23 09:34:49 +01:00
parent 3a16bd5306
commit ee2c3e819f

View File

@@ -51,8 +51,11 @@
*
* The current compromise is that if ECC is the only key type supported in PK,
* then we export keys on the stack, and otherwise we use the heap.
*
* RSA can either be used directly or indirectly via opaque keys if enabled.
*/
#if !defined(MBEDTLS_RSA_C)
#if !defined(MBEDTLS_RSA_C) && \
!(defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY))
#define PK_EXPORT_KEYS_ON_THE_STACK
#endif