Skip to content

Stateless reset token must be difficult to guess #4520

@maskit

Description

@maskit
  • STATELESS_RESET_TOKEN_KEY should be configurable
  • CID should be used as a salt

QUICStatelessResetToken::_gen_token(uint64_t data)
{
CryptoHash _hash;
static constexpr char STATELESS_RESET_TOKEN_KEY[] = "stateless_token_reset_key";
CryptoContext ctx;
ctx.update(STATELESS_RESET_TOKEN_KEY, strlen(STATELESS_RESET_TOKEN_KEY));
ctx.update(reinterpret_cast<void *>(&data), 8);
ctx.finalize(_hash);

   A single static key can be used across all connections to the same
   endpoint by generating the proof using a second iteration of a
   preimage-resistant function that takes a static key and the
   connection ID chosen by the endpoint (see Section 5.1) as input.  An
   endpoint could use HMAC [RFC2104] (for example, HMAC(static_key,
   connection_id)) or HKDF [RFC5869] (for example, using the static key
   as input keying material, with the connection ID as salt).  The
   output of this function is truncated to 16 octets to produce the
   Stateless Reset Token for that connection.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions