diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2023-10-02 12:14:57 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2023-10-02 12:14:57 +0200 |
commit | f12bc77a76631579d1e102c5882b1964745c3d60 (patch) | |
tree | 9c3658b175b8c1f394c854c3518454ec51667c71 /openpgp/src | |
parent | f9b4a6bde0edef6557233b0e7d3a80bb26e3085a (diff) |
openpgp: Test that v3 revocation signatures are honored.
- Fixes #954.
Diffstat (limited to 'openpgp/src')
-rw-r--r-- | openpgp/src/cert.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs index fd5f5d0d..e1ba1b6a 100644 --- a/openpgp/src/cert.rs +++ b/openpgp/src/cert.rs @@ -7286,4 +7286,25 @@ Pu1xwz57O4zo1VYf6TqHJzVC3OMvMUM2hhdecMUe5x6GorNaj6g= Ok(()) } + + /// Tests v3 revocation signatures. + #[test] + fn v3_revocation_signature() -> Result<()> { + if ! crate::types::PublicKeyAlgorithm::ECDSA.is_supported() + || ! crate::types::Curve::NistP521.is_supported() + { + eprintln!("Skipping because ECDSA/NistP521 is not supported"); + return Ok(()); + } + + let c = Cert::from_bytes( + crate::tests::key("v4-revoked-by-v3.pgp"))?; + assert_eq!(c.bad_signatures().count(), 0); + + let sp = crate::policy::StandardPolicy::new(); + assert!(matches!(c.revocation_status(&sp, None), + RevocationStatus::Revoked(_))); + + Ok(()) + } } |