Commit 129667d
gh-100372: Use BIO_eof to detect EOF for SSL_FILETYPE_ASN1 (GH-100373)
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)
Automerge-Triggered-By: GH:Yhg1s
Co-authored-by: David Benjamin <davidben@google.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 1071290 commit 129667d
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 | |
|---|---|---|---|
| |||
1533 | 1533 | | |
1534 | 1534 | | |
1535 | 1535 | | |
| 1536 | + | |
| 1537 | + | |
1536 | 1538 | | |
1537 | 1539 | | |
1538 | 1540 | | |
| |||
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 | |
|---|---|---|---|
| |||
3961 | 3961 | | |
3962 | 3962 | | |
3963 | 3963 | | |
3964 | | - | |
| 3964 | + | |
3965 | 3965 | | |
3966 | 3966 | | |
3967 | 3967 | | |
| |||
3989 | 3989 | | |
3990 | 3990 | | |
3991 | 3991 | | |
| 3992 | + | |
| 3993 | + | |
| 3994 | + | |
| 3995 | + | |
3992 | 3996 | | |
3993 | 3997 | | |
3994 | 3998 | | |
| |||
4024 | 4028 | | |
4025 | 4029 | | |
4026 | 4030 | | |
4027 | | - | |
4028 | | - | |
4029 | | - | |
| 4031 | + | |
4030 | 4032 | | |
4031 | 4033 | | |
4032 | 4034 | | |
| |||
0 commit comments