Expand description
Main implementation of the connection functionality
Re-exportsยง
use std::collections::HashMap;๐use std::fmt::Debug;๐use std::fmt::Debug;๐use std::marker::PhantomData;๐use std::sync::Arc;๐use async_trait::async_trait;๐use educe::Educe;๐use futures::AsyncRead;๐use futures::AsyncWrite;๐use itertools::Itertools;๐use rand::RngExt;๐use tor_bytes::Writeable;๐use tor_cell::relaycell::hs::IntroduceAckStatus;๐use tor_cell::relaycell::hs::intro_payload;๐use tor_cell::relaycell::hs::intro_payload::IntroduceHandshakePayload;๐use tor_cell::relaycell::hs::pow::ProofOfWork;๐use tor_cell::relaycell::msg::AnyRelayMsg;๐use tor_cell::relaycell::msg::Introduce1;๐use tor_cell::relaycell::msg::Rendezvous2;๐use tor_circmgr::build::onion_circparams_from_netparams;๐use tor_circmgr::ClientOnionServiceDataTunnel;๐use tor_circmgr::ClientOnionServiceDirTunnel;๐use tor_circmgr::ClientOnionServiceIntroTunnel;๐use tor_dirclient::SourceInfo;๐use tor_error::Bug;๐use tor_error::debug_report;๐use tor_error::warn_report;๐use tor_hscrypto::Subcredential;๐use tor_hscrypto::time::TimePeriod;๐use tor_netdir::params::NetParameters;๐use tor_proto::TargetHop;๐use tor_proto::client::circuit::handshake::hs_ntor;๐use tor_proto::client::circuit::handshake::hs_ntor::HsNtorHkdfKeyGenerator;๐use tracing::debug;๐use tracing::instrument;๐use tracing::instrument;๐use tracing::trace;๐use tracing::warn;๐use web_time_compat::Duration;๐use web_time_compat::Instant;๐use web_time_compat::SystemTime;๐use retry_error::RetryError;๐use safelog::DispRedacted;๐use safelog::Sensitive;๐use tor_cell::relaycell::RelayMsg;๐use tor_cell::relaycell::hs::AuthKeyType;๐use tor_cell::relaycell::hs::EstablishRendezvous;๐use tor_cell::relaycell::hs::IntroduceAck;๐use tor_cell::relaycell::hs::RendezvousEstablished;๐use tor_checkable::TimeBound;๐use tor_checkable::timed::TimeRangeBound;๐use tor_circmgr::hspool::HsCircPool;๐use tor_circmgr::timeouts::Action as TimeoutsAction;๐use tor_dirclient::request::Requestable as _;๐use tor_error::HasRetryTime as _;๐use tor_error::RetryTime;๐use tor_error::internal;๐use tor_error::into_internal;๐use tor_hscrypto::RendCookie;๐use tor_hscrypto::pk::HsBlindId;๐use tor_hscrypto::pk::HsId;๐use tor_hscrypto::pk::HsIdKey;๐use tor_linkspec::CircTarget;๐use tor_linkspec::HasRelayIds;๐use tor_linkspec::OwnedCircTarget;๐use tor_linkspec::RelayId;๐use tor_llcrypto::pk::ed25519::Ed25519Identity;๐use tor_netdir::NetDir;๐use tor_netdir::Relay;๐use tor_netdoc::doc::hsdesc::HsDesc;๐use tor_netdoc::doc::hsdesc::IntroPointDesc;๐use tor_proto::client::circuit::CircParameters;๐use tor_proto::client::circuit::handshake;๐use tor_proto::MetaCellDisposition;๐use tor_proto::MsgHandler;๐use tor_rtcompat::Runtime;๐use tor_rtcompat::SleepProviderExt as _;๐use tor_rtcompat::TimeoutError;๐use crate::Config;๐use crate::caps;๐use crate::err::RendPtIdentityForError;๐use crate::pow::HsPowClient;๐use crate::proto_oneshot;๐use crate::relay_info::ipt_to_circtarget;๐use crate::state::MockableConnectorData;๐use crate::ConnError;๐use crate::DescriptorError;๐use crate::DescriptorErrorDetail;๐use crate::FailedAttemptError;๐use crate::IntroPtIndex;๐use crate::rend_pt_identity_for_error;๐use crate::HsClientConnector;๐use crate::HsClientSecretKeys;๐use ConnError as CE;๐use FailedAttemptError as FAE;๐
Macrosยง
- Data
Tunnel ๐ - Given
R, MwhereM: MocksForConnect<M>, expand to the mockableClientCirc
Structsยง
- Context ๐
- Common context for a single request to connect to a hidden service
- Data
- Information about a hidden service, including our connection history
- HsDesc
ForTp ๐ - An onion service descriptor and its associated HsBlindId.
- Introduced ๐
- Details of an apparently-successful INTRODUCE exchange
- IptExperience ๐
- How things went last time we tried to use this introduction point
- IptExperience
Map ๐ - Marker type, to make typed Ipt exprience
RelayIdForkeys - IptSort
Key ๐ - Sort key for an introduction point, for selecting the best IPTs to try first
- Refetch
Descriptor ๐ - Token indicating that a descriptor fetch is wanted
- Relay
IdFor ๐ - Lookup key for looking up and recording information about a relay
- Rendezvous ๐
- Details of an established rendezvous point
- Requery
Period ๐Map - Marker type, to make typed HsDir
RelayIdForkeys - Usable
Intro ๐Pt - Details of an apparently-useable introduction point
Enumsยง
- IptSort
KeyOutcome ๐ - Component of the
IptSortKeyrepresenting outcome of our last attempt, if any
Traitsยง
- Mockable
Circ ๐Pool - Mock for
HsCircPool - Mockable
Client ๐Data - Mock for onion service client data tunnel.
- Mockable
Client ๐Dir - Mock for onion service client directory tunnel.
- Mockable
Client ๐Intro - Mock for onion service client introduction tunnel.
- Mocks
ForConnect ๐ - Mocks used for testing
connect.rs
Functionsยง
- connect ๐
- Actually make a HS connection, updating our recorded state as necessary
- ensure_
descriptor_ ๐compatible_ with_ params - Return an error if
descdeclares a set of parameters that is too far away from the consensus.
Type Aliasesยง
- Data
HsDesc ๐ - Part of
Datathat relates to the HS descriptor - Data
HsDirs ๐ - Part of
Datathat relates to our information about the HsDir requery periods - Data
Ipts ๐ - Part of
Datathat relates to our information about introduction points - IptSort
Rand ๐ - Random value used as part of IPT selection
- Relay
IdFor ๐Experience - Lookup key for looking up and recording our IPT use experiences
- Relay
IdFor ๐Requery Period - Lookup key for looking up and recording our IPT use experiences