summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/asymmetric.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-06-24 14:59:17 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-06-24 17:57:53 +0200
commitf031c7ae99ee0439f83259466d83d83eca912a14 (patch)
tree45a57e93f7742dce90383e4c3d5ce313c15438ac /openpgp/src/crypto/asymmetric.rs
parent0d2e6c904dff8f13fd5f5360da4ff6ef79fca9a8 (diff)
openpgp: Use SessionKey to protect secrets during ECDH.
Diffstat (limited to 'openpgp/src/crypto/asymmetric.rs')
-rw-r--r--openpgp/src/crypto/asymmetric.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/openpgp/src/crypto/asymmetric.rs b/openpgp/src/crypto/asymmetric.rs
index 6857d231..a3b55aaf 100644
--- a/openpgp/src/crypto/asymmetric.rs
+++ b/openpgp/src/crypto/asymmetric.rs
@@ -224,6 +224,7 @@ impl Decryptor for KeyPair {
&q.value, Option::None)?;
let mut rand = Yarrow::default();
rsa::decrypt_pkcs1(&public, &secret, &mut rand, &c.value)?
+ .into()
}
(PublicKey::Elgamal{ .. },
@@ -243,7 +244,7 @@ impl Decryptor for KeyPair {
"unsupported combination of key pair {:?}/{:?} \
and ciphertext {:?}",
public, secret, ciphertext)).into()),
- }.into())
+ })
}
}