Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call BIO_gets in a loop until no more data can be read #79300

Merged
merged 2 commits into from Dec 7, 2022

Conversation

vcsjones
Copy link
Member

@vcsjones vcsjones commented Dec 6, 2022

This changes our use of BIO_gets to read in a loop until there is no more data left to be read. Our current use of BIO_gets assumes it is going to get all of the data in one go.

This however leaves us with an interesting question of what we want to do with the multiline parameter, which we currently ignore in OpenSslAsnFormatter. If you specify "multiline = false" in the Linux implementation, we are going to give you back a string that contains multiple lines, anyway.

We could do something like, "only return up to the first newline, and if you want all of it then you need to pass true". However for some extensions such cRLDistributionPoints, the single-line answer is confusing and unhelpful.

The managed implementation also ignores the multiline parameter, but it also doesn't support anything other than SANs.

Fixes #79265

@ghost
Copy link

ghost commented Dec 6, 2022

Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

This changes our use of BIO_gets to read in a loop until there is no more data left to be read. Our current use of BIO_gets assumes it is going to get all of the data in one go.

This however leaves us with an interesting question of what we want to do with the multiline parameter, which we currently ignore in OpenSslAsnFormatter. If you specify "multiline = false" in the Linux implementation, we are going to give you back a string that contains multiple lines, anyway.

We could do something like, "only return up to the first newline, and if you want all of it then you need to pass true". However for some extensions such cRLDistributionPoints, the single-line answer is confusing and unhelpful.

The managed implementation also ignores the multiline parameter, but it also doesn't support anything other than SANs.

Author: vcsjones
Assignees: vcsjones
Labels:

area-System.Security

Milestone: -

@vcsjones vcsjones marked this pull request as ready for review December 6, 2022 21:26
@vcsjones vcsjones merged commit e22e456 into dotnet:main Dec 7, 2022
@vcsjones vcsjones deleted the fix-79265 branch December 7, 2022 19:34
@ghost ghost locked as resolved and limited conversation to collaborators Jan 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AsnEncodedData.Format return empty for CRL extension in Linux
2 participants