Fix CMSSignerInfo's unsignedAttrs tag - #307
Open
emaloney wants to merge 1 commit into
Open
Conversation
This was referenced Jul 16, 2026
|
Neat - I have the exact fix on my vendored copy I was eventually going to submit |
Contributor
|
@emaloney Can you apply the license headers to the test file please? |
emaloney
force-pushed
the
fix-cmssignerinfo-unsignedattrs-tag
branch
from
July 28, 2026 13:11
1daa902 to
8dbf97b
Compare
In order to make `pkg-signer*` work, we needed to make some changes to `swift-certificates` exposing certain entities publicly and adding trusted timestamp support to CMS.
emaloney
force-pushed
the
fix-cmssignerinfo-unsignedattrs-tag
branch
from
July 28, 2026 13:11
8dbf97b to
24a5816
Compare
Author
|
@Lukasa pushed an update adding the requested header to the test file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
CMSSignerInfocould not round-tripunsignedAttrs: it serializes them as[1] IMPLICIT SETbut the DER and BER parsers asked for the inner set with implicit tag[0], so parsing any SignerInfo with unsigned attributes threwunexpectedFieldType: [1].Changes
Fixes issue #306 by:
unsignedAttrsinner set identifier from[0]to[1]in the DER and BER initializers ofCMSSignerInfo.CMSSignerInfocarryingunsignedAttrs.Result
unsignedAttrsnow round-trip correctly; no behavior change to the (already correct) serialized output.