extractClientHelloCookie
fn
const(ubyte)[] extractClientHelloCookie(const(ubyte)[] clientHelloBody) @safe pure nothrowExtracts the cookie from a DTLS ClientHello message.
In DTLS, the ClientHello includes a cookie field after the session ID. On the first attempt the cookie is empty; after receiving a HelloVerifyRequest the client echoes the cookie back.
Parameters
clientHelloBody | The ClientHello body bytes (after DTLS handshake header). |
Returns
The cookie bytes, or an empty slice if no cookie is present.