diff options
Diffstat (limited to 'crates/tor-proto/src/relay')
| -rw-r--r-- | crates/tor-proto/src/relay/channel/handshake.rs | 4 | ||||
| -rw-r--r-- | crates/tor-proto/src/relay/channel/responder.rs | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/crates/tor-proto/src/relay/channel/handshake.rs b/crates/tor-proto/src/relay/channel/handshake.rs index dda1d2602..748d4a177 100644 --- a/crates/tor-proto/src/relay/channel/handshake.rs +++ b/crates/tor-proto/src/relay/channel/handshake.rs @@ -108,7 +108,7 @@ impl< /// Connect to another relay as the relay Initiator. /// /// Takes a function that reports the current time. In theory, this can just be - /// `SystemTime::now()`. + /// `SystemTime::get()`. pub async fn connect<F>(mut self, now_fn: F) -> Result<UnverifiedInitiatorRelayChannel<T, S>> where F: FnOnce() -> SystemTime, @@ -237,7 +237,7 @@ impl< /// Begin the handshake process. /// /// Takes a function that reports the current time. In theory, this can just be - /// `SystemTime::now()`. + /// `SystemTime::get()`. pub async fn handshake<F>( mut self, now_fn: F, diff --git a/crates/tor-proto/src/relay/channel/responder.rs b/crates/tor-proto/src/relay/channel/responder.rs index 4633e641b..09e55def7 100644 --- a/crates/tor-proto/src/relay/channel/responder.rs +++ b/crates/tor-proto/src/relay/channel/responder.rs @@ -8,7 +8,7 @@ use digest::Digest; use futures::{AsyncRead, AsyncWrite}; use safelog::{MaybeSensitive, Sensitive}; -use std::{net::IpAddr, ops::Deref, sync::Arc, time::SystemTime}; +use std::{net::IpAddr, ops::Deref, sync::Arc}; use subtle::ConstantTimeEq; use tracing::instrument; @@ -16,6 +16,7 @@ use tor_cell::chancell::msg; use tor_linkspec::{OwnedChanTarget, RelayIds}; use tor_llcrypto as ll; use tor_rtcompat::{CertifiedConn, CoarseTimeProvider, SleepProvider, StreamOps}; +use web_time_compat::{SystemTime, SystemTimeExt}; use crate::{ ClockSkew, Error, RelayIdentities, Result, @@ -132,7 +133,7 @@ where let initiator_auth_cell = self.auth_cell; let my_addrs = self.my_addrs; - 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: |
