Loading crates/tor-netdoc/Cargo.toml +1 −6 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ experimental = [ "dangerous-expose-struct-fields", "experimental-api", "incomplete", "hsdesc-inner-docs", "hs-dir", "hs-pow-full", "ns-vote", Loading @@ -59,7 +58,7 @@ incomplete = ["encode", "ns-vote", "parse2", "__is_experimental"] routerdesc = ["plain-consensus", "encode"] # Expose interfaces useful for testing testing = ["hex-literal", "hsdesc-inner-docs", "visibility"] testing = ["hex-literal", "visibility"] # Enable the "ns consensus" document type, which some relays cache and serve. plain-consensus = ["routerdesc", "encode"] Loading @@ -82,10 +81,6 @@ hs-client = ["hs-common"] hs-service = ["hs-common", "encode"] hs-common = ["tor-hscrypto", "tor-linkspec", "tor-units"] # Testing only : expose code to parse inner layers of onion service descriptors. hsdesc-inner-docs = [ "visibility", "__is_experimental", ] # TODO maybe fold this feature into `testing` # Onion service proof of work schemes hs-pow-full = ["tor-hscrypto/hs-pow-full", "__is_experimental"] Loading crates/tor-netdoc/fuzz/Cargo.toml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ libfuzzer-sys = "0.4" [dependencies.tor-netdoc] path = ".." features = ["routerdesc", "plain-consensus", "hsdesc-inner-docs", "hs-service"] features = ["routerdesc", "plain-consensus", "hs-service"] # Prevent this from interfering with workspaces [workspace] Loading crates/tor-netdoc/src/doc/hsdesc.rs +0 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ use smallvec::SmallVec; use std::result::Result as StdResult; use std::time::SystemTime; #[cfg(feature = "hsdesc-inner-docs")] pub use {inner::HsDescInner, middle::HsDescMiddle, outer::HsDescOuter}; #[cfg(feature = "hs-service")] Loading crates/tor-netdoc/src/doc/hsdesc/inner.rs +2 −4 Original line number Diff line number Diff line Loading @@ -23,8 +23,7 @@ use tor_llcrypto::pk::{ValidatableSignature, curve25519, ed25519}; /// The contents of the inner document of an onion service descriptor. #[derive(Debug, Clone)] #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(crate) struct HsDescInner { pub struct HsDescInner { /// The authentication types that this onion service accepts when /// connecting. // Loading Loading @@ -192,8 +191,7 @@ impl HsDescInner { /// /// On success, return the signing key that was used for every certificate in the /// inner document, and the inner document itself. #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(super) fn parse(s: &str) -> Result<(Option<Ed25519Identity>, UncheckedHsDescInner)> { pub fn parse(s: &str) -> Result<(Option<Ed25519Identity>, UncheckedHsDescInner)> { let mut reader = NetDocReader::new(s)?; let result = Self::take_from_reader(&mut reader).map_err(|e| e.within(s))?; Ok(result) Loading crates/tor-netdoc/src/doc/hsdesc/middle.rs +3 −6 Original line number Diff line number Diff line Loading @@ -26,8 +26,7 @@ pub(super) const HS_DESC_AUTH_TYPE: &str = "x25519"; /// A more-or-less verbatim representation of the middle document of an onion /// service descriptor. #[derive(Debug, Clone)] #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(super) struct HsDescMiddle { pub struct HsDescMiddle { /// A public key used by authorized clients to decrypt the key used to /// decrypt the encryption layer and decode the inner document. This is /// ignored if restricted discovery is not in use. Loading @@ -54,8 +53,7 @@ impl HsDescMiddle { /// /// A failure may mean either that the encryption was corrupted, or that we /// didn't have the right key. #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(super) fn decrypt_inner( pub fn decrypt_inner( &self, blinded_id: &HsBlindId, revision: RevisionCounter, Loading Loading @@ -193,8 +191,7 @@ static HS_MIDDLE_RULES: LazyLock<SectionRules<HsMiddleKwd>> = LazyLock::new(|| { impl HsDescMiddle { /// Try to parse the middle document of an onion service descriptor from a provided /// string. #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(super) fn parse(s: &str) -> Result<HsDescMiddle> { pub fn parse(s: &str) -> Result<HsDescMiddle> { let mut reader = NetDocReader::new(s)?; let result = HsDescMiddle::take_from_reader(&mut reader).map_err(|e| e.within(s))?; Ok(result) Loading Loading
crates/tor-netdoc/Cargo.toml +1 −6 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ experimental = [ "dangerous-expose-struct-fields", "experimental-api", "incomplete", "hsdesc-inner-docs", "hs-dir", "hs-pow-full", "ns-vote", Loading @@ -59,7 +58,7 @@ incomplete = ["encode", "ns-vote", "parse2", "__is_experimental"] routerdesc = ["plain-consensus", "encode"] # Expose interfaces useful for testing testing = ["hex-literal", "hsdesc-inner-docs", "visibility"] testing = ["hex-literal", "visibility"] # Enable the "ns consensus" document type, which some relays cache and serve. plain-consensus = ["routerdesc", "encode"] Loading @@ -82,10 +81,6 @@ hs-client = ["hs-common"] hs-service = ["hs-common", "encode"] hs-common = ["tor-hscrypto", "tor-linkspec", "tor-units"] # Testing only : expose code to parse inner layers of onion service descriptors. hsdesc-inner-docs = [ "visibility", "__is_experimental", ] # TODO maybe fold this feature into `testing` # Onion service proof of work schemes hs-pow-full = ["tor-hscrypto/hs-pow-full", "__is_experimental"] Loading
crates/tor-netdoc/fuzz/Cargo.toml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ libfuzzer-sys = "0.4" [dependencies.tor-netdoc] path = ".." features = ["routerdesc", "plain-consensus", "hsdesc-inner-docs", "hs-service"] features = ["routerdesc", "plain-consensus", "hs-service"] # Prevent this from interfering with workspaces [workspace] Loading
crates/tor-netdoc/src/doc/hsdesc.rs +0 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ use smallvec::SmallVec; use std::result::Result as StdResult; use std::time::SystemTime; #[cfg(feature = "hsdesc-inner-docs")] pub use {inner::HsDescInner, middle::HsDescMiddle, outer::HsDescOuter}; #[cfg(feature = "hs-service")] Loading
crates/tor-netdoc/src/doc/hsdesc/inner.rs +2 −4 Original line number Diff line number Diff line Loading @@ -23,8 +23,7 @@ use tor_llcrypto::pk::{ValidatableSignature, curve25519, ed25519}; /// The contents of the inner document of an onion service descriptor. #[derive(Debug, Clone)] #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(crate) struct HsDescInner { pub struct HsDescInner { /// The authentication types that this onion service accepts when /// connecting. // Loading Loading @@ -192,8 +191,7 @@ impl HsDescInner { /// /// On success, return the signing key that was used for every certificate in the /// inner document, and the inner document itself. #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(super) fn parse(s: &str) -> Result<(Option<Ed25519Identity>, UncheckedHsDescInner)> { pub fn parse(s: &str) -> Result<(Option<Ed25519Identity>, UncheckedHsDescInner)> { let mut reader = NetDocReader::new(s)?; let result = Self::take_from_reader(&mut reader).map_err(|e| e.within(s))?; Ok(result) Loading
crates/tor-netdoc/src/doc/hsdesc/middle.rs +3 −6 Original line number Diff line number Diff line Loading @@ -26,8 +26,7 @@ pub(super) const HS_DESC_AUTH_TYPE: &str = "x25519"; /// A more-or-less verbatim representation of the middle document of an onion /// service descriptor. #[derive(Debug, Clone)] #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(super) struct HsDescMiddle { pub struct HsDescMiddle { /// A public key used by authorized clients to decrypt the key used to /// decrypt the encryption layer and decode the inner document. This is /// ignored if restricted discovery is not in use. Loading @@ -54,8 +53,7 @@ impl HsDescMiddle { /// /// A failure may mean either that the encryption was corrupted, or that we /// didn't have the right key. #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(super) fn decrypt_inner( pub fn decrypt_inner( &self, blinded_id: &HsBlindId, revision: RevisionCounter, Loading Loading @@ -193,8 +191,7 @@ static HS_MIDDLE_RULES: LazyLock<SectionRules<HsMiddleKwd>> = LazyLock::new(|| { impl HsDescMiddle { /// Try to parse the middle document of an onion service descriptor from a provided /// string. #[cfg_attr(feature = "hsdesc-inner-docs", visibility::make(pub))] pub(super) fn parse(s: &str) -> Result<HsDescMiddle> { pub fn parse(s: &str) -> Result<HsDescMiddle> { let mut reader = NetDocReader::new(s)?; let result = HsDescMiddle::take_from_reader(&mut reader).map_err(|e| e.within(s))?; Ok(result) Loading