mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-01-06 11:41:12 +03:00
Provide and use internal function mbedtls_zeroize_and_free()
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
@@ -617,8 +617,7 @@ static int load_file(const char *path, unsigned char **buf, size_t *n)
|
||||
if (fread(*buf, 1, *n, f) != *n) {
|
||||
fclose(f);
|
||||
|
||||
mbedtls_platform_zeroize(*buf, *n + 1);
|
||||
mbedtls_free(*buf);
|
||||
mbedtls_zeroize_and_free(*buf, *n + 1);
|
||||
|
||||
return MBEDTLS_ERR_DHM_FILE_IO_ERROR;
|
||||
}
|
||||
@@ -649,8 +648,7 @@ int mbedtls_dhm_parse_dhmfile(mbedtls_dhm_context *dhm, const char *path)
|
||||
|
||||
ret = mbedtls_dhm_parse_dhm(dhm, buf, n);
|
||||
|
||||
mbedtls_platform_zeroize(buf, n);
|
||||
mbedtls_free(buf);
|
||||
mbedtls_zeroize_and_free(buf, n);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user