commit | bdbca7b383b72f65f9a2bf2671e1f76f9f789703 | [log] [tgz] |
---|---|---|
author | Andres Amaya Garcia <andres.amayagarcia@arm.com> | Fri Jun 23 16:23:21 2017 +0100 |
committer | Andres Amaya Garcia <andres.amayagarcia@arm.com> | Fri Jun 23 16:23:21 2017 +0100 |
tree | 4d3e6917ea3c927cc9d77c768f752739e32fdcdb | |
parent | 5a1c0e716242acfc7027c78e36487f8df1786c83 [diff] |
Zeroize tmp buf on fail in load_file() dhm.c
diff --git a/library/dhm.c b/library/dhm.c index a4715d1..f7e71f3 100644 --- a/library/dhm.c +++ b/library/dhm.c
@@ -542,7 +542,10 @@ if( fread( *buf, 1, *n, f ) != *n ) { fclose( f ); + + mbedtls_zeroize( *buf, *n + 1 ); mbedtls_free( *buf ); + return( MBEDTLS_ERR_DHM_FILE_IO_ERROR ); }