From f5ae4f7ace1adf1f76acad9abd0a16231d758eae Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 4 Dec 2019 13:23:29 -0800 Subject: [PATCH] quic: stateless reset generate strategy Generate stateless reset token cryptographically Fixes: https://github.com/nodejs/quic/issues/62 PR-URL: https://github.com/nodejs/quic/pull/215 Reviewed-By: Anna Henningsen --- doc/api/errors.md | 4 + doc/api/quic.md | 9 ++ lib/internal/errors.js | 3 + lib/internal/quic/core.js | 12 ++- lib/internal/quic/util.js | 14 +++ src/node_quic.cc | 1 + src/node_quic_crypto.cc | 23 ++++- src/node_quic_crypto.h | 10 +- src/node_quic_session.cc | 31 +++++- src/node_quic_session.h | 24 ++++- src/node_quic_socket.cc | 123 ++++++++++++++++++----- src/node_quic_socket.h | 20 +++- src/node_quic_util.h | 3 + test/parallel/test-quic-client-server.js | 9 +- 14 files changed, 244 insertions(+), 42 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 91895b97e7..f09d9f19ef 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1671,6 +1671,10 @@ TBD TBD + +### ERR_QUICSOCKET_INVALID_STATELESS_RESET_SECRET_LENGTH +TBD + ### ERR_QUICSOCKET_LISTENING diff --git a/doc/api/quic.md b/doc/api/quic.md index 5392309594..48a16a884b 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1596,6 +1596,15 @@ Changing TTL values is typically done for network probes or when multicasting. The argument to `socket.setTTL()` is a number of hops between `1` and `255`. The default on most systems is `64` but can vary. +#### quicsocket.statelessResetCount + + +* Type: {BigInt} + +A `BigInt` that represents the number of stateless resets that have been sent. + #### quicsocket.unref();