summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/backend/nettle
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-11-17 12:50:46 +0100
committerJustus Winter <justus@sequoia-pgp.org>2021-11-18 14:10:55 +0100
commitb56ea7ab07626ff37e14f0c15c6252b7627a6b72 (patch)
tree595c6a5d11b2db7e9141384a32762052440193ce /openpgp/src/crypto/backend/nettle
parent991c759dd710bab903baa32dff8dc1fc18e78e3b (diff)
openpgp: Use a WASM-friendly SystemTime::now wrapper.
- Fixes #769.
Diffstat (limited to 'openpgp/src/crypto/backend/nettle')
-rw-r--r--openpgp/src/crypto/backend/nettle/asymmetric.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/openpgp/src/crypto/backend/nettle/asymmetric.rs b/openpgp/src/crypto/backend/nettle/asymmetric.rs
index bf1126e6..0b4e1835 100644
--- a/openpgp/src/crypto/backend/nettle/asymmetric.rs
+++ b/openpgp/src/crypto/backend/nettle/asymmetric.rs
@@ -344,7 +344,7 @@ impl<R> Key4<SecretParts, R>
private_key.reverse();
Self::with_secret(
- ctime.into().unwrap_or_else(SystemTime::now),
+ ctime.into().unwrap_or_else(crate::now),
PublicKeyAlgorithm::ECDH,
mpi::PublicKey::ECDH {
curve: Curve::Cv25519,
@@ -370,7 +370,7 @@ impl<R> Key4<SecretParts, R>
ed25519::public_key(&mut public_key, private_key).unwrap();
Self::with_secret(
- ctime.into().unwrap_or_else(SystemTime::now),
+ ctime.into().unwrap_or_else(crate::now),
PublicKeyAlgorithm::EdDSA,
mpi::PublicKey::EdDSA {
curve: Curve::Ed25519,
@@ -395,7 +395,7 @@ impl<R> Key4<SecretParts, R>
let (a, b, c) = sec.as_rfc4880();
Self::with_secret(
- ctime.into().unwrap_or_else(SystemTime::now),
+ ctime.into().unwrap_or_else(crate::now),
PublicKeyAlgorithm::RSAEncryptSign,
mpi::PublicKey::RSA {
e: mpi::MPI::new(&key.e()[..]),
@@ -427,7 +427,7 @@ impl<R> Key4<SecretParts, R>
};
Self::with_secret(
- SystemTime::now(),
+ crate::now(),
PublicKeyAlgorithm::RSAEncryptSign,
public_mpis,
private_mpis.into())
@@ -565,7 +565,7 @@ impl<R> Key4<SecretParts, R>
};
Self::with_secret(
- SystemTime::now(),
+ crate::now(),
pk_algo,
mpis,
secret)