mirror of
https://github.com/apple/swift-certificates
synced 2026-11-25 04:37:48 +00:00
### Motivation `CMSSignerInfo` could not round-trip `unsignedAttrs`: it serializes them as `[1] IMPLICIT SET` but the DER and BER parsers asked for the inner set with implicit tag `[0]`, so parsing any SignerInfo with unsigned attributes threw `unexpectedFieldType: [1]`. ### Changes Fixes issue #306 by: - Correcting the `unsignedAttrs` inner set identifier from `[0]` to `[1]` in the DER and BER initializers of `CMSSignerInfo`. - Adding a round-trip unit test for a `CMSSignerInfo` carrying `unsignedAttrs`. ### Result `unsignedAttrs` now round-trip correctly; no behavior change to the (already correct) serialized output.