Gilles Peskine
2b3d6a8f28
mbedtls_base64_decode: insist on correct padding
...
Correct base64 input (excluding ignored characters such as spaces) consists
of exactly 4*k, 4*k-1 or 4*k-2 digits, followed by 0, 1 or 2 equal signs
respectively.
Previously, any number of trailing equal signs up to 2 was accepted, but if
there fewer than 4*k digits-or-equals, the last partial block was counted in
`*olen` in buffer-too-small mode, but was not output despite returning 0.
Now `mbedtls_base64_decode()` insists on correct padding. This is
backward-compatible since the only plausible useful inputs that used to be
accepted were inputs with 4*k-1 or 4*k-2 digits and no trailing equal signs,
and those led to invalid (truncated) output. Furthermore the function now
always reports the exact output size in buffer-too-small mode.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-06-09 23:01:21 +02:00
..
2025-03-23 13:09:30 +00:00
2024-01-15 11:45:01 +00:00
2024-02-13 13:41:16 +00:00
2023-11-30 11:01:50 +00:00
2024-12-13 02:10:01 +01:00
2023-11-23 17:43:00 +00:00
2024-02-06 15:00:58 +00:00
2024-01-30 16:28:09 +01:00
2024-02-16 15:26:12 +01:00
2024-01-24 16:26:35 +01:00
2023-11-03 12:21:36 +00:00
2025-06-09 23:01:21 +02:00
2024-09-02 10:30:47 +02:00
2024-09-02 10:42:46 +02:00
2024-09-03 10:10:18 +02:00
2024-08-22 15:00:09 +01:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2024-08-22 15:00:09 +01:00
2023-11-10 12:14:53 +01:00
2024-03-22 14:46:04 -04:00
2023-11-03 12:21:36 +00:00
2023-11-23 10:31:26 +08:00
2024-08-22 16:39:10 +01:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2025-03-05 18:09:05 +00:00
2025-04-18 09:24:36 +02:00
2025-04-18 09:24:36 +02:00
2025-03-28 17:33:45 +00:00
2024-03-19 22:24:40 +00:00
2025-03-18 17:11:54 +00:00
2024-07-17 12:21:21 +02:00
2024-08-06 16:26:41 +01:00
2023-11-03 12:21:36 +00:00
2023-12-01 13:53:45 +00:00
2024-07-17 12:21:21 +02:00
2024-01-17 11:06:31 +00:00
2024-01-18 15:30:46 +01:00
2024-01-18 15:30:46 +01:00
2023-11-03 12:21:36 +00:00
2023-11-21 17:09:46 +00:00
2024-02-29 13:31:34 +00:00
2023-11-03 12:21:36 +00:00
2023-11-21 17:09:46 +00:00
2024-01-29 12:00:15 +01:00
2024-02-07 23:26:27 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2025-01-23 15:31:35 +00:00
2024-05-02 14:27:44 +05:30
2023-11-03 12:21:36 +00:00
2024-03-22 14:46:04 -04:00
2024-03-13 09:55:33 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2024-03-22 14:46:04 -04:00
2023-11-21 17:09:46 +00:00
2024-03-22 14:46:04 -04:00
2025-03-23 13:09:30 +00:00
2023-11-03 12:21:36 +00:00
2024-01-02 13:26:04 +01:00
2023-11-03 12:21:36 +00:00
2024-05-02 18:18:45 +02:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:24:58 +00:00
2023-11-03 12:24:58 +00:00
2023-11-03 12:24:58 +00:00
2023-11-03 12:24:58 +00:00
2023-11-03 12:24:58 +00:00
2023-11-03 12:24:58 +00:00
2024-12-01 10:31:50 +01:00
2024-03-22 14:46:04 -04:00
2024-02-08 14:26:29 +00:00
2023-11-23 10:31:26 +08:00
2023-11-03 12:21:36 +00:00
2025-06-04 10:06:26 +01:00
2024-03-11 09:48:40 +01:00
2024-03-11 09:48:40 +01:00
2024-03-20 15:42:55 +01:00
2023-12-20 12:59:57 +02:00
2024-10-22 13:31:19 +02:00
2023-12-21 16:39:04 +01:00
2024-01-19 09:07:35 +01:00
2023-12-21 16:39:04 +01:00
2024-03-11 09:48:40 +01:00
2024-10-14 10:37:00 +02:00
2024-03-20 17:10:35 +01:00
2024-07-11 17:31:22 +03:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2024-02-28 01:30:24 +01:00
2023-11-03 12:21:36 +00:00
2024-12-24 20:03:29 +01:00
2023-11-03 12:21:36 +00:00
2024-02-26 16:57:30 +01:00
2023-11-03 12:21:36 +00:00
2025-02-21 15:01:04 +01:00
2023-11-03 12:21:36 +00:00
2024-10-30 12:18:16 +01:00
2023-11-03 12:21:36 +00:00
2024-02-28 01:30:24 +01:00
2024-01-26 09:35:18 +01:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2023-12-11 17:58:56 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2024-07-25 18:24:59 +02:00
2024-08-19 11:50:10 +01:00
2024-08-06 13:13:05 +02:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2025-03-11 09:37:29 +01:00
2024-08-09 14:04:46 +02:00
2024-02-28 01:30:24 +01:00
2024-10-22 13:31:19 +02:00
2025-03-14 14:23:23 +00:00
2023-11-21 17:09:46 +00:00
2024-02-29 16:14:29 +01:00
2024-10-28 10:09:18 +01:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2023-12-20 12:59:57 +02:00
2024-02-05 08:48:39 +01:00
2024-08-22 15:00:09 +01:00
2023-11-03 12:21:36 +00:00
2024-03-12 13:14:40 +00:00
2024-08-14 15:22:37 -07:00
2024-01-30 15:31:42 +00:00
2023-11-03 12:21:36 +00:00
2024-01-18 15:08:28 +01:00
2024-01-02 13:27:32 +01:00
2025-02-13 21:24:01 +01:00
2023-11-03 12:21:36 +00:00
2024-03-22 14:46:04 -04:00
2024-03-12 17:48:15 +01:00
2025-04-16 11:20:50 +02:00
2025-04-01 10:39:48 +02:00
2024-03-22 14:46:04 -04:00
2025-04-01 10:39:04 +02:00
2025-04-01 10:39:04 +02:00
2024-12-09 20:16:48 +01:00
2024-08-28 20:48:27 +01:00
2023-11-03 12:21:36 +00:00
2025-04-16 14:35:24 +02:00
2025-04-16 11:24:50 +02:00
2025-03-14 09:21:59 +01:00
2025-04-16 11:24:50 +02:00
2024-11-14 14:19:40 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2025-05-05 16:44:18 +02:00
2024-01-19 09:07:35 +01:00
2024-08-14 15:22:37 -07:00
2024-01-19 09:07:35 +01:00
2024-02-26 13:59:43 +00:00
2024-01-19 09:07:35 +01:00
2025-05-05 16:49:45 +02:00
2025-05-05 16:49:45 +02:00
2024-01-19 09:07:35 +01:00