From d0f4bd45e6d2c0ffec1dc89c69c7515558f489b1 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 23 Sep 2021 16:11:24 +0200 Subject: openpgp: Skip test vectors if we don't support the curve. --- openpgp/src/packet/signature.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'openpgp') diff --git a/openpgp/src/packet/signature.rs b/openpgp/src/packet/signature.rs index 85cbc9a8..3e46e79e 100644 --- a/openpgp/src/packet/signature.rs +++ b/openpgp/src/packet/signature.rs @@ -3248,6 +3248,17 @@ mod test { continue; } + if let Some(curve) = match cert.primary_key().mpis() { + mpi::PublicKey::EdDSA { curve, .. } => Some(curve), + mpi::PublicKey::ECDSA { curve, .. } => Some(curve), + _ => None, + } { + if ! curve.is_supported() { + eprintln!("Skipping because we don't support {}", curve); + continue; + } + } + let mut good = 0; let mut ppr = PacketParser::from_bytes( crate::tests::message(test.data)).unwrap(); @@ -3322,6 +3333,17 @@ mod test { continue; } + if let Some(curve) = match cert.primary_key().mpis() { + mpi::PublicKey::EdDSA { curve, .. } => Some(curve), + mpi::PublicKey::ECDSA { curve, .. } => Some(curve), + _ => None, + } { + if ! curve.is_supported() { + eprintln!("Skipping because we don't support {}", curve); + continue; + } + } + let mut pair = cert.primary_key().key().clone() .parts_into_secret().unwrap() .into_keypair() -- cgit v1.2.3