Commit 7eca7c5
In PEM, we need to parse until error and then suppress `PEM_R_NO_START_LINE`, because PEM allows arbitrary leading and trailing data. DER, however, does not. Parsing until error and suppressing `ASN1_R_HEADER_TOO_LONG` doesn't quite work because that error also covers some cases that should be rejected.
Instead, check `BIO_eof` early and stop the loop that way.
(cherry picked from commit acfe02f)
Co-authored-by: David Benjamin <davidben@google.com>
Automerge-Triggered-By: GH:Yhg1s
1 parent d2b2f5e commit 7eca7c5
3 files changed
Lines changed: 10 additions & 4 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1559 | 1559 | | |
1560 | 1560 | | |
1561 | 1561 | | |
| 1562 | + | |
| 1563 | + | |
1562 | 1564 | | |
1563 | 1565 | | |
1564 | 1566 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3978 | 3978 | | |
3979 | 3979 | | |
3980 | 3980 | | |
3981 | | - | |
| 3981 | + | |
3982 | 3982 | | |
3983 | 3983 | | |
3984 | 3984 | | |
| |||
4006 | 4006 | | |
4007 | 4007 | | |
4008 | 4008 | | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + | |
4009 | 4013 | | |
4010 | 4014 | | |
4011 | 4015 | | |
| |||
4041 | 4045 | | |
4042 | 4046 | | |
4043 | 4047 | | |
4044 | | - | |
4045 | | - | |
4046 | | - | |
| 4048 | + | |
4047 | 4049 | | |
4048 | 4050 | | |
4049 | 4051 | | |
| |||
0 commit comments