Andre Goddard Rosa
30666d478b
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`. I believe that the current
test cases are sufficient, as they fail if I return the alternative code
`MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA`, so they do already expect a padding
failure, but now we don't change the output len in the error case.
Here's a reference for the way `openssl` checks the padding length:
- 1848c561ec/crypto/evp/evp_enc.c (L1023)
- b554eef43b
Signed-off-by: Andre Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Andre Goddard Rosa <agoddardrosa@roku.com>
2024-05-01 12:02:14 -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-01 12:02:14 -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-01-30 14:50:23 +01:00
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
2023-11-03 12:21:36 +00: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-29 09:25:37 +00: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-03-15 13:34:01 +00:00
2024-02-21 13:55:12 +00:00
2024-02-28 01:30:24 +01:00
2024-03-05 14:06:02 +00:00
2024-04-26 18:47:40 +01: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
2023-11-30 09:34:41 +00: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
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-02 17:46:52 +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-03-27 08:22:53 +01:00
2024-04-02 14:51:47 +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-08 08:56:17 +00:00
2024-04-08 08:56:17 +00: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