verifyCookie

fnbool verifyCookie(const(ubyte)[] cookie, const(ubyte)[] serverSecret, DatagramEndpoint clientAddr, const(ubyte)[] clientRandom)

Verifies a cookie received from a client.

Regenerates the expected cookie from the client's address and random, then performs a constant-time comparison to prevent timing attacks.

Parameters

cookieThe cookie received from the client.
serverSecretThe server's secret key.
clientAddrThe client's network address.
clientRandomThe 32-byte ClientHello random value.

Returns

true if the cookie is valid, false otherwise.