commit | 2390c2ad9e6e40a40058a782c10fc1d7a80ac03d | [log] [tgz] |
---|---|---|
author | Andres Amaya Garcia <andres.amayagarcia@arm.com> | Fri Jun 23 16:30:31 2017 +0100 |
committer | Andres Amaya Garcia <andres.amayagarcia@arm.com> | Tue Jul 11 17:19:30 2017 +0100 |
tree | 1cfa84408b9b66de2370a7a56a174749ae93e478 | |
parent | ea0fad432766d1e923964d269f528cd8fb760e02 [diff] [blame] |
Zeroize tmp buf in mbedtls_md_file() md.c
diff --git a/library/md.c b/library/md.c index eda98f6..75b9717 100644 --- a/library/md.c +++ b/library/md.c
@@ -312,12 +312,11 @@ md_info->update_func( ctx.md_ctx, buf, n ); if( ferror( f ) != 0 ) - { ret = MBEDTLS_ERR_MD_FILE_IO_ERROR; - goto cleanup; - } + else + md_info->finish_func( ctx.md_ctx, output ); - md_info->finish_func( ctx.md_ctx, output ); + mbedtls_zeroize( buf, sizeof( buf ) ); cleanup: fclose( f );