blob: 4adcd90a5fe4d448dc6b1b3c103e0951566feb21 [file] [log] [blame]
Patrick Williams7784c422022-11-17 07:29:11 -06001From 5a5e162e17c9decb04b3b2905a0fb604e8f06e91 Mon Sep 17 00:00:00 2001
Patrick Williams975a06f2022-10-21 14:42:47 -05002From: Satish Kumar <satish.kumar01@arm.com>
3Date: Mon, 14 Feb 2022 17:52:00 +0000
Patrick Williams7784c422022-11-17 07:29:11 -06004Subject: [PATCH 17/20] Fix : update psa_set_key_usage_flags definition to the
Patrick Williams975a06f2022-10-21 14:42:47 -05005 latest from the tf-m
6
7Upstream-Status: Pending
8Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
9Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
10---
11 components/service/crypto/include/psa/crypto_struct.h | 10 ++++++++++
12 1 file changed, 10 insertions(+)
13
14diff --git a/components/service/crypto/include/psa/crypto_struct.h b/components/service/crypto/include/psa/crypto_struct.h
15index 1bc55e375eea..b4a7ed4b39d3 100644
16--- a/components/service/crypto/include/psa/crypto_struct.h
17+++ b/components/service/crypto/include/psa/crypto_struct.h
18@@ -155,9 +155,19 @@ static inline psa_key_lifetime_t psa_get_key_lifetime(
19 return( attributes->lifetime );
20 }
21
22+static inline void psa_extend_key_usage_flags( psa_key_usage_t *usage_flags )
23+{
24+ if( *usage_flags & PSA_KEY_USAGE_SIGN_HASH )
25+ *usage_flags |= PSA_KEY_USAGE_SIGN_MESSAGE;
26+
27+ if( *usage_flags & PSA_KEY_USAGE_VERIFY_HASH )
28+ *usage_flags |= PSA_KEY_USAGE_VERIFY_MESSAGE;
29+}
30+
31 static inline void psa_set_key_usage_flags(psa_key_attributes_t *attributes,
32 psa_key_usage_t usage_flags)
33 {
34+ psa_extend_key_usage_flags( &usage_flags );
35 attributes->usage = usage_flags;
36 }
37
38--
Patrick Williams7784c422022-11-17 07:29:11 -0600392.38.1
Patrick Williams975a06f2022-10-21 14:42:47 -050040