Gilles Peskine 80f56733b0 Fix and simplify sign handling in mbedtls_mpi_read_string
Move the handling of the sign out of the base-specific loops. This
both simplifies the code, and corrects an edge case: the code in the
non-hexadecimal case depended on mbedtls_mpi_mul_int() preserving the
sign bit when multiplying a "negative zero" MPI by an integer, which
used to be the case but stopped with PR #2512.

Fix #4295. Thanks to Guido Vranken for analyzing the cause of the bug.
Credit to OSS-Fuzz.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-04-04 01:10:07 +02:00
..
2021-03-04 14:34:50 +00:00
2021-01-29 11:09:50 +01:00
2021-03-10 23:44:28 +01:00
2020-11-16 15:02:16 +01:00
2021-02-23 20:29:38 +01:00
2021-03-29 14:20:18 +01:00
2021-03-29 14:20:18 +01:00
2021-03-29 14:20:18 +01:00
2021-03-29 14:20:18 +01:00
2020-09-22 11:57:16 +02:00
2020-11-25 13:10:50 +01:00
2020-11-25 13:10:50 +01:00
2021-02-22 19:24:03 +01:00
2021-03-10 18:17:12 +00:00
2021-03-05 14:24:03 +00:00
2020-09-01 11:04:53 +02:00