5#include "noise/protocol.h"
49 std::shared_ptr<APINoiseContext>
ctx_;
uint8_t frame_header_padding_
uint8_t frame_footer_size_
APINoiseFrameHelper(std::unique_ptr< socket::Socket > socket, std::shared_ptr< APINoiseContext > ctx, const ClientInfo *client_info)
APIError write_protobuf_packet(uint8_t type, ProtoWriteBuffer buffer) override
uint8_t rx_header_buf_len_
NoiseCipherState * send_cipher_
APIError read_packet(ReadPacketBuffer *buffer) override
APIError write_protobuf_packets(ProtoWriteBuffer buffer, std::span< const PacketInfo > packets) override
NoiseCipherState * recv_cipher_
~APINoiseFrameHelper() override
std::vector< uint8_t > prologue_
APIError try_read_frame_(std::vector< uint8_t > *frame)
Read a packet into the rx_buf_.
APIError state_action_()
To be called from read/write methods.
APIError handle_noise_error_(int err, const char *func_name, APIError api_err)
APIError loop() override
Run through handshake messages (if in that phase)
NoiseHandshakeState * handshake_
uint8_t rx_header_buf_[3]
uint8_t frame_header_padding() override
APIError handle_handshake_frame_error_(APIError aerr)
APIError write_frame_(const uint8_t *data, uint16_t len)
std::shared_ptr< APINoiseContext > ctx_
uint8_t frame_footer_size() override
APIError init() override
Initialize the frame helper, returns OK if successful.
APIError check_handshake_finished_()
void send_explicit_handshake_reject_(const std::string &reason)
APIError init_handshake_()
Initiate the data structures for the handshake.