Home
last modified time | relevance | path

Searched hist:"80 d47d0aba0f7810a1c56caa0cf86a280d8b9d0b" (Results 1 – 1 of 1) sorted by relevance

/optee_os/core/lib/libtomcrypt/
H A Dsm2-pke.c80d47d0aba0f7810a1c56caa0cf86a280d8b9d0b Thu Jan 09 09:43:42 UTC 2020 Jerome Forissier <jerome@forissier.org> core: ltc: SM2 PKE: fix bignum memory leaks

crypto_acipher_sm2_pke_encrypt() and crypto_acipher_sm2_pke_decrypt()
leak some bignum memory due to missing calls to ecc_free() and also due
to the fact that the x and y fields of an ecc_point are overwritten.
This is all the more problematic that bignum allocations use a special
memory pool [1] that can easily cause deadlocks when misused.

This commit fixes these problems.

[1] Commit a2eb5b55d169 ("libutils: add mempool API")

Fixes: f9a78287dd12 ("core: ltc: add support for SM2 PKE")
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>