1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Add a test for calloc zeroization

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek
2023-04-25 05:19:42 -04:00
parent b9f8974c6c
commit c08ccd00f3
3 changed files with 18 additions and 1 deletions

View File

@@ -120,3 +120,17 @@ void time_delay_seconds(int delay_secs)
goto exit;
}
/* END_CASE */
/* BEGIN_CASE */
void check_mbedtls_calloc_zeroization()
{
unsigned int buf_size = 256;
unsigned char *buf;
buf = mbedtls_calloc(buf_size, sizeof(unsigned char));
for (unsigned int i = 0; i < buf_size; i++) {
TEST_EQUAL(buf[i], 0);
}
exit:
mbedtls_free(buf);
}
/* END_CASE */