Remove calling to psa_crypto_init

- no need to call psa_crypto_init before crypto operations
we assume init already called before. if not an error will return.
pull/9668/head
Moran Peker 2019-02-25 10:23:02 +02:00
parent d40c25d516
commit d9b22da91d
3 changed files with 0 additions and 17 deletions

View File

@ -55,12 +55,6 @@ t_cose_crypto_pub_key_sign(int32_t cose_alg_id,
return T_COSE_ERR_SIG_BUFFER_SIZE;
}
crypto_ret = psa_crypto_init();
if (crypto_ret != PSA_SUCCESS)
{
return T_COSE_ERR_HASH_GENERAL_FAIL;
}
crypto_ret = psa_open_key(PSA_KEY_LIFETIME_PERSISTENT, key_id, &handle);
if (crypto_ret != PSA_SUCCESS)
{

View File

@ -96,12 +96,6 @@ tfm_plat_get_initial_attest_key(uint8_t *key_buf,
const psa_key_id_t key_id = PSA_ATTESTATION_PRIVATE_KEY_ID;
psa_key_handle_t handle = 0;
crypto_ret = psa_crypto_init();
if (crypto_ret != PSA_SUCCESS)
{
return TFM_PLAT_ERR_SYSTEM_ERR;
}
crypto_ret = psa_open_key(PSA_KEY_LIFETIME_PERSISTENT, key_id, &handle);
if (crypto_ret != PSA_SUCCESS)
{

View File

@ -42,11 +42,6 @@ psa_attestation_inject_key_impl(const uint8_t *key_data,
#if defined(MBEDTLS_ECP_C)
status = psa_crypto_init();
if (status != PSA_SUCCESS) {
return (status);
}
status = psa_create_key(lifetime, key_id, &handle);
if (status != PSA_SUCCESS) {
return (status);