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

fix(per): encoding extensible string types #179

Merged
merged 3 commits into from
Oct 19, 2023

Conversation

6d7a
Copy link
Member

@6d7a 6d7a commented Oct 17, 2023

This PR fixes a couple of issues with PER-encoding extensible string types, such as BIT STRING, OCTET STRING or VisibleString. Before, extensible string types were in some cases encoded with a duplicate extension marker, in some cases with a wrong length determinant.
I also refactored the string encoders so that extension bits are always written using the encode_extensible_bit function, and removed some code duplication by having encode_length call the encode_string_length function, which is largely identical.

@XAMPPRocky
Copy link
Collaborator

Thank you for your PR! Could you add some test cases for this, to prevent future regressions?

@6d7a
Copy link
Member Author

6d7a commented Oct 17, 2023

Sure, will do.

@XAMPPRocky
Copy link
Collaborator

Thank you for your PR!

@XAMPPRocky XAMPPRocky merged commit c853738 into librasn:main Oct 19, 2023
65 checks passed
@6d7a 6d7a deleted the feat/extensible-bitstrings branch April 16, 2024 09:26
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.

2 participants