summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/backend/cng/asymmetric.rs
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/cng/asymmetric.rs
parent991c759dd710bab903baa32dff8dc1fc18e78e3b (diff)
openpgp: Use a WASM-friendly SystemTime::now wrapper.
- Fixes #769.
Diffstat (limited to 'openpgp/src/crypto/backend/cng/asymmetric.rs')
-rw-r--r--openpgp/src/crypto/backend/cng/asymmetric.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/openpgp/src/crypto/backend/cng/asymmetric.rs b/openpgp/src/crypto/backend/cng/asymmetric.rs
index c573acc4..fe987dbe 100644
--- a/openpgp/src/crypto/backend/cng/asymmetric.rs
+++ b/openpgp/src/crypto/backend/cng/asymmetric.rs
@@ -723,7 +723,7 @@ where
private.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,
@@ -757,7 +757,7 @@ where
public[1..].copy_from_slice(Into::<PublicKey>::into(&private).as_bytes());
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,
@@ -797,7 +797,7 @@ where
.ok_or_else(|| Error::MalformedMPI("RSA: `p` and `q` aren't coprime".into()))?;
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(&e.to_bytes_be()),
@@ -846,7 +846,7 @@ where
};
Self::with_secret(
- SystemTime::now(),
+ crate::now(),
PublicKeyAlgorithm::RSAEncryptSign,
public,
private.into()
@@ -960,7 +960,7 @@ where
}
};
- Self::with_secret(SystemTime::now(), algo, public, private.into())
+ Self::with_secret(crate::now(), algo, public, private.into())
}
}