Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-100372: Use BIO_eof to detect EOF for SSL_FILETYPE_ASN1#100373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
miss-islington merged 2 commits intopython:mainfromdavidben:der-eof
Mar 24, 2023

Conversation

@davidben
Copy link
Contributor

@davidbendavidben commentedDec 20, 2022
edited by miss-islington
Loading

In PEM, we need to parse until error and then suppressPEM_R_NO_START_LINE, because PEM allows arbitrary leading and trailing data. DER, however, does not. Parsing until error and suppressingASN1_R_HEADER_TOO_LONG doesn't quite work because that error also covers some cases that should be rejected.

Instead, checkBIO_eof early and stop the loop that way.

Automerge-Triggered-By: GH:Yhg1s

In PEM, we need to parse until error and then suppressPEM_R_NO_START_LINE, because PEM allows arbitrary leading and trailingdata. DER, however, does not. Parsing until error and suppressingASN1_R_HEADER_TOO_LONG doesn't quite work because that error alsocovers some cases that should be rejected.Instead, check BIO_eof early and stop the loop that way.
@davidben
Copy link
ContributorAuthor

@tiran This PR look reasonable? Anything missing on my end?

@Yhg1sYhg1s self-requested a reviewMarch 24, 2023 12:36
@Yhg1s
Copy link
Member

I don't think this is a security issue, or at least not serious enough to backport to security-only releases. Do you disagree,@davidben, or is there a security angle I'm missing?

I'm not sure if this should be backported to 3.11/3.10 either. It's a bug, but it doesn't feel important enough to backport and risk breaking users who rely on the old broken behaviour.

@miss-islington
Copy link
Contributor

Status check is done, and it's a success ✅.

@miss-islingtonmiss-islington merged commitacfe02f intopython:mainMar 24, 2023
@davidben
Copy link
ContributorAuthor

Do you disagree,@davidben, or is there a security angle I'm missing?

Nah, can't think of any security angle. Just generally improving behavior and reducing dependency on OpenSSL error codes. (Conditioning on OpenSSL error codes can be a bit messy. Sometimes you have to, like the PEM case here, but other times the error codes don't correspond enough to clear, stable conditions to condition on. :-( )

Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull requestMar 27, 2023
…honGH-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.Automerge-Triggered-By: GH:Yhg1s
warsaw pushed a commit to warsaw/cpython that referenced this pull requestApr 11, 2023
…honGH-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.Automerge-Triggered-By: GH:Yhg1s
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Yhg1sYhg1sYhg1s approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@davidben@Yhg1s@miss-islington@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp