From aa7bc47f738bc4c91a127b2a29029c5a8af63045 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 12 Jul 2018 00:54:56 +0200 Subject: [PATCH] Add missing const on policy_get_xxx function parameter --- include/psa/crypto.h | 4 ++-- library/psa_crypto.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/psa/crypto.h b/include/psa/crypto.h index 4c8cc40fd..e57f5647e 100644 --- a/include/psa/crypto.h +++ b/include/psa/crypto.h @@ -1205,10 +1205,10 @@ void psa_key_policy_set_usage(psa_key_policy_t *policy, psa_algorithm_t alg); /** \brief Retrieve the usage field of a policy structure. */ -psa_key_usage_t psa_key_policy_get_usage(psa_key_policy_t *policy); +psa_key_usage_t psa_key_policy_get_usage(const psa_key_policy_t *policy); /** \brief Retrieve the algorithm field of a policy structure. */ -psa_algorithm_t psa_key_policy_get_algorithm(psa_key_policy_t *policy); +psa_algorithm_t psa_key_policy_get_algorithm(const psa_key_policy_t *policy); /** \brief Set the usage policy on a key slot. * diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 50a99904c..fce9e3c82 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -2585,12 +2585,12 @@ void psa_key_policy_set_usage( psa_key_policy_t *policy, policy->alg = alg; } -psa_key_usage_t psa_key_policy_get_usage( psa_key_policy_t *policy ) +psa_key_usage_t psa_key_policy_get_usage( const psa_key_policy_t *policy ) { return( policy->usage ); } -psa_algorithm_t psa_key_policy_get_algorithm( psa_key_policy_t *policy ) +psa_algorithm_t psa_key_policy_get_algorithm( const psa_key_policy_t *policy ) { return( policy->alg ); }