blob: e7c1dc33f89fd9f557f8f4b0efb8a96dc63d2c15 [file] [log] [blame]
Patrick Williams975a06f2022-10-21 14:42:47 -05001From b1ff44c650ae82f364a2f74059eeb280996dc4f8 Mon Sep 17 00:00:00 2001
2From: Satish Kumar <satish.kumar01@arm.com>
3Date: Mon, 14 Feb 2022 17:52:00 +0000
4Subject: [PATCH 17/19] Fix : update psa_set_key_usage_flags definition to the
5 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--
392.38.0
40