Change code style

Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
Xiaokang Qian 2023-09-01 11:17:11 +00:00
parent b7cc2e2d3b
commit cad99fa998

View file

@ -91,72 +91,67 @@ psa_status_t psa_driver_wrapper_export_public_key(
const psa_drv_se_t *drv;
psa_drv_se_context_t *drv_context;
if( psa_get_se_driver( attributes->core.lifetime, &drv, &drv_context ) )
{
if (psa_get_se_driver(attributes->core.lifetime, &drv, &drv_context)) {
if ((drv->key_management == NULL) ||
( drv->key_management->p_export_public == NULL ) )
{
return( PSA_ERROR_NOT_SUPPORTED );
(drv->key_management->p_export_public == NULL)) {
return PSA_ERROR_NOT_SUPPORTED;
}
return( drv->key_management->p_export_public(
return drv->key_management->p_export_public(
drv_context,
*((psa_key_slot_number_t *) key_buffer),
data, data_size, data_length ) );
data, data_size, data_length);
}
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
switch( location )
{
switch (location) {
case PSA_KEY_LOCATION_LOCAL_STORAGE:
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if (defined(PSA_CRYPTO_DRIVER_TEST))
status = mbedtls_test_transparent_export_public_key
(attributes,
status = mbedtls_test_transparent_export_public_key(
attributes,
key_buffer,
key_buffer_size,
data,
data_size,
data_length
);
data_length);
if( status != PSA_ERROR_NOT_SUPPORTED )
return( status );
if (status != PSA_ERROR_NOT_SUPPORTED) {
return status;
}
#endif
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
/* Fell through, meaning no accelerator supports this operation */
return( psa_export_public_key_internal( attributes,
return psa_export_public_key_internal(attributes,
key_buffer,
key_buffer_size,
data,
data_size,
data_length ) );
data_length);
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if (defined(PSA_CRYPTO_DRIVER_TEST))
case 0x7fffff:
return( mbedtls_test_opaque_export_public_key
(attributes,
return mbedtls_test_opaque_export_public_key(attributes,
key_buffer,
key_buffer_size,
data,
data_size,
data_length
));
data_length);
#endif
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
default:
/* Key is declared with a lifetime not known to us */
return( status );
return status;
}
}