pub struct HandshakeHash {
ctx: Context,
client_auth: Option<Vec<u8>>,
override_buffer: 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.
override_buffer: Option<Vec<u8>>
Implementations§
source§impl HandshakeHash
impl HandshakeHash
pub fn new(alg: &'static Algorithm) -> HandshakeHash
sourcepub fn new_override(
static_buffer: Vec<u8>,
alg: &'static Algorithm,
) -> HandshakeHash
pub fn new_override( static_buffer: Vec<u8>, alg: &'static Algorithm, ) -> HandshakeHash
Creates a Handshake hash which return the same override hash always
sourcepub fn abandon_client_auth(&mut self)
pub fn abandon_client_auth(&mut self)
We decided not to do client auth after all, so discard the transcript.
sourcepub fn add_message(&mut self, m: &Message) -> &mut Self
pub 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 fn get_hash_given(&self, extra: &[u8]) -> Digest
pub fn get_hash_given(&self, extra: &[u8]) -> Digest
Get the hash value if we were to hash extra
too,
using hash function hash
.
pub fn into_hrr_buffer(self) -> HandshakeHashBuffer
sourcepub fn rollup_for_hrr(&mut self)
pub 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 fn get_current_hash(&self) -> Digest
pub fn get_current_hash(&self) -> Digest
Get the current hash value.
pub fn get_current_hash_raw(&self) -> Vec<u8>
sourcepub fn take_handshake_buf(&mut self) -> Option<Vec<u8>>
pub 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.
Trait Implementations§
source§impl Clone for HandshakeHash
impl Clone for HandshakeHash
source§fn clone(&self) -> HandshakeHash
fn clone(&self) -> HandshakeHash
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HandshakeHash
impl Debug for HandshakeHash
source§impl EvaluatedTerm<TLSProtocolTypes> for HandshakeHash
impl EvaluatedTerm<TLSProtocolTypes> for HandshakeHash
source§fn extract_knowledge<'a>(
&'a self,
knowledges: &mut Vec<Knowledge<'a, TLSProtocolTypes>>,
matcher: Option<<TLSProtocolTypes as ProtocolTypes>::Matcher>,
source: &'a Source,
) -> Result<(), Error>
fn extract_knowledge<'a>( &'a self, knowledges: &mut Vec<Knowledge<'a, TLSProtocolTypes>>, matcher: Option<<TLSProtocolTypes as ProtocolTypes>::Matcher>, source: &'a Source, ) -> Result<(), Error>
knowledges
with new knowledge gathered form the type implementing EvaluatedTerm
by recursively calling extract_knowledge on all contained element
This will put source as the source of all the produced knowledge, matcher is also passed
recursively but might be overwritten by a type with a more specific matcherAuto Trait Implementations§
impl Freeze for HandshakeHash
impl RefUnwindSafe for HandshakeHash
impl Send for HandshakeHash
impl Sync for HandshakeHash
impl Unpin for HandshakeHash
impl UnwindSafe for HandshakeHash
Blanket Implementations§
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
§impl<T> CloneAny for T
impl<T> CloneAny for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
TupleList
], of an [Prepend::prepend()
] call,
including the prepended entry.