generateCookie
fn
ubyte[] generateCookie(const(ubyte)[] serverSecret, DatagramEndpoint clientAddr,
const(ubyte)[] clientRandom)Generates a stateless cookie for DTLS HelloVerifyRequest.
The cookie is computed as: HMAC-SHA256(serverSecret, clientAddress.toBytes() || clientRandom)
This binds the cookie to the client's address and the ClientHello random, making it unforgeable without the server secret.
Parameters
serverSecret | The server's secret key for cookie generation. |
clientAddr | The client's network address. |
clientRandom | The 32-byte ClientHello random value. |
Returns
The cookie bytes (typically 32 bytes for HMAC-SHA256).