github / github/smimesign

protocol: BER2DER does not handle empty indefinite length objects

Open
#103 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
657
Forks
154
PR merge metrics
No merged PRs in 30d

Description

For indefinite length objects, we check for the terminator here: https://github.com/github/smimesign/blob/3564e86011859c28b315328027abebb954b6bf6f/ietf-cms/protocol/ber.go#L217

However, this does not consider that a SEQUENCE or SET can be potentially empty with indefinite length.
Instead, I think the proper thing is to first check for the termination sequence and only then read the object.
I.e., move the if condition above this line: https://github.com/github/smimesign/blob/3564e86011859c28b315328027abebb954b6bf6f/ietf-cms/protocol/ber.go#L209

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.