summaryrefslogtreecommitdiffstats
path: root/openpgp/src/packet/signature.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/packet/signature.rs
parent80d68b09494b6ba2c295a38fcedc9447512d2423 (diff)
openpgp: Skip tests if a required algorithm is not supported.
Diffstat (limited to 'openpgp/src/packet/signature.rs')
-rw-r--r--openpgp/src/packet/signature.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/openpgp/src/packet/signature.rs b/openpgp/src/packet/signature.rs
index 9178f76f..ef5f4b8d 100644
--- a/openpgp/src/packet/signature.rs
+++ b/openpgp/src/packet/signature.rs
@@ -3243,6 +3243,11 @@ mod test {
let cert = Cert::from_bytes(crate::tests::key(test.key)).unwrap();
+ if ! cert.keys().all(|k| k.pk_algo().is_supported()) {
+ eprintln!("Skipping because one algorithm is not supported");
+ continue;
+ }
+
let mut good = 0;
let mut ppr = PacketParser::from_bytes(
crate::tests::message(test.data)).unwrap();
@@ -3310,6 +3315,12 @@ mod test {
"emmelie-dorothea-dina-samantha-awina-ed25519-private.pgp",
] {
let cert = Cert::from_bytes(crate::tests::key(key)).unwrap();
+
+ if ! cert.primary_key().pk_algo().is_supported() {
+ eprintln!("Skipping because we don't support the algo");
+ continue;
+ }
+
let mut pair = cert.primary_key().key().clone()
.parts_into_secret().unwrap()
.into_keypair()
@@ -3477,6 +3488,11 @@ mod test {
#[test]
fn timestamp_signature() {
+ if ! PublicKeyAlgorithm::DSA.is_supported() {
+ eprintln!("Skipping test, algorithm is not supported.");
+ return;
+ }
+
let alpha = Cert::from_bytes(crate::tests::file(
"contrib/gnupg/keys/alpha.pgp")).unwrap();
let p = Packet::from_bytes(crate::tests::file(