blob: d5d75a67942a3950e9e5cab1bc0c417bb2b0d77c [file] [log] [blame]
From f3d7c2b7000b98a5191007cbdf0b8910642fb685 Mon Sep 17 00:00:00 2001
From: Benjamin Baratte <benjamin.baratte@st.com>
Date: Thu, 9 Feb 2023 10:35:01 +0100
Subject: [PATCH 3/6] Allow SE key to use key vendor id within PSA crypto
Signed-off-by: Benjamin Baratte <benjamin.baratte@st.com>
---
library/psa_crypto.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 867b4019b..fd1d28fc6 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1703,7 +1703,11 @@ static psa_status_t psa_validate_key_attributes(
return PSA_ERROR_INVALID_ARGUMENT;
}
} else {
+#ifdef MBEDTLS_PSA_CRYPTO_SE_C
+ if (!psa_is_valid_key_id(psa_get_key_id(attributes), 1)) {
+#else
if (!psa_is_valid_key_id(psa_get_key_id(attributes), 0)) {
+#endif
return PSA_ERROR_INVALID_ARGUMENT;
}
}
--
2.34.1