commit | c4cab13e43f8170575612892f66bdbc8c9e67285 | [log] [tgz] |
---|---|---|
author | Clement Faure <clement.faure@nxp.com> | Mon Feb 20 11:43:23 2023 +0100 |
committer | Jérôme Forissier <jerome@forissier.org> | Tue Feb 21 15:33:33 2023 +0100 |
tree | cf532d9c2207d87659ed01d88a7607820bf01c3c | |
parent | b489a618875e792dd727bbce9218595f1cbddfd6 [diff] |
core: crypto: fix memory leak in Ed25519 support The software implementation of ED25519 algorithm has a memory leak in the key and key pair allocation. Upon every public key allocation, a key pair is allocated (public and private components). When freeing the public key, only the public component is freed. To reproduce the issue: $ while xtest 4016; do :; done Until the following error: * regression_4016 Test TEE Internal API ED25519 sign/verify E/LD: copy_section_headers:1124 sys_copy_from_ta_bin E/TC:? 0 ldelf_init_with_ldelf:131 ldelf failed with res: 0xffff000c /usr/src/debug/optee-test/master.imx-r0/host/xtest/regression_4000.c:6062: xtest_teec_open_session(&session, &crypt_user_ta_uuid, ((void *)0), &ret_orig) has an unexpected value: 0xffff000c = TEEC_ERROR_OUT_OF_MEMORY, expected 0x0 = TEEC_SUCCESS regression_4016 FAILED To fix the memory leak, a separate public key allocation function must be defined along a ED25519 public key structure. Fixes: 0aaad418ac8b ("core: crypto: add Ed25519 support") Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
This git contains source code for the secure side implementation of OP-TEE project.
All official OP-TEE documentation has moved to http://optee.readthedocs.io.
// OP-TEE core maintainers