cell: Add accessors to Introduce2.

This commit is contained in:
Nick Mathewson 2023-08-16 10:24:50 -04:00
parent 2a3fe5bf20
commit 4a5f94daa0
2 changed files with 18 additions and 0 deletions

View File

@ -1,2 +1,3 @@
ADDED: establish_intro functions now take any impl<Into<HsMacKey>>.
ADDED: Iterator over IntroEstablishedExt.
ADDED: accessors for Introduce2

View File

@ -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! {