summaryrefslogtreecommitdiff
path: root/crates/tor-hscrypto
diff options
context:
space:
mode:
Diffstat (limited to 'crates/tor-hscrypto')
-rw-r--r--crates/tor-hscrypto/Cargo.toml1
-rw-r--r--crates/tor-hscrypto/src/pk.rs4
-rw-r--r--crates/tor-hscrypto/src/time.rs6
3 files changed, 5 insertions, 6 deletions
diff --git a/crates/tor-hscrypto/Cargo.toml b/crates/tor-hscrypto/Cargo.toml
index d2cf0160b..05c2b020b 100644
--- a/crates/tor-hscrypto/Cargo.toml
+++ b/crates/tor-hscrypto/Cargo.toml
@@ -67,6 +67,7 @@ tor-llcrypto = { version = "0.40.0", path = "../tor-llcrypto", features = ["hsv3
tor-memquota = { version = "0.40.0", path = "../tor-memquota", default-features = false, optional = true }
tor-units = { path = "../tor-units", version = "0.40.0" }
void = "1"
+web-time-compat = { path = "../web-time-compat", version = "0.1.0" }
zeroize = { version = "1", optional = true }
[dev-dependencies]
diff --git a/crates/tor-hscrypto/src/pk.rs b/crates/tor-hscrypto/src/pk.rs
index 4a56a004e..ba9e4d39a 100644
--- a/crates/tor-hscrypto/src/pk.rs
+++ b/crates/tor-hscrypto/src/pk.rs
@@ -818,8 +818,8 @@ mod test {
use hex_literal::hex;
use itertools::izip;
- use std::time::{Duration, SystemTime};
use tor_basic_utils::test_rng::testing_rng;
+ use web_time_compat::{Duration, SystemTime, SystemTimeExt};
use super::*;
@@ -872,7 +872,7 @@ mod test {
fn key_blinding_blackbox() {
let mut rng = testing_rng();
let offset = Duration::new(12 * 60 * 60, 0);
- let when = TimePeriod::new(Duration::from_secs(3600), SystemTime::now(), offset).unwrap();
+ let when = TimePeriod::new(Duration::from_secs(3600), SystemTime::get(), offset).unwrap();
let keypair = ed25519::Keypair::generate(&mut rng);
let id_pub = HsIdKey::from(keypair.verifying_key());
let id_keypair = HsIdKeypair::from(ed25519::ExpandedKeypair::from(&keypair));
diff --git a/crates/tor-hscrypto/src/time.rs b/crates/tor-hscrypto/src/time.rs
index a4d7ea831..e70c2f667 100644
--- a/crates/tor-hscrypto/src/time.rs
+++ b/crates/tor-hscrypto/src/time.rs
@@ -1,12 +1,10 @@
//! Manipulate time periods (as used in the onion service system)
-use std::{
- fmt::Display,
- time::{Duration, SystemTime},
-};
+use std::fmt::Display;
use humantime::format_rfc3339_seconds;
use tor_units::IntegerMinutes;
+use web_time_compat::{Duration, SystemTime};
use serde::{Deserialize, Serialize};