Remove PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek 2022-09-16 07:24:14 -04:00
parent 1fafb1f778
commit 3c4c514302
2 changed files with 6 additions and 8 deletions

View file

@ -2032,8 +2032,6 @@
* #PSA_ECC_FAMILY_SECP_R1), so the input must be exactly 65 bytes. * #PSA_ECC_FAMILY_SECP_R1), so the input must be exactly 65 bytes.
*/ */
#define PSA_ALG_TLS12_ECJPAKE_TO_PMS ((psa_algorithm_t)0x08000600) #define PSA_ALG_TLS12_ECJPAKE_TO_PMS ((psa_algorithm_t)0x08000600)
#define PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS(alg) \
(alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS)
/* This flag indicates whether the key derivation algorithm is suitable for /* This flag indicates whether the key derivation algorithm is suitable for
* use on low-entropy secrets such as password - these algorithms are also * use on low-entropy secrets such as password - these algorithms are also

View file

@ -4352,7 +4352,7 @@ psa_status_t psa_key_derivation_abort( psa_key_derivation_operation_t *operation
#endif /* defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF) || #endif /* defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF) ||
* defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS) */ * defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS) */
#if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS) #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS)
if( PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) if( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS )
{ {
mbedtls_platform_zeroize( operation->ctx.tls12_ecjpake_to_pms.data, mbedtls_platform_zeroize( operation->ctx.tls12_ecjpake_to_pms.data,
PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE ); PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE );
@ -4720,7 +4720,7 @@ psa_status_t psa_key_derivation_output_bytes(
#endif /* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF || #endif /* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF ||
* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS */ * MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS */
#if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS) #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS)
if( PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) if( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS )
{ {
status = psa_key_derivation_tls12_ecjpake_to_pms_read( status = psa_key_derivation_tls12_ecjpake_to_pms_read(
&operation->ctx.tls12_ecjpake_to_pms, output, output_length ); &operation->ctx.tls12_ecjpake_to_pms, output, output_length );
@ -5121,7 +5121,7 @@ static int is_kdf_alg_supported( psa_algorithm_t kdf_alg )
return( 1 ); return( 1 );
#endif #endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS) #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS)
if( PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) if( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS )
return( 1 ); return( 1 );
#endif #endif
return( 0 ); return( 0 );
@ -5151,7 +5151,7 @@ static psa_status_t psa_key_derivation_setup_kdf(
* ecjpake to pms) are based on a hash algorithm. */ * ecjpake to pms) are based on a hash algorithm. */
psa_algorithm_t hash_alg = PSA_ALG_HKDF_GET_HASH( kdf_alg ); psa_algorithm_t hash_alg = PSA_ALG_HKDF_GET_HASH( kdf_alg );
size_t hash_size = PSA_HASH_LENGTH( hash_alg ); size_t hash_size = PSA_HASH_LENGTH( hash_alg );
if( !PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) if( kdf_alg != PSA_ALG_TLS12_ECJPAKE_TO_PMS )
{ {
if( hash_size == 0 ) if( hash_size == 0 )
return( PSA_ERROR_NOT_SUPPORTED ); return( PSA_ERROR_NOT_SUPPORTED );
@ -5176,7 +5176,7 @@ static psa_status_t psa_key_derivation_setup_kdf(
} }
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT) #if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT)
if( PSA_ALG_IS_HKDF_EXTRACT( kdf_alg ) || if( PSA_ALG_IS_HKDF_EXTRACT( kdf_alg ) ||
PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS ( kdf_alg )) ( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS ) )
operation->capacity = hash_size; operation->capacity = hash_size;
else else
#endif /* MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT */ #endif /* MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT */
@ -5668,7 +5668,7 @@ static psa_status_t psa_key_derivation_input_internal(
else else
#endif /* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS */ #endif /* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS */
#if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS) #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS)
if( PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) if( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS )
{ {
status = psa_tls12_ecjpake_to_pms_input( status = psa_tls12_ecjpake_to_pms_input(
&operation->ctx.tls12_ecjpake_to_pms, step, data, data_length ); &operation->ctx.tls12_ecjpake_to_pms, step, data, data_length );