Struct rustls::hash_hs::HandshakeHash
source · pub(crate) struct HandshakeHash {
ctx: Context,
client_auth: Option<Vec<u8>>,
}
Expand description
This deals with keeping a running hash of the handshake payloads. This is computed by buffering initially. Once we know what hash function we need to use we switch to incremental hashing.
For client auth, we also need to buffer all the messages. This is disabled in cases where client auth is not possible.
Fields§
§ctx: Context
None before we know what hash function we’re using
client_auth: Option<Vec<u8>>
buffer for client-auth.
Implementations§
source§impl HandshakeHash
impl HandshakeHash
sourcepub(crate) fn abandon_client_auth(&mut self)
pub(crate) fn abandon_client_auth(&mut self)
We decided not to do client auth after all, so discard the transcript.
sourcepub(crate) fn add_message(&mut self, m: &Message) -> &mut Self
pub(crate) fn add_message(&mut self, m: &Message) -> &mut Self
Hash/buffer a handshake message.
sourcefn update_raw(&mut self, buf: &[u8]) -> &mut Self
fn update_raw(&mut self, buf: &[u8]) -> &mut Self
Hash or buffer a byte slice.
sourcepub(crate) fn get_hash_given(&self, extra: &[u8]) -> Digest
pub(crate) fn get_hash_given(&self, extra: &[u8]) -> Digest
Get the hash value if we were to hash extra
too,
using hash function hash
.
pub(crate) fn into_hrr_buffer(self) -> HandshakeHashBuffer
sourcepub(crate) fn rollup_for_hrr(&mut self)
pub(crate) fn rollup_for_hrr(&mut self)
Take the current hash value, and encapsulate it in a ‘handshake_hash’ handshake message. Start this hash again, with that message at the front.
sourcepub(crate) fn get_current_hash(&self) -> Digest
pub(crate) fn get_current_hash(&self) -> Digest
Get the current hash value.
sourcepub(crate) fn take_handshake_buf(&mut self) -> Option<Vec<u8>>
pub(crate) fn take_handshake_buf(&mut self) -> Option<Vec<u8>>
Takes this object’s buffer containing all handshake messages so far. This method only works once; it resets the buffer to empty.