diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2021-09-23 16:11:24 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2021-09-28 13:46:55 +0200 |
commit | d0f4bd45e6d2c0ffec1dc89c69c7515558f489b1 (patch) | |
tree | 9ef7fe26c15277e8a5f71910a7993b1223bdb526 | |
parent | 7eeba4c3dfccdf4cb11699a6b02d7e73ccd22654 (diff) |
openpgp: Skip test vectors if we don't support the curve.
-rw-r--r-- | openpgp/src/packet/signature.rs | 22 |
1 files changed, 22 insertions, 0 deletions
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() |