10#include <botan/tls_messages.h>
13#include <botan/internal/ct_utils.h>
14#include <botan/internal/tls_handshake_io.h>
15#include <botan/internal/tls_handshake_state.h>
17#if defined(BOTAN_HAS_TLS_13)
18 #include <botan/internal/tls_cipher_state.h>
28std::vector<uint8_t> finished_compute_verify_12(
const Handshake_State& state,
Connection_Side side) {
29 const uint8_t TLS_CLIENT_LABEL[] = {
30 0x63, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20, 0x66, 0x69, 0x6E, 0x69, 0x73, 0x68, 0x65, 0x64};
32 const uint8_t TLS_SERVER_LABEL[] = {
33 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x66, 0x69, 0x6E, 0x69, 0x73, 0x68, 0x65, 0x64};
35 auto prf = state.protocol_specific_prf();
37 std::vector<uint8_t> input;
38 std::vector<uint8_t> label;
40 : std::make_pair(TLS_SERVER_LABEL,
sizeof(TLS_SERVER_LABEL));
42 input += state.hash().final(state.ciphersuite().prf_algo());
44 return unlock(prf->derive_key(12, state.session_keys().master_secret(), input, label));
65 std::vector<uint8_t> computed_verify = finished_compute_verify_12(state, side);
67#if defined(BOTAN_UNSAFE_FUZZER_MODE)
79#if defined(BOTAN_HAS_TLS_13)
bool verify_peer_finished_mac(const Transcript_Hash &transcript_hash, const std::vector< uint8_t > &peer_mac) const
std::vector< uint8_t > finished_mac(const Transcript_Hash &transcript_hash) const
bool verify(const Handshake_State &state, Connection_Side side) const
Finished_12(Handshake_IO &io, Handshake_State &state, Connection_Side side)
bool verify(Cipher_State *cipher_state, const Transcript_Hash &transcript_hash) const
Finished_13(Cipher_State *cipher_state, const Transcript_Hash &transcript_hash)
Finished(const std::vector< uint8_t > &buf)
std::vector< uint8_t > serialize() const override
std::vector< uint8_t > verify_data() const
std::vector< uint8_t > m_verification_data
void update(const uint8_t in[], size_t length)
virtual std::vector< uint8_t > send(const Handshake_Message &msg)=0
constexpr CT::Mask< T > is_equal(const T x[], const T y[], size_t len)
std::vector< uint8_t > Transcript_Hash
std::vector< T > unlock(const secure_vector< T > &in)