13#include <unordered_map>
33 std::chrono::system_clock::time_point
expiry;
57 [[nodiscard]]
auto is_valid() const noexcept ->
bool;
123 auto store(
const std::string& server,
137 [[nodiscard]]
auto retrieve(
const std::string& server,
138 unsigned short port)
const
139 -> std::optional<session_ticket_info>;
147 auto remove(
const std::string& server,
unsigned short port) -> bool;
153 auto cleanup_expired() -> size_t;
158 auto clear() -> void;
164 [[nodiscard]]
auto size() const ->
size_t;
172 [[nodiscard]] auto has_ticket(const std::
string& server,
173 unsigned short port) const ->
bool;
182 [[nodiscard]] static auto make_key(const std::
string& server,
183 unsigned short port) -> std::
string;
218 std::chrono::seconds window_size{10};
221 size_t max_entries{100000};
243 [[nodiscard]]
auto check_and_record(
244 std::span<const uint8_t> nonce,
245 std::chrono::system_clock::time_point timestamp
246 = std::chrono::system_clock::now()) -> bool;
253 auto cleanup(std::chrono::system_clock::time_point now
254 = std::chrono::system_clock::now()) -> size_t;
259 auto clear() -> void;
265 [[nodiscard]]
auto size() const ->
size_t;
Anti-replay protection for 0-RTT data.
std::vector< nonce_entry > entries_
Thread-safe storage for QUIC session tickets.
session_ticket_store & operator=(const session_ticket_store &)=delete
~session_ticket_store()=default
Destructor.
session_ticket_store()=default
Default constructor.
session_ticket_store(session_ticket_store &&)=delete
session_ticket_store & operator=(session_ticket_store &&)=delete
session_ticket_store(const session_ticket_store &)=delete
Configuration for the replay filter.
std::vector< uint8_t > nonce
std::chrono::system_clock::time_point timestamp
Contains session ticket data for 0-RTT resumption.
std::chrono::system_clock::time_point received_time
Time when the ticket was received.
std::chrono::system_clock::time_point expiry
Ticket expiration time.
auto is_valid() const noexcept -> bool
Check if the ticket is still valid (not expired)
std::string server_name
Server name (for SNI matching)
auto get_obfuscated_age() const noexcept -> uint32_t
Get obfuscated ticket age (RFC 8446 Section 4.2.11.1)
transport_parameters saved_params
Saved transport parameters from the original connection.
uint32_t ticket_age_add
Ticket age add value for obfuscation (RFC 8446)
unsigned short port
Server port (for endpoint matching)
std::vector< uint8_t > ticket_data
Raw session ticket data from TLS 1.3 NewSessionTicket.
uint32_t max_early_data_size
Maximum early data size allowed (from max_early_data_size extension)
QUIC transport parameters (RFC 9000 Section 18)