WolfSSL 中的 DTLS `HelloVerifyRequest`/`HelloRetryRequest`

DTLS `HelloVerifyRequest`/`HelloRetryRequest` in WolfSSL

section 4.2.1 of RFC 6347 中描述的由 HelloVerifyRequest 发起的 cookie 交换对于 DTLS 中的 DoS 保护至关重要。除非我忽略了什么,否则 WolfSSL 文档并没有真正描述如何通过其 DTLS 实现启用此 cookie 交换。

我能找到的最接近的是函数 wolfSSL_send_hrr_cookie,关于它的手册说明:

This function is called on the server side to indicate that a HelloRetryRequest message must contain a Cookie. The Cookie holds a hash of the current transcript so that another server process can handle the ClientHello in reply. The secret is used when generting the integrity check on the Cookie data.

据我了解,HelloRetryRequest(比较HelloVerifyRequest)是 TLS 1.3 术语。 DTLS 1.3 尚未最终确定。如何在 WolfSSL 中启用和控制 DTLS 1.0/1.2 cookie 交换?

默认启用 DTLS Hello Cookie。 wolfSSL 服务器代码使用文件 src/wolfio.c 中的回调函数 EmbedGenerateCookie() 根据 RFC 6347 §4.2.1.

中的建议生成 cookie

TLSv1.3 的 hrr_cookie 与其他内容无关。