Quic.Retry (elixir_quic v0.16.7)

Copy Markdown View Source

Bounded, authenticated server Retry tokens. The endpoint owns the random key and supplies monotonic microseconds. Tokens bind the source IP/port, original DCID and Retry SCID; restarting the endpoint invalidates outstanding tokens. They prove address reachability, not a client identity, and are replayable within their short lifetime. No per-client token state is retained.

Summary

Functions

issue(key, remote, original, retry_cid, now)

@spec issue(
  binary(),
  {:inet.ip_address(), :inet.port_number()},
  binary(),
  binary(),
  integer()
) ::
  binary()

verify(key, remote, cid, token, now, ttl)

@spec verify(
  binary(),
  {:inet.ip_address(), :inet.port_number()},
  binary(),
  binary(),
  integer(),
  pos_integer()
) :: {:ok, binary()} | {:error, :invalid_retry_token}