diff --git a/crates/tor-cell/semver.md b/crates/tor-cell/semver.md index d187e5957..e730ea735 100644 --- a/crates/tor-cell/semver.md +++ b/crates/tor-cell/semver.md @@ -1,2 +1,3 @@ ADDED: establish_intro functions now take any impl>. ADDED: Iterator over IntroEstablishedExt. +ADDED: accessors for Introduce2 diff --git a/crates/tor-cell/src/relaycell/hs.rs b/crates/tor-cell/src/relaycell/hs.rs index 45510c8e9..6e1dae407 100644 --- a/crates/tor-cell/src/relaycell/hs.rs +++ b/crates/tor-cell/src/relaycell/hs.rs @@ -111,6 +111,23 @@ impl Introduce2 { msg, } } + + /// Return the bytes used to transmit `header`. + /// + /// (This data is used as part of the handshake.) + pub fn encoded_header(&self) -> &[u8] { + &self.encoded_header[..] + } + /// Return the parsed header of this message. + pub fn header(&self) -> &IntroduceHeader { + &self.msg.header + } + /// Return the encrypted body of this message. + /// + /// (This body is decrypted as part of the handshake.) + pub fn encrypted_body(&self) -> &[u8] { + &self.msg.encrypted[..] + } } caret_int! {