From a0c2d19d8451d95b2af7d48a429b1c469c656910 Mon Sep 17 00:00:00 2001 From: Victor Krasnoshchok Date: Thu, 3 Sep 2020 00:07:05 +0300 Subject: [PATCH] Code style fix #3175 Signed-off-by: Victor Krasnoshchok --- library/entropy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/entropy.c b/library/entropy.c index fd2c207f0..81b4c509e 100644 --- a/library/entropy.c +++ b/library/entropy.c @@ -466,7 +466,7 @@ int mbedtls_entropy_update_nv_seed( mbedtls_entropy_context *ctx ) #if defined(MBEDTLS_FS_IO) 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; 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; } + ret = 0; + exit: mbedtls_platform_zeroize( buf, sizeof( buf ) );