Commit 2ceed71
authored
pkcs5: don't panic on a short DES/3DES IV in PBES2 params (#2383)
The DES-CBC and 3DES-EDE3-CBC arms of the EncryptionScheme parser slice
iv[0..DES_BLOCK_SIZE] before the try_into length check, so an
AlgorithmIdentifier carrying one of those OIDs with an IV octet string
shorter than 8 bytes panics with a slice range error instead of
returning an error. The AES arms already run try_into on the whole
slice, which length-checks gracefully; mirror that in the DES arms.
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>1 parent e330a32 commit 2ceed71
2 files changed
Lines changed: 43 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
547 | | - | |
548 | | - | |
| 546 | + | |
549 | 547 | | |
550 | 548 | | |
551 | 549 | | |
552 | | - | |
553 | | - | |
554 | | - | |
| 550 | + | |
555 | 551 | | |
556 | 552 | | |
557 | 553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
197 | 238 | | |
198 | 239 | | |
199 | 240 | | |
| |||
0 commit comments