summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2022-01-10 16:28:21 +0100
committerJustus Winter <justus@sequoia-pgp.org>2022-01-10 16:28:21 +0100
commitac929340927287d5899133db5fd41fbc212b55a1 (patch)
treea087f26cd899eef63e4f58efb9a6b6213781408a
parent12d6dd030bdc4423c147f78d3d73fa0ee1d43acd (diff)
openpgp: Generalize test.
-rw-r--r--openpgp/src/serialize/stream.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs
index 09abac17..1bd4f047 100644
--- a/openpgp/src/serialize/stream.rs
+++ b/openpgp/src/serialize/stream.rs
@@ -3391,7 +3391,11 @@ mod test {
}
#[test]
- fn aead_messages() -> Result<()> {
+ fn aead_eax() -> Result<()> {
+ test_aead_messages(AEADAlgorithm::EAX)
+ }
+
+ fn test_aead_messages(algo: AEADAlgorithm) -> Result<()> {
// AEAD data is of the form:
//
// [ chunk1 ][ tag1 ] ... [ chunkN ][ tagN ][ tag ]
@@ -3422,7 +3426,6 @@ mod test {
},
};
use crate::cert::prelude::*;
- use crate::serialize::stream::{LiteralWriter, Message};
let (tsk, _) = CertBuilder::new()
.set_cipher_suite(CipherSuite::Cv25519)
@@ -3480,7 +3483,7 @@ mod test {
.keys().with_policy(p, None)
.for_storage_encryption().for_transport_encryption();
let encryptor = Encryptor::for_recipients(m, recipients)
- .aead_algo(AEADAlgorithm::EAX)
+ .aead_algo(algo)
.build().unwrap();
let mut literal = LiteralWriter::new(encryptor).build()
.unwrap();