Andre Goddard Rosa
3711734a0a
Add invalid padding_len
check in get_pkcs_padding
...
When trying to decrypt data with an invalid key, we found that `mbedtls`
returned `0x6200` (`-25088`), which means "_CIPHER - Input data contains
invalid padding and is rejected_" from `mbedtls_cipher_finish`, but it also
set the output len as `18446744073709551516`.
In case we detect an error with padding, we leave the output len zero'ed
and return `MBEDTLS_ERR_CIPHER_INVALID_PADDING`.
Here's a reference for the way `openssl` checks the padding length:
- 1848c561ec/crypto/evp/evp_enc.c (L1023)
- b554eef43b
So add a check ensuring output is set to the least-harmful value in the
error cases.
With the robustness fix:
`PASSED (125 suites, 26644 tests run)`
Without the robustness fix:
`FAILED (125 suites, 26644 tests run)`
Signed-off-by: Andre Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Andre Goddard Rosa <agoddardrosa@roku.com>
2024-05-13 09:27:57 -05:00
..
2024-03-27 17:36:15 +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
2023-12-19 13:11:47 +00: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
2023-11-21 17:09:46 +00:00
2024-03-11 10:39:57 +00:00
2024-03-11 10:03:05 +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-03-11 15:28:48 +00:00
2023-11-10 12:14:53 +01:00
2023-12-28 18:33:17 +01:00
2023-11-03 12:21:36 +00:00
2023-11-23 10:31:26 +08:00
2024-01-08 08:07:53 +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-01-02 17:20:58 +01:00
2023-11-23 10:31:26 +08:00
2024-05-13 09:27:57 -05:00
2024-03-19 22:24:40 +00:00
2024-03-29 13:59:36 +00:00
2024-01-23 10:05:08 +00:00
2023-11-27 11:28:30 +00:00
2023-11-03 12:21:36 +00:00
2023-12-01 13:53:45 +00:00
2024-01-16 17:28:25 +00: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
2024-02-28 14:18:28 +01:00
2024-05-02 14:27:44 +05:30
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00: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
2023-11-21 17:09:46 +00:00
2023-11-21 17:09:46 +00:00
2024-02-13 13:41:16 +00:00
2024-03-27 17:36:15 +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
2023-12-08 21:51:15 +00:00
2023-11-03 12:21:36 +00: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
2024-02-20 10:22:36 +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-04-17 05:28:36 +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-02-28 13:19:42 +01:00
2024-03-20 17:10:35 +01:00
2024-02-06 17:29:38 +00: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-03-12 15:05:06 +00: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
2024-03-14 13:28:35 +01:00
2023-11-03 12:21:36 +00:00
2024-03-05 09:59:24 +00: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-02-28 06:48:49 +01:00
2024-02-28 01:30:24 +01:00
2024-02-26 08:50:38 +01:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2024-04-30 14:09:43 +01:00
2024-04-30 14:09:43 +01:00
2024-02-28 01:30:24 +01:00
2024-03-05 14:06:02 +00:00
2024-05-02 16:06:09 +00:00
2023-11-21 17:09:46 +00:00
2024-02-29 16:14:29 +01:00
2024-02-29 16:14:29 +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-03-11 11:34:58 +01:00
2023-11-03 12:21:36 +00:00
2024-03-12 13:14:40 +00:00
2024-05-02 14:27:44 +05:30
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
2024-03-14 15:05:09 +01:00
2023-11-03 12:21:36 +00:00
2024-01-02 13:27:32 +01:00
2024-03-12 17:48:15 +01:00
2024-03-13 16:50:01 +00:00
2024-04-05 14:16:32 +02:00
2024-03-08 16:35:04 +01:00
2024-02-21 09:38:46 +00:00
2024-03-08 07:38:39 +00:00
2024-04-05 14:16:31 +02:00
2024-04-02 14:52:29 +01:00
2023-11-03 12:21:36 +00:00
2024-02-05 15:09:15 +00:00
2023-11-03 12:24:58 +00:00
2024-04-05 14:16:31 +02:00
2024-04-05 14:16:32 +02:00
2024-03-12 15:36:57 +00:00
2023-11-03 12:21:36 +00:00
2023-11-03 12:21:36 +00:00
2024-01-22 15:31:05 +00:00
2024-01-19 09:07:35 +01:00
2024-03-04 02:22:01 +00: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
2024-02-05 15:09:15 +00:00
2024-02-05 15:09:15 +00:00
2024-01-19 09:07:35 +01:00