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

chore: simpler ber2der with length check #40

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

Conversation

ibukanov
Copy link

@ibukanov ibukanov commented Feb 1, 2025

Do not build an intermediate tree presentation of BER format in ber2der. Rather write the data directly to the output array patching the length header as necessary.

Protect against int32 overflow on 32-bit CPU when calculating the BER content length.

Detect and report invalid BER when a fixed length of the sequence does not match the actual length of children.

Name of feature:

Stricter definite length handling in BER data.

Pain or issue this feature alleviates:

Invalid BER data generator can be detected.

Why is this important to the project (if not answered above):

Is there documentation on how to use this feature? If so, where?

In what environments or workflows is this feature supported?

In what environments or workflows is this feature explicitly NOT supported (if any)?

Supporting links/other PRs/issues:

💔Thank you!

Do not build an intermediate tree presentation of BER format in ber2der. Rather
write the data directly to the output array patching the length header as
necessary.

Protect against int32 overflow on 32-bit CPU when calculating the BER content
length.

Detect and report invalid BER when a fixed length of the sequence does not match
the actual length of children.
@hslatman
Copy link
Member

Hey @ibukanov, thank you for working on this. This looks like a great improvement! I need some time to grok it all for proper review 😅

@hslatman hslatman self-assigned this Feb 12, 2025
@hslatman hslatman self-requested a review February 12, 2025 10:50
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