Repository navigation
Commit e476a92
authored
pkcs1: reject an empty
RFC 8017 A.1.2:
OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo
otherPrimeInfos ... SHALL be omitted if version is 0 and SHALL
contain at least one instance of OtherPrimeInfo if version is 1.
The decoder checked that `otherPrimeInfos` is present exactly when the
version is multi (#111, #115), but accepted an empty `SEQUENCE {}`, so a
version-1 key with no additional primes decoded as `Version::Multi` with
`Some(vec![])`. pyca/cryptography's rust-asn1 schema declares the same
field as `SequenceOf<.., 1>` and rejects it.
Reject an empty `otherPrimeInfos` on decode.otherPrimeInfos (#2457)1 parent 2c0b0f9 commit e476a92
2 files changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
136 | 149 | | |
137 | 150 | | |
138 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
205 | 215 | | |
206 | 216 | | |
207 | 217 | | |
| |||
0 commit comments