DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
dtls_handshake.h File Reference

DTLS 1.3 handshake framing and reliability (RFC 9147 §5, §7). More...

#include "ServerConfig.h"

Go to the source code of this file.

Detailed Description

DTLS 1.3 handshake framing and reliability (RFC 9147 §5, §7).

The datagram-reliability layer that sits between the DTLS record layer (dtls_record) and the reused TLS 1.3 message builders (tls13_msg). TLS 1.3 assumes an in-order reliable byte stream; DTLS carries the same handshake messages over lossy, reorderable datagrams, so each message gains a 12-byte DTLS handshake header (RFC 9147 §5.2) that lets a fragment be placed independently of the record that carried it, and lost flights are recovered with acknowledgements (§7) rather than TCP retransmission.

This file is pure framing - no crypto state, no sockets. It provides:

  • the 12-byte handshake header (dtls_hs_header_parse / dtls_hs_frag_build);
  • overlap-tolerant message reassembly (DtlsHsReasm), modelled on the QUIC CRYPTO-stream reassembler - a fragment may arrive split, duplicated, or overlapping (§5.4);
  • the ACK message (dtls_ack_build / dtls_ack_parse, content type 26, §7);
  • the stateless HelloRetryRequest cookie (dtls_cookie_make / dtls_cookie_verify, the §5.1 return-routability / anti-amplification defence).

The handshake state machine that drives these (flights, epochs, PTO) is dtls_conn; the TLS 1.3 message bodies and key schedule are reused verbatim from the HTTP/3 stack (tls13_msg, tls13_kdf).

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file dtls_handshake.h.