summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/arti-client/src/address.rs2
-rw-r--r--crates/arti-client/src/client.rs2
-rw-r--r--crates/tor-cell/Cargo.toml5
-rw-r--r--crates/tor-cell/fuzz/Cargo.toml2
-rw-r--r--crates/tor-cell/src/relaycell.rs2
-rw-r--r--crates/tor-cell/src/relaycell/msg.rs24
-rw-r--r--crates/tor-cell/tests/testvec_relaymsg.rs8
-rw-r--r--crates/tor-circmgr/Cargo.toml8
-rw-r--r--crates/tor-circmgr/src/lib.rs12
-rw-r--r--crates/tor-hsclient/Cargo.toml2
-rw-r--r--crates/tor-hsservice/Cargo.toml2
-rw-r--r--crates/tor-netdir/Cargo.toml8
-rw-r--r--crates/tor-netdir/src/err.rs6
-rw-r--r--crates/tor-netdir/src/hsdir_params.rs8
-rw-r--r--crates/tor-netdir/src/lib.rs48
-rw-r--r--crates/tor-netdoc/Cargo.toml10
-rw-r--r--crates/tor-netdoc/fuzz/Cargo.toml2
-rw-r--r--crates/tor-netdoc/src/doc.rs2
-rw-r--r--crates/tor-netdoc/src/lib.rs6
-rw-r--r--crates/tor-netdoc/src/parse/tokenize.rs2
-rw-r--r--crates/tor-proto/Cargo.toml8
-rw-r--r--crates/tor-proto/src/circuit.rs6
-rw-r--r--crates/tor-proto/src/crypto/handshake.rs2
-rw-r--r--crates/tor-proto/src/crypto/handshake/hs_ntor.rs2
-rw-r--r--crates/tor-proto/src/stream.rs6
25 files changed, 93 insertions, 92 deletions
diff --git a/crates/arti-client/src/address.rs b/crates/arti-client/src/address.rs
index 095a54250..33712d299 100644
--- a/crates/arti-client/src/address.rs
+++ b/crates/arti-client/src/address.rs
@@ -227,7 +227,7 @@ enum Host {
// TODO hs possibly the contents of this enum should be a String rather than
// an OnionId.
//
- // #[cfg(feature = "onion-client")]
+ // #[cfg(feature = "hs-client")]
// OnionService(OnionId),
}
diff --git a/crates/arti-client/src/client.rs b/crates/arti-client/src/client.rs
index 638f0e358..5e26beede 100644
--- a/crates/arti-client/src/client.rs
+++ b/crates/arti-client/src/client.rs
@@ -169,7 +169,7 @@ pub struct StreamPrefs {
/// Whether to return the stream optimistically.
optimistic_stream: bool,
/// Whether to try to make connections to onion services.
- #[cfg(feature = "onion-client")]
+ #[cfg(feature = "hs-client")]
#[allow(dead_code)]
connect_to_onion_services: bool, // TODO hs: this should default to "true".
}
diff --git a/crates/tor-cell/Cargo.toml b/crates/tor-cell/Cargo.toml
index d0db4f188..0d75633b4 100644
--- a/crates/tor-cell/Cargo.toml
+++ b/crates/tor-cell/Cargo.toml
@@ -14,10 +14,11 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/"
[features]
default = []
-experimental = ["experimental-udp", "onion-service"]
+experimental = ["experimental-udp", "hs"]
# Enable experimental UDP support.
experimental-udp = []
-onion-service = ["tor-hscrypto"] #TODO hs: rename this feature, it is not service-specific.
+# "hs" = (all) hidden service support, either client or server
+hs = ["tor-hscrypto"]
# Enable testing only API
testing = ["experimental-udp"]
diff --git a/crates/tor-cell/fuzz/Cargo.toml b/crates/tor-cell/fuzz/Cargo.toml
index 199783cf2..2ebffc7f8 100644
--- a/crates/tor-cell/fuzz/Cargo.toml
+++ b/crates/tor-cell/fuzz/Cargo.toml
@@ -15,7 +15,7 @@ libfuzzer-sys = "0.4"
[dependencies.tor-cell]
path = ".."
-features = ["onion-service", "experimental"]
+features = ["hs-service", "experimental"]
[dependencies.tor-bytes]
path = "../../tor-bytes"
diff --git a/crates/tor-cell/src/relaycell.rs b/crates/tor-cell/src/relaycell.rs
index d93e8bdf3..5c8859d3c 100644
--- a/crates/tor-cell/src/relaycell.rs
+++ b/crates/tor-cell/src/relaycell.rs
@@ -10,7 +10,7 @@ use caret::caret_int;
use rand::{CryptoRng, Rng};
pub mod extend;
-#[cfg(feature = "onion-service")]
+#[cfg(feature = "hs-service")]
pub mod hs;
pub mod msg;
pub mod restrict;
diff --git a/crates/tor-cell/src/relaycell/msg.rs b/crates/tor-cell/src/relaycell/msg.rs
index 1ba5c77ad..92c64c4bf 100644
--- a/crates/tor-cell/src/relaycell/msg.rs
+++ b/crates/tor-cell/src/relaycell/msg.rs
@@ -17,8 +17,8 @@ use tor_llcrypto::pk::rsa::RsaIdentity;
use bitflags::bitflags;
-#[cfg(feature = "onion-service")]
-#[cfg_attr(docsrs, doc(cfg(feature = "onion-service")))]
+#[cfg(feature = "hs-service")]
+#[cfg_attr(docsrs, doc(cfg(feature = "hs-service")))]
pub use super::hs::{
est_intro::EstablishIntro, EstablishRendezvous, IntroEstablished, Introduce1, Introduce2,
IntroduceAck, Rendezvous1, Rendezvous2, RendezvousEstablished,
@@ -73,31 +73,31 @@ pub enum AnyRelayMsg : RelayMsg {
[feature = "experimental-udp"]
Datagram,
/// Establish Introduction
- [feature = "onion-service"]
+ [feature = "hs-service"]
EstablishIntro,
/// Establish Rendezvous
- [feature = "onion-service"]
+ [feature = "hs-service"]
EstablishRendezvous,
/// Introduce1 (client to introduction point)
- [feature = "onion-service"]
+ [feature = "hs-service"]
Introduce1,
/// Introduce2 (introduction point to service)
- [feature = "onion-service"]
+ [feature = "hs-service"]
Introduce2,
/// Rendezvous1 (service to rendezvous point)
- [feature = "onion-service"]
+ [feature = "hs-service"]
Rendezvous1,
/// Rendezvous2 (rendezvous point to client)
- [feature = "onion-service"]
+ [feature = "hs-service"]
Rendezvous2,
/// Acknowledgement for EstablishIntro.
- [feature = "onion-service"]
+ [feature = "hs-service"]
IntroEstablished,
/// Acknowledgment for EstablishRendezvous.
- [feature = "onion-service"]
+ [feature = "hs-service"]
RendezvousEstablished,
/// Acknowledgement for Introduce1.
- [feature = "onion-service"]
+ [feature = "hs-service"]
IntroduceAck,
_ =>
@@ -1213,7 +1213,7 @@ msg_impl_relaymsg!(
#[cfg(feature = "experimental-udp")]
msg_impl_relaymsg!(ConnectUdp, ConnectedUdp, Datagram);
-#[cfg(feature = "onion-service")]
+#[cfg(feature = "hs-service")]
msg_impl_relaymsg!(
EstablishIntro,
EstablishRendezvous,
diff --git a/crates/tor-cell/tests/testvec_relaymsg.rs b/crates/tor-cell/tests/testvec_relaymsg.rs
index 02bbe4101..54077745e 100644
--- a/crates/tor-cell/tests/testvec_relaymsg.rs
+++ b/crates/tor-cell/tests/testvec_relaymsg.rs
@@ -14,7 +14,7 @@ use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use hex_literal::hex;
-#[cfg(feature = "onion-service")]
+#[cfg(feature = "hs-service")]
use tor_cell::relaycell::hs;
#[cfg(feature = "experimental-udp")]
use tor_cell::relaycell::udp;
@@ -619,7 +619,7 @@ fn test_connected_udp() {
);
}
-#[cfg(feature = "onion-service")]
+#[cfg(feature = "hs-service")]
#[test]
fn test_establish_rendezvous() {
let cmd = RelayCmd::ESTABLISH_RENDEZVOUS;
@@ -655,7 +655,7 @@ fn test_establish_rendezvous() {
);
}
-#[cfg(feature = "onion-service")]
+#[cfg(feature = "hs-service")]
#[test]
fn test_establish_intro() {
use tor_cell::relaycell::hs::{est_intro::*, AuthKeyType, UnrecognizedExt};
@@ -714,7 +714,7 @@ fn test_establish_intro() {
);
}
-#[cfg(feature = "onion-service")]
+#[cfg(feature = "hs-service")]
#[test]
fn test_introduce() {
use tor_cell::relaycell::{
diff --git a/crates/tor-circmgr/Cargo.toml b/crates/tor-circmgr/Cargo.toml
index a61779be7..447ba767c 100644
--- a/crates/tor-circmgr/Cargo.toml
+++ b/crates/tor-circmgr/Cargo.toml
@@ -21,11 +21,11 @@ specific-relay = []
#
# These APIs are not covered by semantic versioning. Using this
# feature voids your "semver warrantee".
-experimental = ["experimental-api", "onion-client", "onion-service"]
+experimental = ["experimental-api", "hs-client", "hs-service"]
experimental-api = []
-onion-client = ["onion-common"]
-onion-service = ["onion-common"]
-onion-common = ["tor-hscrypto"]
+hs-client = ["hs-common"]
+hs-service = ["hs-common"]
+hs-common = ["tor-hscrypto"]
[dependencies]
async-trait = "0.1.2"
diff --git a/crates/tor-circmgr/src/lib.rs b/crates/tor-circmgr/src/lib.rs
index abc3c66c5..55718fbac 100644
--- a/crates/tor-circmgr/src/lib.rs
+++ b/crates/tor-circmgr/src/lib.rs
@@ -61,7 +61,7 @@ mod err;
mod impls;
pub mod isolation;
mod mgr;
-#[cfg(feature = "onion-client")]
+#[cfg(feature = "hs-client")]
mod onion_connector;
pub mod path;
mod preemptive;
@@ -70,8 +70,8 @@ mod usage;
pub use err::Error;
pub use isolation::IsolationToken;
-#[cfg(feature = "onion-client")]
-#[cfg_attr(docsrs, doc(cfg(feature = "onion-client")))]
+#[cfg(feature = "hs-client")]
+#[cfg_attr(docsrs, doc(cfg(feature = "hs-client")))]
pub use onion_connector::{OnionConnectError, OnionServiceConnector};
use tor_guardmgr::fallback::FallbackList;
pub use tor_guardmgr::{ClockSkewEvents, GuardMgrConfig, SkewEstimate};
@@ -217,7 +217,7 @@ impl<R: Runtime> CircMgr<R> {
///
/// (This cannot be done at construction time, since the
/// OnionServiceConnector will have to keep a reference to this `CircMgr`.)
- #[cfg(feature = "onion-client")]
+ #[cfg(feature = "hs-client")]
#[allow(unused_variables, clippy::missing_panics_doc)]
pub fn install_onion_service_connector(
&self,
@@ -441,7 +441,7 @@ impl<R: Runtime> CircMgr<R> {
///
/// Requires that an `OnionServiceConnector` has been installed. If it
/// hasn't, then we return an error.
- #[cfg(feature = "onion-client")]
+ #[cfg(feature = "hs-client")]
#[allow(clippy::missing_panics_doc, unused_variables)]
pub async fn get_or_launch_onion_client(
&self,
@@ -483,7 +483,7 @@ impl<R: Runtime> CircMgr<R> {
/// future unless explicitly re-registered with a circuit manager.
///
/// Used to implement onion service clients and services.
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
#[allow(unused_variables, clippy::missing_panics_doc)]
pub async fn launch_specific_isolated(
&self,
diff --git a/crates/tor-hsclient/Cargo.toml b/crates/tor-hsclient/Cargo.toml
index d8b66a72f..bbb48c52a 100644
--- a/crates/tor-hsclient/Cargo.toml
+++ b/crates/tor-hsclient/Cargo.toml
@@ -20,7 +20,7 @@ default = []
async-trait = "0.1.2"
rand_core = "0.6.2"
thiserror = "1"
-tor-circmgr = { version = "0.7.1", path = "../tor-circmgr", features = ["onion-client"] }
+tor-circmgr = { version = "0.7.1", path = "../tor-circmgr", features = ["hs-client"] }
tor-hscrypto = { version = "0.1.0", path = "../tor-hscrypto" }
tor-llcrypto = { version = "0.4.1", path = "../tor-llcrypto" }
tor-netdir = { version = "0.7.1", path = "../tor-netdir" }
diff --git a/crates/tor-hsservice/Cargo.toml b/crates/tor-hsservice/Cargo.toml
index 9356b354b..7358e2dff 100644
--- a/crates/tor-hsservice/Cargo.toml
+++ b/crates/tor-hsservice/Cargo.toml
@@ -20,7 +20,7 @@ default = []
async-trait = "0.1.2"
rand_core = "0.6.2"
thiserror = "1"
-tor-circmgr = { version = "0.7.1", path = "../tor-circmgr", features = ["onion-client"] }
+tor-circmgr = { version = "0.7.1", path = "../tor-circmgr", features = ["hs-service"] }
tor-hscrypto = { version = "0.1.0", path = "../tor-hscrypto" }
tor-llcrypto = { version = "0.4.1", path = "../tor-llcrypto" }
tor-netdir = { version = "0.7.1", path = "../tor-netdir" }
diff --git a/crates/tor-netdir/Cargo.toml b/crates/tor-netdir/Cargo.toml
index f00b071d2..a9643cf49 100644
--- a/crates/tor-netdir/Cargo.toml
+++ b/crates/tor-netdir/Cargo.toml
@@ -14,16 +14,16 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/"
[features]
default = []
-experimental = ["experimental-api", "onion-service", "onion-client"]
+experimental = ["experimental-api", "hs-service", "hs-client"]
# Enable experimental APIs that are not yet officially supported.
#
# These APIs are not covered by semantic versioning. Using this
# feature voids your "semver warrantee".
experimental-api = []
-onion-client = ["onion-common"]
-onion-service = ["onion-common"]
-onion-common = ["digest", "time", "tor-hscrypto"]
+hs-client = ["hs-common"]
+hs-service = ["hs-common"]
+hs-common = ["digest", "time", "tor-hscrypto"]
# Enable testing-only APIs. APIs under this feature are not
# covered by semver.
diff --git a/crates/tor-netdir/src/err.rs b/crates/tor-netdir/src/err.rs
index b8b67f916..f29977064 100644
--- a/crates/tor-netdir/src/err.rs
+++ b/crates/tor-netdir/src/err.rs
@@ -39,8 +39,8 @@ impl HasKind for Error {
/// An error returned when looking up onion service directories.
#[derive(Error, Clone, Debug)]
-#[cfg(feature = "onion-common")]
-#[cfg_attr(docsrs, doc(cfg(feature = "onion-common")))]
+#[cfg(feature = "hs-common")]
+#[cfg_attr(docsrs, doc(cfg(feature = "hs-common")))]
#[non_exhaustive]
pub enum OnionDirLookupError {
/// We tried to look up an onion service directory for a time period that
@@ -49,7 +49,7 @@ pub enum OnionDirLookupError {
WrongTimePeriod,
}
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
impl HasKind for OnionDirLookupError {
fn kind(&self) -> tor_error::ErrorKind {
use tor_error::ErrorKind as EK;
diff --git a/crates/tor-netdir/src/hsdir_params.rs b/crates/tor-netdir/src/hsdir_params.rs
index f6c7f33ac..cbbf26e0d 100644
--- a/crates/tor-netdir/src/hsdir_params.rs
+++ b/crates/tor-netdir/src/hsdir_params.rs
@@ -98,7 +98,7 @@ impl HsDirParams {
// When computing secondary rings, we don't try so many fallback operations:
// if they aren't available, they aren't available.
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
let secondary = [cur_period.prev(), cur_period.next()]
.iter()
.flatten()
@@ -107,7 +107,7 @@ impl HsDirParams {
Ok(HsDirs {
current,
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
secondary,
})
}
@@ -430,7 +430,7 @@ mod test {
}
#[test]
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
fn ring_params_simple() {
// Compute ring parameters in a legacy environment, where the time
// period and the SRV lifetime are one day long, and they are offset by
@@ -457,7 +457,7 @@ mod test {
}
#[test]
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
fn ring_params_tricky() {
// In this case we give the SRVs timestamps and we choose an odd hsdir_interval.
let consensus = example_consensus_builder()
diff --git a/crates/tor-netdir/src/lib.rs b/crates/tor-netdir/src/lib.rs
index 94b10c265..e4f14d3a4 100644
--- a/crates/tor-netdir/src/lib.rs
+++ b/crates/tor-netdir/src/lib.rs
@@ -39,9 +39,9 @@
//! <!-- @@ end lint list maintained by maint/add_warning @@ -->
mod err;
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
mod hsdir_params;
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
mod hsdir_ring;
pub mod params;
mod weight;
@@ -60,7 +60,7 @@ use tor_llcrypto::pk::{ed25519::Ed25519Identity, rsa::RsaIdentity};
use tor_netdoc::doc::microdesc::{MdDigest, Microdesc};
use tor_netdoc::doc::netstatus::{self, MdConsensus, MdConsensusRouterStatus, RouterStatus};
use tor_netdoc::types::policy::PortPolicy;
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
use {hsdir_params::HsDirParams, hsdir_ring::HsDirRing, itertools::chain, std::iter};
use derive_more::{From, Into};
@@ -75,7 +75,7 @@ use strum::{EnumCount, EnumIter};
use tracing::warn;
use typed_index_collections::{TiSlice, TiVec};
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
use tor_hscrypto::{pk::HsBlindId, time::TimePeriod};
pub use err::Error;
@@ -83,7 +83,7 @@ pub use weight::WeightRole;
/// A Result using the Error type from the tor-netdir crate
pub type Result<T> = std::result::Result<T, Error>;
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
pub use err::OnionDirLookupError;
use params::NetParameters;
@@ -324,7 +324,7 @@ pub struct NetDir {
// in a PartialNetDir.
// Ideally, a PartialNetDir would contain only an HsDirs<HsDirParams>,
// or perhaps nothing at all, here.
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
hsdir_rings: HsDirs<HsDirRing>,
/// Weight values to apply to a given relay when deciding how frequently
@@ -342,7 +342,7 @@ pub struct NetDir {
/// [`HsDirParams::compute`](HsDirParams::compute),
/// where it contains the *parameters* for the primary and secondary rings.
#[derive(Debug, Clone)]
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
pub(crate) struct HsDirs<D> {
/// The current ring
///
@@ -374,17 +374,17 @@ pub(crate) struct HsDirs<D> {
//
// TODO hs: this `Vec` is only ever 0,1,2 elements.
// Maybe it should be an ArrayVec or something.
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
secondary: Vec<D>,
}
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
impl<D> HsDirs<D> {
/// Convert an `HsDirs<D>` to `HsDirs<D2>` by mapping each contained `D`
pub(crate) fn map<D2>(self, mut f: impl FnMut(D) -> D2) -> HsDirs<D2> {
HsDirs {
current: f(self.current),
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
secondary: self.secondary.into_iter().map(f).collect(),
}
}
@@ -397,7 +397,7 @@ impl<D> HsDirs<D> {
// which is conditionally present.
#[allow(unused_variables)]
let i = iter::empty::<&D>();
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
let i = self.secondary.iter();
i
},)
@@ -549,7 +549,7 @@ pub struct PartialNetDir {
/// The previous netdir, if we had one
///
/// Used as a cache, so we can reuse information
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
prev_netdir: Option<Arc<NetDir>>,
}
@@ -631,7 +631,7 @@ impl PartialNetDir {
.map(|(rs_idx, rs)| (*rs.rsa_identity(), rs_idx))
.collect();
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
let hsdir_rings = {
let params = HsDirParams::compute(&consensus, &params).expect("Invalid consensus!");
// TODO HS: I dislike using expect above, but this function does not
@@ -648,14 +648,14 @@ impl PartialNetDir {
rs_idx_by_missing,
rs_idx_by_rsa: Arc::new(rs_idx_by_rsa),
rs_idx_by_ed: HashMap::with_capacity(n_relays),
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
hsdir_rings,
weights,
};
PartialNetDir {
netdir,
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
prev_netdir: None,
}
}
@@ -677,14 +677,14 @@ impl PartialNetDir {
self.netdir.add_arc_microdesc(md.clone());
}
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
{
self.prev_netdir = Some(prev);
}
}
/// Compute the hash ring(s) for this NetDir
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
#[allow(clippy::missing_panics_doc)]
fn compute_rings(&mut self) {
let params = HsDirParams::compute(&self.netdir.consensus, &self.netdir.params)
@@ -706,7 +706,7 @@ impl PartialNetDir {
#[allow(unused_mut)] mut self,
) -> std::result::Result<NetDir, PartialNetDir> {
if self.netdir.have_enough_paths() {
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
self.compute_rings();
Ok(self.netdir)
} else {
@@ -808,7 +808,7 @@ impl NetDir {
}
/// Look up a relay's `MicroDesc` by its `RouterStatusIdx`
- #[cfg_attr(not(feature = "onion-common"), allow(dead_code))]
+ #[cfg_attr(not(feature = "hs-common"), allow(dead_code))]
pub(crate) fn md_by_idx(&self, rsi: RouterStatusIdx) -> Option<&Microdesc> {
self.mds.get(rsi)?.as_deref()
}
@@ -951,7 +951,7 @@ impl NetDir {
/// List the hsdirs in this NetDir, that should be in the HSDir rings
///
/// The results are not returned in any particular order.
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
fn all_hsdirs(&self) -> impl Iterator<Item = (RouterStatusIdx, Relay<'_>)> {
self.c_relays().iter_enumerated().filter_map(|(rsi, rs)| {
let relay = self.relay_from_rs_and_idx(rs, rsi);
@@ -1202,7 +1202,7 @@ impl NetDir {
/// Specifically, this returns the time period that contains the beginning
/// of the validity period of this `NetDir`'s consensus. That time period
/// is the one we use when acting as an onion service client.
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
pub fn onion_service_time_period(&self) -> TimePeriod {
self.hsdir_rings.current.time_period()
}
@@ -1211,7 +1211,7 @@ impl NetDir {
///
/// These are additional time periods that we publish descriptors for when we are
/// acting as an onion service.
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
pub fn onion_service_secondary_time_periods(&self) -> Vec<TimePeriod> {
self.hsdir_rings
.secondary
@@ -1225,7 +1225,7 @@ impl NetDir {
///
/// Return an error if the time period is not one returned by
/// `onion_service_time_period` or `onion_service_secondary_time_periods`.
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
#[allow(unused, clippy::missing_panics_doc)] // TODO hs: remove.
pub fn onion_service_dirs(
&self,
@@ -1297,7 +1297,7 @@ impl<'a> UncheckedRelay<'a> {
/// Return true if this relay is a hidden service directory
///
/// Ie, if it is to be included in the hsdir ring.
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
pub(crate) fn is_hsdir_for_ring(&self) -> bool {
// TODO are there any other flags should we check?
// rend-spec-v3 2.2.3 says just
diff --git a/crates/tor-netdoc/Cargo.toml b/crates/tor-netdoc/Cargo.toml
index d4c8c02f5..93c82c0b5 100644
--- a/crates/tor-netdoc/Cargo.toml
+++ b/crates/tor-netdoc/Cargo.toml
@@ -18,8 +18,8 @@ full = ["routerdesc", "ns_consensus"]
experimental = [
"build_docs",
"experimental-api",
- "onion-client",
- "onion-service",
+ "hs-client",
+ "hs-service",
"hsdesc-inner-docs",
]
@@ -36,9 +36,9 @@ ns_consensus = []
# Client-side and service-side support for onion services.
# Experimental: not covered by semver guarantees.
# TODO hs: mark these as part of "full" once they are done and stable.
-onion-client = ["onion-common"]
-onion-service = ["onion-common", "rand"]
-onion-common = ["tor-hscrypto", "tor-linkspec", "tor-units"]
+hs-client = ["hs-common"]
+hs-service = ["hs-common", "rand"]
+hs-common = ["tor-hscrypto", "tor-linkspec", "tor-units"]
# Testing only : expose code to parse inner layers of onion service descriptors.
hsdesc-inner-docs = ["visibility"]
diff --git a/crates/tor-netdoc/fuzz/Cargo.toml b/crates/tor-netdoc/fuzz/Cargo.toml
index bc7076671..b6b33b473 100644
--- a/crates/tor-netdoc/fuzz/Cargo.toml
+++ b/crates/tor-netdoc/fuzz/Cargo.toml
@@ -14,7 +14,7 @@ libfuzzer-sys = "0.4"
[dependencies.tor-netdoc]
path = ".."
-features = ["routerdesc", "ns_consensus", "hsdesc-inner-docs", "onion-service"]
+features = ["routerdesc", "ns_consensus", "hsdesc-inner-docs", "hs-service"]
# Prevent this from interfering with workspaces
[workspace]
diff --git a/crates/tor-netdoc/src/doc.rs b/crates/tor-netdoc/src/doc.rs
index f538b6246..ddec3e64e 100644
--- a/crates/tor-netdoc/src/doc.rs
+++ b/crates/tor-netdoc/src/doc.rs
@@ -32,7 +32,7 @@
use crate::util::intern::InternCache;
pub mod authcert;
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
pub mod hsdesc;
pub mod microdesc;
pub mod netstatus;
diff --git a/crates/tor-netdoc/src/lib.rs b/crates/tor-netdoc/src/lib.rs
index 50af9b967..474379a4e 100644
--- a/crates/tor-netdoc/src/lib.rs
+++ b/crates/tor-netdoc/src/lib.rs
@@ -38,7 +38,7 @@
#![allow(clippy::result_large_err)] // temporary workaround for arti#587
//! <!-- @@ end lint list maintained by maint/add_warning @@ -->
-#[cfg(feature = "onion-service")]
+#[cfg(feature = "hs-service")]
pub(crate) mod build;
#[macro_use]
pub(crate) mod parse;
@@ -54,8 +54,8 @@ pub use util::batching_split_before;
pub use err::{BuildError, Error, ParseErrorKind, Pos};
-#[cfg(feature = "onion-service")]
-#[cfg_attr(docsrs, doc(cfg(feature = "onion-service")))]
+#[cfg(feature = "hs-service")]
+#[cfg_attr(docsrs, doc(cfg(feature = "hs-service")))]
pub use build::NetdocText;
/// Alias for the Result type returned by most objects in this module.
diff --git a/crates/tor-netdoc/src/parse/tokenize.rs b/crates/tor-netdoc/src/parse/tokenize.rs
index 7e67261ee..2e4acfad1 100644
--- a/crates/tor-netdoc/src/parse/tokenize.rs
+++ b/crates/tor-netdoc/src/parse/tokenize.rs
@@ -24,7 +24,7 @@ pub(crate) mod object {
/// indicates the end of a begin or end tag.
pub(crate) const TAG_END: &str = "-----";
/// Maximum PEM base64 line length (not enforced during parsing)
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
pub(crate) const BASE64_PEM_MAX_LINE: usize = 64;
}
diff --git a/crates/tor-proto/Cargo.toml b/crates/tor-proto/Cargo.toml
index 20df80d8d..b2e88e3bf 100644
--- a/crates/tor-proto/Cargo.toml
+++ b/crates/tor-proto/Cargo.toml
@@ -15,11 +15,11 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/"
default = []
full = ["tokio"]
-experimental = ["experimental-api", "onion-client", "onion-service", "ntor_v3"]
+experimental = ["experimental-api", "hs-client", "hs-service", "ntor_v3"]
ntor_v3 = []
-onion-client = ["onion-common"]
-onion-service = ["onion-common"]
-onion-common = []
+hs-client = ["hs-common"]
+hs-service = ["hs-common"]
+hs-common = []
experimental-api = []
# Enable testing-only APIs. APIs under this feature are not
# covered by semver.
diff --git a/crates/tor-proto/src/circuit.rs b/crates/tor-proto/src/circuit.rs
index 0868bac23..b71eb451e 100644
--- a/crates/tor-proto/src/circuit.rs
+++ b/crates/tor-proto/src/circuit.rs
@@ -41,7 +41,7 @@
pub(crate) mod celltypes;
pub(crate) mod halfcirc;
mod halfstream;
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
pub mod handshake;
mod path;
pub(crate) mod reactor;
@@ -317,7 +317,7 @@ impl ClientCirc {
///
/// Only onion services (and eventually) exit relays should call this
/// method.
- #[cfg(feature = "onion-service")]
+ #[cfg(feature = "hs-service")]
#[allow(clippy::missing_panics_doc, unused_variables)] // TODO hs remove
pub fn allow_stream_requests(
&self,
@@ -386,7 +386,7 @@ impl ClientCirc {
// TODO hs: let's try to enforce the "you can't extend a circuit again once
// it has been extended this way" property. We could do that with internal
// state, or some kind of a type state pattern.
- #[cfg(feature = "onion-common")]
+ #[cfg(feature = "hs-common")]
#[allow(clippy::missing_panics_doc, unused_variables)]
pub async fn extend_virtual(
&self,
diff --git a/crates/tor-proto/src/crypto/handshake.rs b/crates/tor-proto/src/crypto/handshake.rs
index e6322ac49..5fb4924d1 100644
--- a/crates/tor-proto/src/crypto/handshake.rs
+++ b/crates/tor-proto/src/crypto/handshake.rs
@@ -11,7 +11,7 @@
//! Currently, this module implements only the "ntor" handshake used
//! for circuits on today's Tor.
pub(crate) mod fast;
-#[cfg(feature = "onion-common")]
+#[cfg(feature = "hs-common")]
pub mod hs_ntor;
pub(crate) mod ntor;
#[cfg(feature = "ntor_v3")]
diff --git a/crates/tor-proto/src/crypto/handshake/hs_ntor.rs b/crates/tor-proto/src/crypto/handshake/hs_ntor.rs
index 9dcdc6103..92e849afe 100644
--- a/crates/tor-proto/src/crypto/handshake/hs_ntor.rs
+++ b/crates/tor-proto/src/crypto/handshake/hs_ntor.rs
@@ -15,7 +15,7 @@
//! This module is a work in progress, and is not actually used anywhere yet
//! or tested: please expect the API to change.
//!
-//! This module is available only when the `onion-common` feature is enabled.
+//! This module is available only when the `hs-common` feature is enabled.
//
// TODO hs: go through this code carefully and make sure that its APIs and
// behavior are still what we want.
diff --git a/crates/tor-proto/src/stream.rs b/crates/tor-proto/src/stream.rs
index f4f3ab55c..c6d6b2f03 100644
--- a/crates/tor-proto/src/stream.rs
+++ b/crates/tor-proto/src/stream.rs
@@ -11,7 +11,7 @@
mod cmdcheck;
mod data;
-#[cfg(feature = "onion-service")]
+#[cfg(feature = "hs-service")]
mod incoming;
mod params;
mod raw;
@@ -19,8 +19,8 @@ mod resolve;
pub(crate) use cmdcheck::{AnyCmdChecker, CmdChecker, StreamStatus};
pub use data::{DataReader, DataStream, DataWriter};
-#[cfg(feature = "onion-service")]
-#[cfg_attr(docsrs, doc(cfg(feature = "onion-service")))]
+#[cfg(feature = "hs-service")]
+#[cfg_attr(docsrs, doc(cfg(feature = "hs-service")))]
pub use incoming::{IncomingStream, IncomingStreamRequest};
pub use params::StreamParameters;
pub use raw::StreamReader;