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/cipher.c b/library/cipher.c
index 47dfe24..53ed9b3 100644
--- a/library/cipher.c
+++ b/library/cipher.c
@@ -156,7 +156,7 @@
void mbedtls_cipher_init( mbedtls_cipher_context_t *ctx )
{
CIPHER_VALIDATE( ctx != NULL );
- mbedtls_platform_memset( ctx, 0, sizeof( mbedtls_cipher_context_t ) );
+ memset( ctx, 0, sizeof( mbedtls_cipher_context_t ) );
}
void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx )