Botan 3.6.1
Crypto and TLS for C&
|
#include <tls_transcript_hash_13.h>
Public Member Functions | |
Transcript_Hash_State | clone () const |
const Transcript_Hash & | current () const |
Transcript_Hash_State & | operator= (const Transcript_Hash_State &)=delete |
Transcript_Hash_State & | operator= (Transcript_Hash_State &&)=default |
const Transcript_Hash & | previous () const |
void | set_algorithm (std::string_view algo_spec) |
Transcript_Hash_State ()=default | |
Transcript_Hash_State (std::string_view algo_spec) | |
Transcript_Hash_State (Transcript_Hash_State &&)=default | |
const Transcript_Hash & | truncated () const |
void | update (std::span< const uint8_t > serialized_message_s) |
~Transcript_Hash_State ()=default | |
Static Public Member Functions | |
static Transcript_Hash_State | recreate_after_hello_retry_request (std::string_view algo_spec, const Transcript_Hash_State &prev_transcript_hash_state) |
Wraps the behaviour of the TLS 1.3 transcript hash as described in RFC 8446 4.4.1. Particularly, it hides the complexity that the utilized hash algorithm might become evident only after receiving a server hello message.
Definition at line 28 of file tls_transcript_hash_13.h.
|
default |
Botan::TLS::Transcript_Hash_State::Transcript_Hash_State | ( | std::string_view | algo_spec | ) |
Definition at line 19 of file tls_transcript_hash_13.cpp.
References set_algorithm().
|
default |
|
default |
Transcript_Hash_State Botan::TLS::Transcript_Hash_State::clone | ( | ) | const |
Definition at line 203 of file tls_transcript_hash_13.cpp.
Referenced by Botan::TLS::PSK::calculate_binders(), and Botan::TLS::Client_Hello_13::retry().
const Transcript_Hash & Botan::TLS::Transcript_Hash_State::current | ( | ) | const |
returns the latest transcript hash (given an algorithm was already specified and some data was provided to update
)
Definition at line 175 of file tls_transcript_hash_13.cpp.
References BOTAN_STATE_CHECK.
|
delete |
|
default |
const Transcript_Hash & Botan::TLS::Transcript_Hash_State::previous | ( | ) | const |
returns the second-latest transcript hash throws if no 'current' was ever replaced by a call to update
Definition at line 180 of file tls_transcript_hash_13.cpp.
References BOTAN_STATE_CHECK.
|
static |
Recreates a Transcript_Hash_State after receiving a Hello Retry Request. Note that the prev_transcript_hash_state
must not have an hash algorithm set, yet. Furthermore it must contain exactly TWO unprocessed messages:
Definition at line 30 of file tls_transcript_hash_13.cpp.
References BOTAN_ASSERT_NOMSG, BOTAN_STATE_CHECK, and update().
void Botan::TLS::Transcript_Hash_State::set_algorithm | ( | std::string_view | algo_spec | ) |
Definition at line 190 of file tls_transcript_hash_13.cpp.
References BOTAN_STATE_CHECK, Botan::HashFunction::create_or_throw(), and update.
Referenced by Botan::TLS::PSK::calculate_binders(), and Transcript_Hash_State().
const Transcript_Hash & Botan::TLS::Transcript_Hash_State::truncated | ( | ) | const |
returns a truncated transcript hash (see RFC 8446 4.2.11.2)
This is useful for implementing PSK binders in the PSK extension of client hello. It is a transcript over a partially marshalled client hello message. This hash is available only if the last processed message was a client hello with a PSK extension.
throws if no 'truncated' hash is available
Definition at line 185 of file tls_transcript_hash_13.cpp.
References BOTAN_STATE_CHECK.
void Botan::TLS::Transcript_Hash_State::update | ( | std::span< const uint8_t > | serialized_message_s | ) |
Definition at line 147 of file tls_transcript_hash_13.cpp.
References Botan::TLS::ClientHello.
Referenced by Botan::TLS::Handshake_Layer::next_message(), Botan::TLS::Handshake_Layer::prepare_message(), and recreate_after_hello_retry_request().