mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-24 23:56:53 +00:00
Clarify usage of psa_key_policy_permits
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
16a05f5881
commit
d788fab4ff
|
@ -811,6 +811,10 @@ static int psa_key_algorithm_permits( psa_algorithm_t policy_alg,
|
||||||
static psa_status_t psa_key_policy_permits( const psa_key_policy_t *policy,
|
static psa_status_t psa_key_policy_permits( const psa_key_policy_t *policy,
|
||||||
psa_algorithm_t alg )
|
psa_algorithm_t alg )
|
||||||
{
|
{
|
||||||
|
/* '0' is not a valid algorithm */
|
||||||
|
if( alg == 0 )
|
||||||
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
|
|
||||||
/* A requested algorithm cannot be a wildcard. */
|
/* A requested algorithm cannot be a wildcard. */
|
||||||
if( PSA_ALG_IS_WILDCARD( alg ) )
|
if( PSA_ALG_IS_WILDCARD( alg ) )
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
|
@ -856,7 +860,8 @@ static psa_status_t psa_restrict_key_policy(
|
||||||
* and lock it.
|
* and lock it.
|
||||||
*
|
*
|
||||||
* The key must have allow all the usage flags set in \p usage. If \p alg is
|
* The key must have allow all the usage flags set in \p usage. If \p alg is
|
||||||
* nonzero, the key must allow operations with this algorithm.
|
* nonzero, the key must allow operations with this algorithm. If \p alg is
|
||||||
|
* zero, the algorithm is not checked.
|
||||||
*
|
*
|
||||||
* In case of a persistent key, the function loads the description of the key
|
* In case of a persistent key, the function loads the description of the key
|
||||||
* into a key slot if not already done.
|
* into a key slot if not already done.
|
||||||
|
|
Loading…
Reference in a new issue