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).
This commit is contained in:
Gilles Peskine 2019-10-01 16:55:29 +02:00
parent c84c70a83c
commit d5536d8a5b

View File

@ -341,6 +341,8 @@ psa_status_t psa_register_se_driver(
driver_table[i].lifetime = lifetime; driver_table[i].lifetime = lifetime;
driver_table[i].methods = methods; driver_table[i].methods = methods;
driver_table[i].internal.persistent_data_size =
methods->persistent_data_size;
if( methods->persistent_data_size != 0 ) 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 ) if( status != PSA_SUCCESS && status != PSA_ERROR_DOES_NOT_EXIST )
goto error; goto error;
} }
driver_table[i].internal.persistent_data_size =
methods->persistent_data_size;
return( PSA_SUCCESS ); return( PSA_SUCCESS );