pkwrite: zeroize buf containing info of private key

Signed-off-by: Yanray Wang <[email protected]>
This commit is contained in:
Yanray Wang
2023-09-06 10:36:17 +08:00
parent c9d5ea9a9c
commit 4b0b97e18b
+1
View File
@@ -641,6 +641,7 @@ int mbedtls_pk_write_key_pem(mbedtls_pk_context *key, unsigned char *buf, size_t
ret = 0;
cleanup:
mbedtls_platform_zeroize(output_buf, PRV_DER_MAX_BYTES);
mbedtls_free(output_buf);
return ret;
}