summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/channel
diff options
context:
space:
mode:
Diffstat (limited to 'crates/tor-proto/src/channel')
-rw-r--r--crates/tor-proto/src/channel/handshake.rs8
-rw-r--r--crates/tor-proto/src/channel/padding.rs4
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/tor-proto/src/channel/handshake.rs b/crates/tor-proto/src/channel/handshake.rs
index 3c95cb036..f805ac346 100644
--- a/crates/tor-proto/src/channel/handshake.rs
+++ b/crates/tor-proto/src/channel/handshake.rs
@@ -5,7 +5,6 @@ use futures::sink::SinkExt;
use futures::stream::{Stream, StreamExt};
use std::net::IpAddr;
use std::sync::Arc;
-use std::time::SystemTime;
use tor_llcrypto::pk::ValidatableSignature;
use crate::channel::{Canonicity, ChannelFrame, UniqId};
@@ -26,6 +25,7 @@ use tor_linkspec::{
use tor_llcrypto as ll;
use tor_llcrypto::pk::ed25519::Ed25519Identity;
use tor_rtcompat::{CoarseTimeProvider, SleepProvider, StreamOps};
+use web_time_compat::{SystemTime, SystemTimeExt};
use digest::Digest;
@@ -656,7 +656,7 @@ impl<
use tor_cert::CertType;
// Replace 'now' with the real time to use.
- let now = now.unwrap_or_else(SystemTime::now);
+ let now = now.unwrap_or_else(SystemTime::get);
// We are a client initiating a channel to a relay or a bridge. We have received a CERTS
// cell and we need to verify these certs:
@@ -732,7 +732,7 @@ pub(crate) fn verify_link_auth_cert(
use tor_cert::CertType;
// Replace 'now' with the real time to use.
- let now = now.unwrap_or_else(SystemTime::now);
+ let now = now.unwrap_or_else(SystemTime::get);
// Now look at the signing->TLS cert and check it against the
// peer certificate.
@@ -956,7 +956,7 @@ pub(super) mod test {
{
let mb = MsgBuf::new(input);
let handshake = ClientInitiatorHandshake::new(mb, None, sleep_prov, fake_mq());
- handshake.connect(SystemTime::now).await.err().unwrap()
+ handshake.connect(SystemTime::get).await.err().unwrap()
}
#[test]
diff --git a/crates/tor-proto/src/channel/padding.rs b/crates/tor-proto/src/channel/padding.rs
index 7d2af56ce..dc3d40b17 100644
--- a/crates/tor-proto/src/channel/padding.rs
+++ b/crates/tor-proto/src/channel/padding.rs
@@ -29,7 +29,7 @@
use std::pin::Pin;
// TODO, coarsetime maybe? But see arti#496 and also we want to use the mockable SleepProvider
-use std::time::{Duration, Instant};
+use web_time_compat::{Duration, Instant};
use derive_builder::Builder;
use educe::Educe;
@@ -400,7 +400,7 @@ impl<R: SleepProvider> Timer<R> {
self.as_mut().select_fresh_timeout();
// Bet that we will be going to sleep again, and set up the new trigger time
- // and waker now. This will save us a future call to Instant::now.
+ // and waker now. This will save us a future call to Instant::get.
self.as_mut().prepare_to_sleep(Some(now));
Padding::new()