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

Allow constructed strings in BER parsing #2015

Merged

Conversation

WillChilds-Klein
Copy link
Contributor

Issues:

Addresses CryptoAlg-2494

Description of changes:

This change relaxes a prior restriction forbidding constructed strings when parsing ASN.1 BER. We modify relevant tests accordingly and fix two small errors in PEM fixtures.

kConstructedBitString contained a bit string with invalid padding. We fixed this by zeroing out the final padding byte of each constructed bit string component. kConstructedOctetString' constructed string components were typed as integers (type 0x02) instead of octet strings (type 0x04). For that, we simply change the types to 0x04.

Call-outs:

  • n/a

Testing:

  • existing tests updated to exercise constructed string parsing

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.

This change relaxes a prior restriction forbidding constructed strings
when parsing ASN.1 BER. We modify relevant tests accordingly and fix
two small errors in PEM fixtures.

`kConstructedBitString` contained a bit string with invalid padding. We
fixed this by zeroing out the final padding byte of each constructed bit
string component. `kConstructedOctetString`' constructed string
components were typed as integers (type `0x02`) instead of octet strings
(type `0x04`). For that, we simply change the types to `0x04`.
@WillChilds-Klein WillChilds-Klein marked this pull request as ready for review November 26, 2024 21:35
@WillChilds-Klein WillChilds-Klein requested a review from a team as a code owner November 26, 2024 21:35
@WillChilds-Klein WillChilds-Klein merged commit 2a72226 into aws:main Dec 2, 2024
115 of 119 checks passed
@WillChilds-Klein WillChilds-Klein deleted the allow-constructed-strings branch December 24, 2024 05:02
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.

3 participants