mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-24 17:25:39 +00:00
ca8b8e7c31
Starting with commit 49e94e3
, the do/while loop in
`rsa_prepare_blinding()` was changed to a `do...while(0)`, which
prevents retry from being effective and leaves dead code.
Restore the while condition to retry, and lift the calls to finish the
computation out of the while loop by by observing that they are
performed only when `mbedtls_mpi_inv_mod()` returns zero.
Signed-off-by: Peter Kolbus <peter.kolbus@garmin.com>
7 lines
329 B
Plaintext
7 lines
329 B
Plaintext
Bugfix
|
|
* Fix rsa_prepare_blinding() to retry when the blinding value is not
|
|
invertible (mod N), instead of returning MBEDTLS_ERR_RSA_RNG_FAILED. This
|
|
addresses a regression but is rare in practice (approx. 1 in 2/sqrt(N)).
|
|
Found by Synopsys Coverity, fix contributed by Peter Kolbus (Garmin).
|
|
Fixes #3647.
|