From 649a8f43017004b0809c200be767a575c6b0a476 Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Thu, 18 Mar 2021 17:34:55 +0100 Subject: [PATCH] replace memcpy of structure with regular assignment Signed-off-by: Steven Cooreman --- library/psa_crypto_slot_management.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/library/psa_crypto_slot_management.c b/library/psa_crypto_slot_management.c index ea3a5fc6b..5428b43a3 100644 --- a/library/psa_crypto_slot_management.c +++ b/library/psa_crypto_slot_management.c @@ -321,14 +321,8 @@ static psa_status_t psa_load_builtin_key_into_slot( psa_key_slot_t *slot ) if( status != PSA_SUCCESS ) goto exit; - /* Copy core attributes into the slot on success. - * Use static allocations to make the compiler yell at us should one - * of the two structures change type. */ - psa_core_key_attributes_t* builtin_key_core_attributes = &attributes.core; - psa_core_key_attributes_t* slot_core_attributes = &slot->attr; - memcpy( slot_core_attributes, - builtin_key_core_attributes, - sizeof( psa_core_key_attributes_t ) ); + /* Copy core attributes into the slot on success */ + slot->attr = attributes.core; exit: mbedtls_free( key_buffer );