diff options
author | Neal H. Walfield <neal@pep.foundation> | 2023-06-06 22:40:35 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2023-09-21 17:40:24 +0200 |
commit | 7adca50f172bc1d4d983231a8682d252f6c2fadc (patch) | |
tree | 9d50b6f19c49e27a4aae962815e210db8942372e /autocrypt | |
parent | 12ab3a71a7842c1751632bccaa38a7149be9882b (diff) |
openpgp: Fix Encryptor's lifetime parameter.
- `Encryptor` uses a single lifetime for two fields, which is too
restrictive in some situations.
- To avoid breaking the API, introduce `Encryptor2`, which is just
`Encryptor` renamed, and with an added lifetime parameter, and make
`Encryptor` a thin wrapper around `Encryptor2`.
- Deprecate `Encryptor`.
- See #1028.
Diffstat (limited to 'autocrypt')
-rw-r--r-- | autocrypt/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/autocrypt/src/lib.rs b/autocrypt/src/lib.rs index d75649da..b76c4208 100644 --- a/autocrypt/src/lib.rs +++ b/autocrypt/src/lib.rs @@ -37,7 +37,7 @@ use openpgp::parse::{ }; use openpgp::serialize::Serialize; use openpgp::serialize::stream::{ - Message, LiteralWriter, Encryptor, + Message, LiteralWriter, Encryptor2, }; use openpgp::crypto::Password; use openpgp::policy::Policy; @@ -526,7 +526,7 @@ impl AutocryptSetupMessage { { // Passphrase-Format header with value numeric9x4 let m = Message::new(&mut armor_writer); - let m = Encryptor::with_passwords( + let m = Encryptor2::with_passwords( m, vec![self.passcode.clone().unwrap()]).build()?; let m = LiteralWriter::new(m).build()?; |