summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/backend/nettle
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2023-03-14 16:07:13 +0100
committerJustus Winter <justus@sequoia-pgp.org>2023-03-14 16:48:14 +0100
commit7914568a309b7692bdcb9cebd1b8820c34e71c87 (patch)
tree5e585d9b4ec779e720d798345f7bacab0e26d5b9 /openpgp/src/crypto/backend/nettle
parent67819944a69a7faba0d1cf400facaffce6da01d5 (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/nettle')
-rw-r--r--openpgp/src/crypto/backend/nettle/asymmetric.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/crypto/backend/nettle/asymmetric.rs b/openpgp/src/crypto/backend/nettle/asymmetric.rs
index 7bfe617a..0d908c55 100644
--- a/openpgp/src/crypto/backend/nettle/asymmetric.rs
+++ b/openpgp/src/crypto/backend/nettle/asymmetric.rs
@@ -380,7 +380,7 @@ impl<R> Key4<SecretParts, R>
q: MPI::new_compressed_point(&public_key),
},
mpi::SecretKeyMaterial::EdDSA {
- scalar: mpi::MPI::new(private_key).into(),
+ scalar: private_key.into(),
}.into())
}
@@ -405,7 +405,7 @@ impl<R> Key4<SecretParts, R>
n: mpi::MPI::new(&key.n()[..]),
},
mpi::SecretKeyMaterial::RSA {
- d: mpi::MPI::new(d).into(),
+ d: d.into(),
p: a.into(),
q: b.into(),
u: c.into(),