Struct tor_proto::channel::UnverifiedChannel
source · [−]pub struct UnverifiedChannel<T: AsyncRead + AsyncWrite + Send + Unpin + 'static, S: SleepProvider> { /* private fields */ }
Expand description
A client channel on which versions have been negotiated and the relay’s handshake has been read, but where the certs have not been checked.
Implementations
sourceimpl<T: AsyncRead + AsyncWrite + Send + Unpin + 'static, S: SleepProvider> UnverifiedChannel<T, S>
impl<T: AsyncRead + AsyncWrite + Send + Unpin + 'static, S: SleepProvider> UnverifiedChannel<T, S>
sourcepub fn clock_skew(&self) -> ClockSkew
pub fn clock_skew(&self) -> ClockSkew
Return the reported clock skew from this handshake.
Note that the skew reported by this function might not be “true”: the relay might have its clock set wrong, or it might be lying to us.
The clock skew reported here is not yet authenticated; if you need to
make sure that the skew is authenticated, use
Channel::clock_skew
instead.
sourcepub fn check<U: ChanTarget + ?Sized>(
self,
peer: &U,
peer_cert: &[u8],
now: Option<SystemTime>
) -> Result<VerifiedChannel<T, S>>
pub fn check<U: ChanTarget + ?Sized>(
self,
peer: &U,
peer_cert: &[u8],
now: Option<SystemTime>
) -> Result<VerifiedChannel<T, S>>
Validate the certificates and keys in the relay’s handshake.
‘peer’ is the peer that we want to make sure we’re connecting to.
‘peer_cert’ is the x.509 certificate that the peer presented during its handshake.
‘now’ is the time at which to check that certificates are
valid. None
means to use the current time. It can be used
for testing to override the current view of the time.
This is a separate function because it’s likely to be somewhat CPU-intensive.
Auto Trait Implementations
impl<T, S> RefUnwindSafe for UnverifiedChannel<T, S> where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> Send for UnverifiedChannel<T, S>
impl<T, S> Sync for UnverifiedChannel<T, S> where
T: Sync,
impl<T, S> Unpin for UnverifiedChannel<T, S> where
S: Unpin,
impl<T, S> UnwindSafe for UnverifiedChannel<T, S> where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more