From b5e52f2e31dcb0a232d9868569ab73eea14c2b4e Mon Sep 17 00:00:00 2001
From: Steven Cooreman <steven.cooreman@silabs.com>
Date: Wed, 9 Sep 2020 16:19:34 +0200
Subject: [PATCH] Remove superfluous call in PSA cipher setup

As pointed out by Ronald. The key slot is populated using
get_key_from_slot, and after calling the driver the slot is
validated to not contain an external key, so calling
get_transparent_key is superfluous.

Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
---
 library/psa_crypto.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index eb760d438..d8c6c1e6d 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -4112,11 +4112,7 @@ static psa_status_t psa_cipher_setup( psa_cipher_operation_t *operation,
      * available for the given algorithm & key. */
     mbedtls_cipher_init( &operation->ctx.cipher );
 
-    status = psa_get_transparent_key( handle, &slot, usage, alg);
-    if( status != PSA_SUCCESS )
-        goto exit;
     key_bits = psa_get_key_slot_bits( slot );
-
     cipher_info = mbedtls_cipher_info_from_psa( alg, slot->attr.type, key_bits, NULL );
     if( cipher_info == NULL )
     {