Gilles Peskine
984fd07c53
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-09 16:32:08 +02:00
..
2020-11-09 20:44:12 +01:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2021-03-04 14:43:17 +00:00
2021-04-09 16:32:08 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-11-06 15:26:52 +01:00
2020-08-19 16:37:36 +02:00
2020-11-28 12:14:57 -03:00
2021-03-09 16:03:29 +00:00
2021-02-22 19:40:41 +01:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-25 10:58:15 +02:00
2020-08-19 16:37:36 +02:00
2021-01-26 18:04:10 +01:00
2021-01-25 10:36:37 +01:00
2020-12-07 13:06:42 +01:00
2020-08-19 16:37:36 +02:00
2020-10-01 17:17:37 +02:00
2021-03-30 17:33:12 +02:00
2020-11-16 13:07:51 +01:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2021-02-22 19:40:41 +01:00
2019-02-18 14:50:57 +00:00
2020-09-09 15:17:11 +02:00
2020-09-09 15:18:05 +02:00
2020-09-09 15:18:05 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2021-03-01 16:38:02 +01:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-12-07 16:47:02 +00:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-09-09 15:17:11 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-09-22 16:22:27 +02:00
2021-02-02 12:52:18 +01:00
2020-11-13 09:17:16 +00:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-09-09 15:18:05 +02:00
2020-08-19 16:37:36 +02:00
2021-02-22 19:40:41 +01:00
2020-09-09 15:18:05 +02:00
2020-09-09 15:18:05 +02:00
2020-09-09 15:18:05 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-11-18 13:54:38 +01:00
2020-08-19 16:37:36 +02:00
2020-11-28 14:59:56 -03:00
2021-02-22 19:40:41 +01:00
2020-08-19 16:37:36 +02:00
2021-02-17 12:50:52 +00:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-25 10:58:15 +02:00
2020-12-08 21:00:17 +00:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00