diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2023-08-24 09:56:56 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2023-08-24 11:10:33 +0200 |
commit | 161d6aa9afe5d3bcd95b735c4fe80092fb6c3915 (patch) | |
tree | 9abdda8e5696a3d715022c58f3d5ad864b5c9d48 | |
parent | 1817d2a71f80a33fd7345a5a15827acb90c2894f (diff) |
net: Use the new crypto::ecdh::decrypt_unwrap2.
-rw-r--r-- | net/src/pks.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/src/pks.rs b/net/src/pks.rs index f1bbc6bd..479a3c5a 100644 --- a/net/src/pks.rs +++ b/net/src/pks.rs @@ -266,7 +266,7 @@ impl Decryptor for PksClient { fn decrypt( &mut self, ciphertext: &mpi::Ciphertext, - _plaintext_len: Option<usize>, + plaintext_len: Option<usize>, ) -> openpgp::Result<SessionKey> { match (ciphertext, self.public.mpis()) { (mpi::Ciphertext::RSA { c }, mpi::PublicKey::RSA { .. }) => @@ -275,7 +275,8 @@ impl Decryptor for PksClient { (mpi::Ciphertext::ECDH { e, .. }, mpi::PublicKey::ECDH { .. }) => { #[allow(non_snake_case)] let S = self.make_request(e.value().to_vec(), "application/vnd.pks.ecdh.point")?.into(); - Ok(ecdh::decrypt_unwrap(&self.public, &S, ciphertext)?) + Ok(ecdh::decrypt_unwrap2(&self.public, &S, ciphertext, + plaintext_len)?) }, (ciphertext, public) => Err(openpgp::Error::InvalidOperation(format!( "unsupported combination of key pair {:?} \ |