Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame^] | 1 | From 5a5e162e17c9decb04b3b2905a0fb604e8f06e91 Mon Sep 17 00:00:00 2001 |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 2 | From: Satish Kumar <satish.kumar01@arm.com> |
| 3 | Date: Mon, 14 Feb 2022 17:52:00 +0000 |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame^] | 4 | Subject: [PATCH 17/20] Fix : update psa_set_key_usage_flags definition to the |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 5 | latest from the tf-m |
| 6 | |
| 7 | Upstream-Status: Pending |
| 8 | Signed-off-by: Satish Kumar <satish.kumar01@arm.com> |
| 9 | Signed-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 | |
| 14 | diff --git a/components/service/crypto/include/psa/crypto_struct.h b/components/service/crypto/include/psa/crypto_struct.h |
| 15 | index 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 Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame^] | 39 | 2.38.1 |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 40 | |