fix: reject revoked signers after decrypt and verify#24
Open
kushaldas wants to merge 4 commits into
Open
Conversation
Centralize decrypt-and-verify signature classification for software and card-backed paths. Downgrade cryptographically valid signatures to Bad when the primary certificate or exact verifier subkey is revoked. Add regression coverage for sign-before-revocation messages and confirm that revocation of an unrelated subkey does not invalidate a valid signer. Update the public Good outcome documentation to require a non-revoked signer.
There was a problem hiding this comment.
Pull request overview
This PR centralizes decrypt-and-verify signature classification so both software and card-backed decryption paths apply the same trust policy, specifically downgrading otherwise-cryptographically-valid signatures to non-trusted outcomes when the signer is revoked.
Changes:
- Added a shared signature-classification helper that normalizes signer identifiers and applies a consistent revocation policy.
- Updated
Goodoutcome documentation to require a non-revoked signer. - Added regression tests for “signed before revocation” scenarios and for revocation scoping to the actual verifying key.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reuse exact issuer matching and signer revocation checks across decrypt and verify paths. Add documented shared test helpers and an end-to-end regression for revocation of the selected signing subkey.
| pub mod error; | ||
| pub mod key; | ||
| pub mod paths; | ||
| mod revocation; |
Comment on lines
328
to
331
| use super::*; | ||
| use crate::revocation::test_support::{parse_secret_key, revoke_subkey}; | ||
| use pgp::types::KeyDetails; | ||
| use wecanencrypt::{create_key_simple, encrypt_bytes, sign_and_encrypt_to_multiple, KeyStore}; |
Comment on lines
+329
to
+330
| use crate::revocation::test_support::{parse_secret_key, revoke_subkey}; | ||
| use pgp::types::KeyDetails; |
| use pgp::composed::{Deserializable, SignedSecretKey, SignedSecretSubKey}; | ||
| use pgp::packet::{SignatureConfig, SignatureType, Subpacket, SubpacketData}; | ||
| use pgp::ser::Serialize; | ||
| use pgp::types::{KeyDetails, KeyVersion, Password, Timestamp}; |
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.
Centralize decrypt-and-verify signature classification for software and card-backed paths. Downgrade cryptographically valid signatures to Bad when the primary certificate or exact verifier subkey is revoked.
Add regression coverage for sign-before-revocation messages and confirm that revocation of an unrelated subkey does not invalidate a valid signer. Update the public Good outcome documentation to require a non-revoked signer.