summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize/stream.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-05-07 15:36:37 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-05-07 17:00:52 +0200
commit3eb554d0980ae788df2a07df609b77e01b7e57ce (patch)
tree1a36348c4e7dd5ec7b3f83b6ed5d93b80a0e200d /openpgp/src/serialize/stream.rs
parent50b3ed9a61161761f20d134b13c2f8ac07698ea5 (diff)
openpgp: Use a builder to construct Decryptor.
- See #498.
Diffstat (limited to 'openpgp/src/serialize/stream.rs')
-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 b0fccf93..e2ee0f34 100644
--- a/openpgp/src/serialize/stream.rs
+++ b/openpgp/src/serialize/stream.rs
@@ -2985,7 +2985,7 @@ mod test {
}
#[test]
- fn aead_messages() {
+ fn aead_messages() -> Result<()> {
// AEAD data is of the form:
//
// [ chunk1 ][ tag1 ] ... [ chunkN ][ tagN ][ tag ]
@@ -3009,7 +3009,7 @@ mod test {
use crate::parse::{
stream::{
- Decryptor,
+ DecryptorBuilder,
DecryptionHelper,
VerificationHelper,
MessageStructure,
@@ -3103,7 +3103,9 @@ mod test {
let h = Helper { policy: p, tsk: &tsk };
// Note: a corrupted message is only guaranteed
// to error out before it returns EOF.
- let mut v = match Decryptor::from_bytes(p, &msg, h, None) {
+ let mut v = match DecryptorBuilder::from_bytes(&msg)?
+ .with_policy(p, None, h)
+ {
Ok(v) => v,
Err(_) if do_err => continue,
Err(err) => panic!("Decrypting message: {}", err),
@@ -3143,6 +3145,7 @@ mod test {
}
}
}
+ Ok(())
}
#[test]