From 549ea8676a49ac885cfe2f50d3c9a5adbc71f2c4 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 22 May 2019 11:45:59 +0200 Subject: [PATCH] Minor documentation improvements --- include/psa/crypto_extra.h | 2 +- library/psa_crypto.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/psa/crypto_extra.h b/include/psa/crypto_extra.h index a1a658971..35eee11eb 100644 --- a/include/psa/crypto_extra.h +++ b/include/psa/crypto_extra.h @@ -83,7 +83,7 @@ extern "C" { * attacks based on arithmetic relations between different * computations made with the same key, or can escalate harmless * side channels into exploitable ones. Use this function only - * if it is necessary to support a protocol for which is has been + * if it is necessary to support a protocol for which it has been * verified that the usage of the key with multiple algorithms * is safe. */ diff --git a/library/psa_crypto.c b/library/psa_crypto.c index d3a013447..c9ee8c990 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -748,7 +748,7 @@ static psa_algorithm_t psa_key_policy_algorithm_intersection( psa_algorithm_t alg1, psa_algorithm_t alg2 ) { - /* Common case: the policy only allows alg. */ + /* Common case: both sides actually specify the same policy. */ if( alg1 == alg2 ) return( alg1 ); /* If the policies are from the same hash-and-sign family, check @@ -769,12 +769,12 @@ static psa_algorithm_t psa_key_policy_algorithm_intersection( static int psa_key_algorithm_permits( psa_algorithm_t policy_alg, psa_algorithm_t requested_alg ) { - /* Common case: the policy only allows alg. */ + /* Common case: the policy only allows requested_alg. */ if( requested_alg == policy_alg ) return( 1 ); /* If policy_alg is a hash-and-sign with a wildcard for the hash, - * and alg is the same hash-and-sign family with any hash, - * then alg is compliant with policy_alg. */ + * and requested_alg is the same hash-and-sign family with any hash, + * then requested_alg is compliant with policy_alg. */ if( PSA_ALG_IS_HASH_AND_SIGN( requested_alg ) && PSA_ALG_SIGN_GET_HASH( policy_alg ) == PSA_ALG_ANY_HASH ) {