From 893232fbde0ea28b731079525dbccaac8306962a Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Mon, 15 Mar 2021 12:23:37 +0100 Subject: [PATCH] Ensure the full driver structure is zeroized at setup Signed-off-by: Steven Cooreman --- library/psa_crypto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 14feabde0..b30cb4f6d 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -2164,6 +2164,9 @@ psa_status_t psa_hash_setup( psa_hash_operation_t *operation, 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 ) ); }