mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			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
							parent
							
								
									d40c25d516
								
							
						
					
					
						commit
						d9b22da91d
					
				| 
						 | 
				
			
			@ -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)
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue