summaryrefslogtreecommitdiffstats
path: root/openpgp/src/cert.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-09-09 14:06:15 +0200
committerJustus Winter <justus@sequoia-pgp.org>2021-09-16 12:51:18 +0200
commitf65f9caac78f4ab34770d13f8b45ef41d1ff707d (patch)
tree0171c89dd3482321ac31c1d5a3ffa3c595da5b8a /openpgp/src/cert.rs
parent80d68b09494b6ba2c295a38fcedc9447512d2423 (diff)
openpgp: Skip tests if a required algorithm is not supported.
Diffstat (limited to 'openpgp/src/cert.rs')
-rw-r--r--openpgp/src/cert.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs
index 686821d6..1da3390e 100644
--- a/openpgp/src/cert.rs
+++ b/openpgp/src/cert.rs
@@ -5503,6 +5503,11 @@ Pu1xwz57O4zo1VYf6TqHJzVC3OMvMUM2hhdecMUe5x6GorNaj6g=
CipherSuite::P521,
CipherSuite::RSA2k ]
{
+ if cs.is_supported().is_err() {
+ eprintln!("Skipping {:?} because it is not supported.", cs);
+ continue;
+ }
+
let (alice, _) = CertBuilder::new()
.set_cipher_suite(*cs)
.add_userid("alice@foo.com")
@@ -5672,6 +5677,11 @@ Pu1xwz57O4zo1VYf6TqHJzVC3OMvMUM2hhdecMUe5x6GorNaj6g=
#[test]
fn canonicalize_with_v3_sig() -> Result<()> {
+ if ! crate::types::PublicKeyAlgorithm::DSA.is_supported() {
+ eprintln!("Skipping because DSA is not supported");
+ return Ok(());
+ }
+
// This test relies on being able to validate SHA-1
// signatures. The standard policy rejects SHA-1. So, use a
// custom policy.