From 99b7d6b700b003f996dfbeca4952141e2c3610b2 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 21 Aug 2018 14:56:19 +0200 Subject: [PATCH] Wipe sensitive data in psa_mac_verify_finish Wipe the whole MAC intermediate buffer, not just the requested MAC size. With truncated MAC algorithms, the requested MAC size may be smaller than what is written to the intermediate buffer. --- library/psa_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 410f64821..da6bd612f 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -1827,7 +1827,7 @@ cleanup: else psa_mac_abort( operation ); - mbedtls_zeroize( actual_mac, mac_length ); + mbedtls_zeroize( actual_mac, sizeof( actual_mac ) ); return( status ); }