Verify signed MCPB bundles#286
Open
jstar0 wants to merge 1 commit into
Open
Conversation
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.
Summary
Fixes
mcpb verifyreporting freshly signed bundles as unsigned.verifyMcpbFileparsed the embedded PKCS#7 SignedData with node-forge and then calledp7.verify(), but node-forge does not implement PKCS#7 verification. That made valid signed bundles fall through to{ status: "unsigned" }.This change verifies detached CMS signatures with platform tooling instead:
System.Security.Cryptography.Pkcs.SignedCms.openssl cms -verify -noverify -binary.Refs #277.
Motivation and Context
Signing currently breaks the end-to-end publisher workflow in two ways:
mcpb signcan produce a bundle with a signature block, butmcpb verifyreports that same bundle as unsigned. The failure happens because node-forge parses the PKCS#7 SignedData but does not implement the verification method being called.Changes
p7.verify()method.self-signed, notunsigned.How Has This Been Tested?
The focused signing e2e test fails before the implementation because the self-signed bundle verifies as
unsigned; it passes after the change.Verification
Breaking Changes
None expected. This keeps the existing signature block format and status values.
Types of changes
Checklist
Additional context
I could not execute the Windows
SignedCmsbranch on this macOS host. The macOS/Linux OpenSSL branch is covered by the signing e2e tests, and the Windows branch is covered by TypeScript build/lint.