diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2023-03-14 16:07:13 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2023-03-14 16:48:14 +0100 |
commit | 7914568a309b7692bdcb9cebd1b8820c34e71c87 (patch) | |
tree | 5e585d9b4ec779e720d798345f7bacab0e26d5b9 /openpgp/src/crypto/backend/openssl | |
parent | 67819944a69a7faba0d1cf400facaffce6da01d5 (diff) |
openpgp: Immediately create ProtectedMPIs for secrets.
- Avoid creating an MPI first, as this may leak the secrets.
Diffstat (limited to 'openpgp/src/crypto/backend/openssl')
-rw-r--r-- | openpgp/src/crypto/backend/openssl/asymmetric.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/crypto/backend/openssl/asymmetric.rs b/openpgp/src/crypto/backend/openssl/asymmetric.rs index 5a1dc295..07d0c7f4 100644 --- a/openpgp/src/crypto/backend/openssl/asymmetric.rs +++ b/openpgp/src/crypto/backend/openssl/asymmetric.rs @@ -456,7 +456,7 @@ where q: public_key.into(), }, mpi::SecretKeyMaterial::EdDSA { - scalar: mpi::MPI::new(&private_key).into(), + scalar: private_key.into(), } .into(), ) @@ -504,8 +504,8 @@ where }, mpi::SecretKeyMaterial::RSA { d: d_bn.into(), - p: mpi::MPI::new(p).into(), - q: mpi::MPI::new(q).into(), + p: p.into(), + q: q.into(), u: u.into(), } .into(), |