Ensure the full driver structure is zeroized at setup
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 14feabd..b30cb4f 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -2164,6 +2164,9 @@
if( !PSA_ALG_IS_HASH( alg ) )
return( PSA_ERROR_INVALID_ARGUMENT );
+ /* Ensure all of the context is zeroized, not just the dummy int */
+ memset( &operation->ctx, 0, sizeof( operation->ctx ) );
+
return( psa_driver_wrapper_hash_setup( operation, alg ) );
}