Code style fix #3175

Signed-off-by: Victor Krasnoshchok <ct3da21164@protonmail.ch>
This commit is contained in:
Victor Krasnoshchok 2020-09-03 00:07:05 +03:00
parent b3129ba119
commit a0c2d19d84
No known key found for this signature in database
GPG key ID: E2B10814BCFC65CE

View file

@ -466,7 +466,7 @@ int mbedtls_entropy_update_nv_seed( mbedtls_entropy_context *ctx )
#if defined(MBEDTLS_FS_IO) #if defined(MBEDTLS_FS_IO)
int mbedtls_entropy_write_seed_file( mbedtls_entropy_context *ctx, const char *path ) int mbedtls_entropy_write_seed_file( mbedtls_entropy_context *ctx, const char *path )
{ {
int ret = 0; int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
FILE *f = NULL; FILE *f = NULL;
unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE];
@ -488,6 +488,8 @@ int mbedtls_entropy_write_seed_file( mbedtls_entropy_context *ctx, const char *p
goto exit; goto exit;
} }
ret = 0;
exit: exit:
mbedtls_platform_zeroize( buf, sizeof( buf ) ); mbedtls_platform_zeroize( buf, sizeof( buf ) );