diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-08-12 11:02:51 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-08-12 13:34:02 +0200 |
commit | 5a5e909dd1cc5949d1995a7bf48e7ad11ee40e45 (patch) | |
tree | e05041e689a1598097286579cc7e01e9084a7945 /openpgp/src/serialize/stream.rs | |
parent | aeeb728a6dcef2eafa53d3754c67cadd765820a2 (diff) |
openpgp: Improve SKESK?::with_password.
- Previously, the symmetric algorithm argument conflated the
algorithm to protect the payload and the one to protect the
session key. Fix that by adding an argument to make the choice
explicit.
Diffstat (limited to 'openpgp/src/serialize/stream.rs')
-rw-r--r-- | openpgp/src/serialize/stream.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs index 6982f4dc..2ff14398 100644 --- a/openpgp/src/serialize/stream.rs +++ b/openpgp/src/serialize/stream.rs @@ -2523,12 +2523,15 @@ impl<'a> Encryptor<'a> { // Write the SKESK packet(s). for password in self.passwords.iter() { if let Some(aead) = aead.as_ref() { - let skesk = SKESK5::with_password(self.sym_algo, aead.algo, + let skesk = SKESK5::with_password(self.sym_algo, + self.sym_algo, + aead.algo, Default::default(), &sk, password).unwrap(); Packet::SKESK(skesk.into()).serialize(&mut inner)?; } else { let skesk = SKESK4::with_password(self.sym_algo, + self.sym_algo, Default::default(), &sk, password).unwrap(); Packet::SKESK(skesk.into()).serialize(&mut inner)?; |