Use plain memset() in context init functions
We call xxx_init() on a structure when it has been freshly allocated (on the
stack or heap).
At this point it contains random-looking data none of which should be
sensitive, as all sensitive data is wiped using mbedtls_platform_zeroize()
when we're done using it and the memory area is going to be reclaimed (by
exiting the function or free()ing the buffer).
diff --git a/library/sha256.c b/library/sha256.c
index 10d3ff5..1c200c8 100644
--- a/library/sha256.c
+++ b/library/sha256.c
@@ -59,7 +59,7 @@
{
SHA256_VALIDATE( ctx != NULL );
- mbedtls_platform_memset( ctx, 0, sizeof( mbedtls_sha256_context ) );
+ memset( ctx, 0, sizeof( mbedtls_sha256_context ) );
}
void mbedtls_sha256_free( mbedtls_sha256_context *ctx )