From d5536d8a5b9187a1e4648cbac9c1168aeba2421c Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 1 Oct 2019 16:55:29 +0200 Subject: [PATCH] SE driver: Fix loading of persistent data The persistent data was not loaded correctly (the code was loading 0 bytes instead of the correct size). --- library/psa_crypto_se.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/psa_crypto_se.c b/library/psa_crypto_se.c index 11604c219..b7fa0c5c5 100644 --- a/library/psa_crypto_se.c +++ b/library/psa_crypto_se.c @@ -341,6 +341,8 @@ psa_status_t psa_register_se_driver( driver_table[i].lifetime = lifetime; driver_table[i].methods = methods; + driver_table[i].internal.persistent_data_size = + methods->persistent_data_size; if( methods->persistent_data_size != 0 ) { @@ -358,8 +360,6 @@ psa_status_t psa_register_se_driver( if( status != PSA_SUCCESS && status != PSA_ERROR_DOES_NOT_EXIST ) goto error; } - driver_table[i].internal.persistent_data_size = - methods->persistent_data_size; return( PSA_SUCCESS );