fix: implement manual PKCS#7 signature verification#205
Closed
bryan-anthropic wants to merge 1 commit intomainfrom
Closed
fix: implement manual PKCS#7 signature verification#205bryan-anthropic wants to merge 1 commit intomainfrom
bryan-anthropic wants to merge 1 commit intomainfrom
Conversation
Replace non-functional node-forge p7.verify() with manual PKCS#7 verification. node-forge throws "not yet implemented" on verify(), causing mcpb verify to always report unsigned status. The fix manually verifies the message digest in authenticated attributes matches the content hash, then verifies the RSA signature over the authenticated attributes using the certificate's public key. Also fixes self-signed certificate detection to correctly report "self-signed" status even when chain validation fails. Original fix by Joan Xie. Co-Authored-By: Joan Xie <joan@anthropic.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 #21.
node-forge'sp7.verify()method is not implemented, causingmcpb verifyto always report "unsigned" status."self-signed"status for cryptographically valid self-signed signatures (previously returned"unsigned").Original fix by Joan Xie. Clean cherry-pick onto current main (original branch had trivial rebase conflict in test formatting).
Test plan
yarn build:codecompiles cleanly"self-signed"instead of"unsigned"🤖 Generated with Claude Code