diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2023-04-26 12:20:46 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2023-04-26 14:59:03 +0200 |
commit | 83700d038e474ac9170938e0eb6c5ad2862b1c52 (patch) | |
tree | ab06e39c8fc2b78038bd6e0f65bf38b01763e751 | |
parent | 3acfaefbb73a6ace1e656b8f5971679e00aab5e7 (diff) |
openpgp: Generalize test.
-rw-r--r-- | openpgp/src/serialize/stream.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs index 41f39ae6..a8d139e1 100644 --- a/openpgp/src/serialize/stream.rs +++ b/openpgp/src/serialize/stream.rs @@ -3994,15 +3994,15 @@ mod test { }; let p = StandardPolicy::new(); - for alg in &[ + for path in [ "rsa", "elg", "cv25519", "cv25519.unclamped", "nistp256", "nistp384", "nistp521", "brainpoolP256r1", "brainpoolP384r1", "brainpoolP512r1", "secp256k1", - ] { - eprintln!("Test vector {:?}...", alg); - let key = Cert::from_bytes(crate::tests::message( - &format!("encrypted/{}.sec.pgp", alg)))?; + ].iter().map(|alg| format!("messages/encrypted/{}.sec.pgp", alg)) + { + eprintln!("Test vector {:?}...", path); + let key = Cert::from_bytes(crate::tests::file(&path))?; if let Some(k) = key.with_policy(&p, None)?.keys().subkeys().supported().next() { @@ -4010,14 +4010,14 @@ mod test { match k.mpis() { PublicKey::ECDH { curve, .. } if ! curve.is_supported() => { eprintln!("Skipping {} because we don't support \ - the curve {}", alg, curve); + the curve {}", path, curve); continue; }, _ => (), } } else { eprintln!("Skipping {} because we don't support the algorithm", - alg); + path); continue; } |