blob: 5594949d49c2672017f025b886e77877c34a8369 [file] [log] [blame]
From 5033d3b320432de663f9e0ea89f1696905281c59 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/7] 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 5c05acac4..75a7034ee 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1732,7 +1732,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