When a server wants to validate a client's source address before
committing handshake state, it answers the client Initial with a
Retry packet carrying an opaque address-validation token. The
client replays the token in a fresh Initial; the server validates it and
proceeds. This module ships:
- :func:
mint_retry_token / :func:validate_retry_token -- an
HMAC-SHA256 keyed token that binds the client's address and the
original Destination Connection ID with an issue timestamp, so a token
is single-path and expires. The server holds the HMAC key; the token
is opaque to the client.
- :func:
encode_retry_packet -- assemble the full Retry packet
including the RFC 9001 §5.8 Retry Integrity Tag (AEAD_AES_128_GCM over
the Retry Pseudo-Packet with the fixed v1 retry key/nonce).
- :func:
verify_retry_integrity -- recompute + compare the integrity
tag of a received Retry (client-side check).
- :func:
encode_version_negotiation -- build the Version Negotiation
packet a server sends when a client Initial carries an unsupported
QUIC version (RFC 9000 §6.1).
Not sans-I/O: the Retry Integrity Tag routes through the OpenSSL AEAD
FFI (:class:flare.quic.crypto.OpenSslQuicCrypto). The token HMAC and
the version-negotiation builder are pure, but the module as a whole
links the crypto backend, so it lives outside the sans-I/O set.
References:
- RFC 9000 §8.1 "Address Validation", §17.2.1 / §17.2.5, §6.1.
- RFC 9001 §5.8 "Retry Packet Integrity".