Introduce psa_key_handle_is_null inline function

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2020-09-01 10:51:51 +02:00
parent 91e9515424
commit c26f8d467a
14 changed files with 46 additions and 33 deletions

View file

@ -157,7 +157,7 @@ static int ssl_conf_has_psk_or_cb( mbedtls_ssl_config const *conf )
return( 1 );
#if defined(MBEDTLS_USE_PSA_CRYPTO)
if( conf->psk_opaque != 0 )
if( ! psa_key_handle_is_null( conf->psk_opaque ) )
return( 1 );
#endif /* MBEDTLS_USE_PSA_CRYPTO */
@ -172,13 +172,13 @@ static int ssl_use_opaque_psk( mbedtls_ssl_context const *ssl )
/* If we've used a callback to select the PSK,
* the static configuration is irrelevant. */
if( ssl->handshake->psk_opaque != 0 )
if( ! psa_key_handle_is_null( ssl->handshake->psk_opaque ) )
return( 1 );
return( 0 );
}
if( ssl->conf->psk_opaque != 0 )
if( ! psa_key_handle_is_null( ssl->conf->psk_opaque ) )
return( 1 );
return( 0 );