DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
csrf.cpp File Reference

Stateless HMAC-signed CSRF token implementation (DETWS_ENABLE_CSRF). More...

#include "csrf.h"

Go to the source code of this file.

Detailed Description

Stateless HMAC-signed CSRF token implementation (DETWS_ENABLE_CSRF).

The token is <nonce_hex>.<sig_hex>; the signature is the first CSRF_SIG_BYTES of HMAC-SHA256(secret, nonce). Verification recomputes the HMAC over the embedded nonce and constant-time compares - no server-side session state.

Definition in file csrf.cpp.