pub struct EstablishIntro {
body: EstablishIntroDetails,
handshake_auth: CtByteArray<HS_MAC_LEN>,
mac_plaintext: Vec<u8>,
sig: Box<ValidatableEd25519Signature>,
}Expand description
A hidden services establishes a new introduction point, by sending an EstablishIntro message.
This may represent either an outbound body that we’re sending, or a decoded body that we’re receiving.
§Usage
This type is a good choice for handling an incoming EstablishIntro message on a Relay, but not for generating an outgoing EstablishIntro message.
Onion services should not construct this message object; instead, they
should construct an EstablishIntroDetails, and then call its
sign_and_encode method.
Fields§
§body: EstablishIntroDetailsThe underlying body of this, wrapped in authentication.
handshake_auth: CtByteArray<HS_MAC_LEN>The MAC of all earlier fields in the cell, using a key derived from the handshake between the onion service and the introduction point.
This MAC binds the EstablishIntro message to a single circuit, and keeps it from being replayed.
mac_plaintext: Vec<u8>A textual record of all the fields in the message that are covered by the MAC.
sig: Box<ValidatableEd25519Signature>A signature using auth_key of all contents of the message.
This signature proves possession of auth_key and thereby ensures that
the request really comes from that key’s holder.
(This field is boxed to manage variant size.)
Implementations§
Source§impl EstablishIntro
impl EstablishIntro
Sourcepub fn from_parts_for_test(
body: EstablishIntroDetails,
mac: CtByteArray<HS_MAC_LEN>,
signature: Signature,
) -> Self
pub fn from_parts_for_test( body: EstablishIntroDetails, mac: CtByteArray<HS_MAC_LEN>, signature: Signature, ) -> Self
Sourcepub fn check_and_unwrap<'a>(
self,
mac_key: impl Into<HsMacKey<'a>>,
) -> Result<EstablishIntroDetails, EstablishIntroSigError>
pub fn check_and_unwrap<'a>( self, mac_key: impl Into<HsMacKey<'a>>, ) -> Result<EstablishIntroDetails, EstablishIntroSigError>
Check whether this EstablishIntro message is well-signed (with its included key), and well authenticated with the provided MAC key.
On success, return the EstablishIntroDetails describing how to function
as an introduction point for this service. On failure, return an error.
Sourcepub fn dangerously_unwrap(self) -> EstablishIntroDetails
pub fn dangerously_unwrap(self) -> EstablishIntroDetails
Consume this EstablishIntro message and return its body.
This is a “dangerous” function because it does not check correctness for the signature or the MAC.
Trait Implementations§
Source§impl Body for EstablishIntro
impl Body for EstablishIntro
Source§fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
Source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Source§impl Clone for EstablishIntro
impl Clone for EstablishIntro
Source§fn clone(&self) -> EstablishIntro
fn clone(&self) -> EstablishIntro
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EstablishIntro
impl Debug for EstablishIntro
Source§impl From<EstablishIntro> for AnyRelayMsg
Available on crate feature hs only.
impl From<EstablishIntro> for AnyRelayMsg
hs only.Source§fn from(m: EstablishIntro) -> AnyRelayMsg
fn from(m: EstablishIntro) -> AnyRelayMsg
Source§impl HasMemoryCostStructural for EstablishIntro
impl HasMemoryCostStructural for EstablishIntro
Source§fn indirect_memory_cost(&self, et: EnabledToken) -> usize
fn indirect_memory_cost(&self, et: EnabledToken) -> usize
Source§impl RelayMsg for EstablishIntro
impl RelayMsg for EstablishIntro
Source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Source§impl TryFrom<AnyRelayMsg> for EstablishIntro
impl TryFrom<AnyRelayMsg> for EstablishIntro
Source§fn try_from(msg: AnyRelayMsg) -> Result<EstablishIntro>
fn try_from(msg: AnyRelayMsg) -> Result<EstablishIntro>
Auto Trait Implementations§
impl Freeze for EstablishIntro
impl RefUnwindSafe for EstablishIntro
impl Send for EstablishIntro
impl Sync for EstablishIntro
impl Unpin for EstablishIntro
impl UnsafeUnpin for EstablishIntro
impl UnwindSafe for EstablishIntro
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> HasMemoryCost for Twhere
T: HasMemoryCostStructural,
impl<T> HasMemoryCost for Twhere
T: HasMemoryCostStructural,
Source§fn memory_cost(&self, et: EnabledToken) -> usize
fn memory_cost(&self, et: EnabledToken) -> usize
self, in bytes Read moreSource§impl<T> HasTypedMemoryCost<T> for Twhere
T: HasMemoryCost,
impl<T> HasTypedMemoryCost<T> for Twhere
T: HasMemoryCost,
Source§fn typed_memory_cost(&self, enabled: EnabledToken) -> TypedMemoryCost<T>
fn typed_memory_cost(&self, enabled: EnabledToken) -> TypedMemoryCost<T>
TypedMemoryCost<T> rather than a raw usizeSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more