diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-04-27 16:13:33 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-04-27 16:13:33 +0200 |
commit | 3accc10973272de29f098c5db11951a122238d99 (patch) | |
tree | 6739d6f57b41173c78559f5aed84352fd6d9756e | |
parent | 7bab02dd6337fa0070734e2eba09a267c69c1221 (diff) |
openpgp: Fix tests when building without compression support.
- Fixes #495.
-rw-r--r-- | openpgp/src/parse.rs | 2 | ||||
-rw-r--r-- | openpgp/src/policy.rs | 4 | ||||
-rw-r--r-- | openpgp/tests/data/messages/encrypted-to-testy-no-compression.gpg | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs index c8c42a29..cfcb6b3b 100644 --- a/openpgp/src/parse.rs +++ b/openpgp/src/parse.rs @@ -4264,6 +4264,7 @@ mod test { // signed. But what makes these particularly complex is the // use of an indeterminate length encoding, which checks the // buffered_reader::Reserve hack. + #[cfg(feature = "compression-deflate")] DecryptTest { filename: "seip/msg-compression-not-signed-password-123.pgp", algo: SymmetricAlgorithm::AES128, @@ -4277,6 +4278,7 @@ mod test { (Tag::MDC, &[ 1, 1 ]), ], }, + #[cfg(feature = "compression-deflate")] DecryptTest { filename: "seip/msg-compression-signed-password-123.pgp", algo: SymmetricAlgorithm::AES128, diff --git a/openpgp/src/policy.rs b/openpgp/src/policy.rs index 29daed81..884cc702 100644 --- a/openpgp/src/policy.rs +++ b/openpgp/src/policy.rs @@ -1846,14 +1846,14 @@ mod test { let p = &P::new(); Decryptor::from_bytes( - p, crate::tests::message("encrypted-to-testy.gpg"), + p, crate::tests::message("encrypted-to-testy-no-compression.gpg"), Helper {}, crate::frozen_time()).unwrap(); // Reject the AES256. let p = &mut P::new(); p.reject_symmetric_algo(SymmetricAlgorithm::AES256); let r = Decryptor::from_bytes( - p, crate::tests::message("encrypted-to-testy.gpg"), + p, crate::tests::message("encrypted-to-testy-no-compression.gpg"), Helper {}, crate::frozen_time()); match r { Ok(_) => panic!(), diff --git a/openpgp/tests/data/messages/encrypted-to-testy-no-compression.gpg b/openpgp/tests/data/messages/encrypted-to-testy-no-compression.gpg new file mode 100644 index 00000000..d6920e38 --- /dev/null +++ b/openpgp/tests/data/messages/encrypted-to-testy-no-compression.gpg @@ -0,0 +1 @@ +If&2VGUp4
SE`<,yu14#xs1]D2EO</E@o'e#"F t Ѝ]ۙU"+wQQ*@;&p zjע7,{P{߾
`M?Q)I@\D*7&9{;g@>YۻfoC,X-]HqY%_RlLEwu."ys'E*h$qe;n,pK>l+UYqX v31ϲGo&Po?̈́1|U&%L
\ No newline at end of file |