Searched hist:ed3fa831cdd6c545bf2813de8aeccc2564387983 (Results 1 – 1 of 1) sorted by relevance
| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | bignum.c | ed3fa831cdd6c545bf2813de8aeccc2564387983 Wed Apr 29 13:35:00 UTC 2020 Jerome Forissier <jerome@forissier.org> libmbedtls: mbedtls_mpi_shrink(): fix possible unwanted truncation
If mbedtls_mpi_shrink() is passed a value for nblimbs that is smaller than the minimum number of limbs required to store the big number, the current implementation will unexpectedly truncate the number to the requested size. It should use the minimal size instead in order not to corrupt the bigum value.
This issue was introduced in [1] probably as a result of a bad copy and paste from mbedtls_mpi_grow().
Fixes: [1] commit 98bd5fe350be ("libmbedtls: add mbedtls_mpi_init_mempool()") Reported-by: Zhenke Ma <zhenke.ma@armchina.com> Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
|