1From 5035d84a049e59fd5973c61a913db38b0dc20949 Mon Sep 17 00:00:00 2001
2From: Benjamin Baratte <benjamin.baratte@st.com>
3Date: Thu, 9 Feb 2023 10:35:01 +0100
4Subject: [PATCH 3/6] Allow SE key to use key vendor id within PSA crypto
5
6Signed-off-by: Benjamin Baratte <benjamin.baratte@st.com>
7---
8 library/psa_crypto.c | 4 ++++
9 1 file changed, 4 insertions(+)
10
11diff --git a/library/psa_crypto.c b/library/psa_crypto.c
12index 5180435de..589a00e6e 100644
13--- a/library/psa_crypto.c
14+++ b/library/psa_crypto.c
15@@ -1719,7 +1719,11 @@ static psa_status_t psa_validate_key_attributes(
16             return PSA_ERROR_INVALID_ARGUMENT;
17         }
18     } else {
19+#ifdef MBEDTLS_PSA_CRYPTO_SE_C
20+        if (!psa_is_valid_key_id(psa_get_key_id(attributes), 1)) {
21+#else
22         if (!psa_is_valid_key_id(psa_get_key_id(attributes), 0)) {
23+#endif
24             return PSA_ERROR_INVALID_ARGUMENT;
25         }
26     }
27--
282.34.1
29
30