mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Merge pull request #7933 from tom-cosgrove-arm/add-mbedtls_zeroize_and_free
Provide and use internal function mbedtls_zeroize_and_free()
This commit is contained in:
@ -130,6 +130,15 @@ void mbedtls_platform_zeroize(void *buf, size_t len)
|
||||
}
|
||||
#endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */
|
||||
|
||||
void mbedtls_zeroize_and_free(void *buf, size_t len)
|
||||
{
|
||||
if (buf != NULL) {
|
||||
mbedtls_platform_zeroize(buf, len);
|
||||
}
|
||||
|
||||
mbedtls_free(buf);
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_PLATFORM_GMTIME_R_ALT)
|
||||
#include <time.h>
|
||||
#if !defined(_WIN32) && (defined(unix) || \
|
||||
|
Reference in New Issue
Block a user