8 #include <botan/tls_messages.h>
9 #include <botan/internal/tls_handshake_io.h>
10 #include <botan/internal/tls_handshake_state.h>
21 std::vector<uint8_t> finished_compute_verify(
const Handshake_State& state,
24 const uint8_t TLS_CLIENT_LABEL[] = {
25 0x63, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20, 0x66, 0x69, 0x6E, 0x69,
26 0x73, 0x68, 0x65, 0x64 };
28 const uint8_t TLS_SERVER_LABEL[] = {
29 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x66, 0x69, 0x6E, 0x69,
30 0x73, 0x68, 0x65, 0x64 };
32 std::unique_ptr<KDF> prf(state.protocol_specific_prf());
34 std::vector<uint8_t> input;
35 std::vector<uint8_t> label;
37 label += std::make_pair(TLS_CLIENT_LABEL,
sizeof(TLS_CLIENT_LABEL));
39 label += std::make_pair(TLS_SERVER_LABEL,
sizeof(TLS_SERVER_LABEL));
41 input += state.hash().final(state.version(), state.ciphersuite().prf_algo());
43 return unlock(prf->derive_key(12, state.session_keys().master_secret(), input, label));
53 Connection_Side side) : m_verification_data(finished_compute_verify( state, side ))
61 std::vector<uint8_t> Finished::serialize()
const
63 return m_verification_data;
78 std::vector<byte> computed_verify = finished_compute_verify(state, side);
80 #if defined(BOTAN_UNSAFE_FUZZER_MODE)
83 return (m_verification_data.size() == computed_verify.size()) &&
84 same_mem(m_verification_data.data(), computed_verify.data(), computed_verify.size());
virtual std::vector< uint8_t > send(const Handshake_Message &msg)=0
bool same_mem(const T *p1, const T *p2, size_t n)
bool verify(const Handshake_State &state, Connection_Side side) const
void update(const uint8_t in[], size_t length)
std::vector< T > unlock(const secure_vector< T > &in)
Finished(Handshake_IO &io, Handshake_State &state, Connection_Side side)