9#ifndef BOTAN_TLS_RECORDS_H_
10#define BOTAN_TLS_RECORDS_H_
12#include <botan/aead.h>
13#include <botan/tls_algos.h>
14#include <botan/tls_magic.h>
15#include <botan/tls_version.h>
16#include <botan/internal/tls_channel_impl.h>
27class Connection_Sequence_Numbers;
42 bool uses_encrypt_then_mac);
51 std::vector<uint8_t>
aead_nonce(
const uint8_t record[],
size_t record_len, uint64_t seq);
62 std::unique_ptr<AEAD_Mode> m_aead;
64 std::vector<uint8_t> m_nonce;
66 size_t m_nonce_bytes_from_handshake;
67 size_t m_nonce_bytes_from_record;
78 size_t needed()
const {
return m_needed; }
90 uint16_t
epoch()
const {
return static_cast<uint16_t
>(
sequence() >> 48); }
115 Protocol_Version record_version,
116 uint64_t record_sequence,
117 const uint8_t* message,
133 Protocol_Version record_version,
134 uint64_t record_sequence,
135 const uint8_t* message,
137 Connection_Cipher_State& cipherstate,
149 const uint8_t input[],
155 bool allow_epoch0_restart);
#define BOTAN_ASSERT_NOMSG(expr)
#define BOTAN_ASSERT_NONNULL(ptr)
size_t nonce_bytes_from_record() const
Nonce_Format nonce_format() const
size_t nonce_bytes_from_handshake() const
Connection_Cipher_State(Protocol_Version version, Connection_Side which_side, bool is_our_side, const Ciphersuite &suite, const Session_Keys &keys, bool uses_encrypt_then_mac)
std::vector< uint8_t > aead_nonce(uint64_t seq, RandomNumberGenerator &rng)
std::vector< uint8_t > format_ad(uint64_t seq, Record_Type type, Protocol_Version version, uint16_t ptext_length)
int(* final)(unsigned char *, CTX *)
Record_Header read_record(bool is_datagram, secure_vector< uint8_t > &readbuf, const uint8_t input[], size_t input_len, size_t &consumed, secure_vector< uint8_t > &recbuf, Connection_Sequence_Numbers *sequence_numbers, const get_cipherstate_fn &get_cipherstate, bool allow_epoch0_restart)
void write_unencrypted_record(secure_vector< uint8_t > &output, Record_Type record_type, Protocol_Version version, uint64_t record_sequence, const uint8_t *message, size_t message_len)
std::function< std::shared_ptr< Connection_Cipher_State >(uint16_t)> get_cipherstate_fn
void write_record(secure_vector< uint8_t > &output, Record_Type record_type, Protocol_Version version, uint64_t record_sequence, const uint8_t *message, size_t message_len, Connection_Cipher_State &cs, RandomNumberGenerator &rng)
std::vector< T, secure_allocator< T > > secure_vector