Skip to content

Make ASN1_get_object a direct call #2332

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samuel40791765
Copy link
Contributor

Description of changes:

eafd940 made all calls to ASN1 parsers able to parse indefinite length BER. This work to do this was easier thanks to cfe86a3, but this also removes the need for the divergent logic in asn1_get_object_maybe_indefinite.

Call-outs:

N/A

Testing:

N/A

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@samuel40791765 samuel40791765 requested a review from a team as a code owner April 14, 2025 21:08
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.76%. Comparing base (d1c1d72) to head (a53bfad).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2332      +/-   ##
==========================================
- Coverage   78.77%   78.76%   -0.01%     
==========================================
  Files         620      620              
  Lines      107874   107872       -2     
  Branches    15323    15322       -1     
==========================================
- Hits        84977    84965      -12     
- Misses      22239    22252      +13     
+ Partials      658      655       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

int indefinite_ok) {
// |ASN1_get_object| parses an ASN.1 header, including tag, class, and length
// information. The tag number is written to |*out_tag|. The class is written to
// |*out_class|. If the tag is not indefinite, the content length is written to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: might want to document that this gets set to 0 if tag is indefinite.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this would align with what's documented for the BSDs:

... If the length octet indicates the indefinite form, *plength is set to 0.

int indefinite_ok) {
// |ASN1_get_object| parses an ASN.1 header, including tag, class, and length
// information. The tag number is written to |*out_tag|. The class is written to
// |*out_class|. If the tag is not indefinite, the content length is written to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this would align with what's documented for the BSDs:

... If the length octet indicates the indefinite form, *plength is set to 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants