From 53e9d702c24cb9753093e2fce02eb7198df36355 Mon Sep 17 00:00:00 2001 From: Dmitri Tikhonov Date: Sat, 1 Nov 2025 10:51:34 -0400 Subject: [PATCH 1/2] Update QUIC draft references to RFC references --- src/liblsquic/lsquic_enc_sess_ietf.c | 30 +++++++++++------------ src/liblsquic/lsquic_engine.c | 2 +- src/liblsquic/lsquic_full_conn_ietf.c | 22 ++++++++--------- src/liblsquic/lsquic_handshake.c | 2 +- src/liblsquic/lsquic_headers_stream.c | 2 +- src/liblsquic/lsquic_hkdf.c | 2 +- src/liblsquic/lsquic_hkdf.h | 8 +++--- src/liblsquic/lsquic_hq.h | 9 +++---- src/liblsquic/lsquic_ietf.h | 4 +-- src/liblsquic/lsquic_mini_conn_ietf.c | 10 ++++---- src/liblsquic/lsquic_mini_conn_ietf.h | 2 +- src/liblsquic/lsquic_packet_common.c | 4 +-- src/liblsquic/lsquic_packet_common.h | 4 +-- src/liblsquic/lsquic_packet_ietf.h | 4 +-- src/liblsquic/lsquic_parse_Q046.c | 2 +- src/liblsquic/lsquic_parse_Q050.c | 4 +-- src/liblsquic/lsquic_parse_ietf_v1.c | 16 ++++++------ src/liblsquic/lsquic_parse_iquic_common.c | 6 ++--- src/liblsquic/lsquic_pr_queue.c | 4 +-- src/liblsquic/lsquic_send_ctl.c | 4 ++- src/liblsquic/lsquic_stream.c | 6 ++--- src/liblsquic/lsquic_stream.h | 4 +-- src/liblsquic/lsquic_trans_params.c | 2 +- src/liblsquic/lsquic_trans_params.h | 20 ++++++++------- 24 files changed, 88 insertions(+), 85 deletions(-) diff --git a/src/liblsquic/lsquic_enc_sess_ietf.c b/src/liblsquic/lsquic_enc_sess_ietf.c index ae5222334..8d39bbe77 100644 --- a/src/liblsquic/lsquic_enc_sess_ietf.c +++ b/src/liblsquic/lsquic_enc_sess_ietf.c @@ -176,7 +176,7 @@ static struct label_set hkdf_labels[2] = }; -/* [draft-ietf-quic-tls-12] Section 5.3.6 */ +/* [RFC 9001] Section 5.1 (Packet Protection Keys) */ static int init_crypto_ctx (struct crypto_ctx *crypto_ctx, const EVP_MD *md, const EVP_AEAD *aead, const unsigned char *secret, @@ -1138,14 +1138,14 @@ static const unsigned char *const lsquic_ver2salt[N_LSQVER] = { }; -/* [draft-ietf-quic-tls-12] Section 5.3.2 */ +/* [RFC 9001] Section 5.2 (Initial Secrets) */ static int setup_handshake_keys (struct enc_sess_iquic *enc_sess, const lsquic_cid_t *cid) { const EVP_MD *const md = EVP_sha256(); const EVP_AEAD *const aead = EVP_aead_aes_128_gcm(); - /* [draft-ietf-quic-tls-12] Section 5.6.1: AEAD_AES_128_GCM implies - * 128-bit AES-CTR. + /* [RFC 9001] Sections 5.3 and 5.4.3: AEAD_AES_128_GCM implies + * 128-bit AES-CTR for header protection. */ const EVP_CIPHER *const cipher = EVP_aes_128_ecb(); struct crypto_ctx_pair *pair; @@ -1656,7 +1656,7 @@ get_crypto_params (const struct enc_sess_iquic *enc_sess, iv_sz = EVP_AEAD_nonce_length(params->aead); if (iv_sz < 8) - iv_sz = 8; /* [draft-ietf-quic-tls-11], Section 5.3 */ + iv_sz = 8; /* Old drafts used 8-byte nonce */ if (iv_sz > EVP_MAX_IV_LENGTH) { LSQ_DEBUG("iv size %u is too large", iv_sz); @@ -1667,7 +1667,7 @@ get_crypto_params (const struct enc_sess_iquic *enc_sess, } -/* [draft-ietf-quic-transport-31] Section 7.4.1: +/* [RFC 9001] Section 7.4.1 (Accepting and Rejecting 0-RTT): " If 0-RTT data is accepted by the server, the server MUST NOT reduce " any limits or alter any values that might be violated by the client " with its 0-RTT data. In particular, a server that accepts 0-RTT data @@ -2174,7 +2174,7 @@ iquic_esf_encrypt_packet (enc_session_t *enc_session_p, if (packet_out->po_data_sz < 3) { - /* [draft-ietf-quic-tls-20] Section 5.4.2 */ + /* [RFC 9001] Section 5.4.2 (Packet Protection) */ enum packno_bits bits = lsquic_packet_out_packno_bits(packet_out); unsigned len = iquic_packno_bits2len(bits); if (packet_out->po_data_sz + len < 4) @@ -3455,16 +3455,16 @@ const struct lsquic_stream_if lsquic_mini_cry_sm_if = const unsigned char *const lsquic_retry_key_buf[N_IETF_RETRY_VERSIONS] = { - /* [draft-ietf-quic-tls-25] Section 5.8 */ + /* [RFC 9001] Section 5.8 (draft-25 for backward compatibility) */ (unsigned char *) "\x4d\x32\xec\xdb\x2a\x21\x33\xc8\x41\xe4\x04\x3d\xf2\x7d\x44\x30", - /* [draft-ietf-quic-tls-29] Section 5.8 */ + /* [RFC 9001] Section 5.8 (draft-29 for backward compatibility) */ (unsigned char *) "\xcc\xce\x18\x7e\xd0\x9a\x09\xd0\x57\x28\x15\x5a\x6c\xb9\x6b\xe1", - /* [draft-ietf-quic-tls-33] Section 5.8 */ + /* [RFC 9001] Section 5.8 (Retry Packet Integrity) */ (unsigned char *) "\xbe\x0c\x69\x0b\x9f\x66\x57\x5a\x1d\x76\x6b\x54\xe3\x68\xc8\x4e", - /* [draft-draft-ietf-quic-v2] Section 3.3.3 */ + /* [RFC 9369] Section 3.3.3 (QUIC Version 2) */ (unsigned char *) "\x8f\xb4\xb0\x1b\x56\xac\x48\xe2\x60\xfb\xcb\xce\xad\x7c\xcc\x92", }; @@ -3472,13 +3472,13 @@ const unsigned char *const lsquic_retry_key_buf[N_IETF_RETRY_VERSIONS] = const unsigned char *const lsquic_retry_nonce_buf[N_IETF_RETRY_VERSIONS] = { - /* [draft-ietf-quic-tls-25] Section 5.8 */ + /* [RFC 9001] Section 5.8 (draft-25 for backward compatibility) */ (unsigned char *) "\x4d\x16\x11\xd0\x55\x13\xa5\x52\xc5\x87\xd5\x75", - /* [draft-ietf-quic-tls-29] Section 5.8 */ + /* [RFC 9001] Section 5.8 (draft-29 for backward compatibility) */ (unsigned char *) "\xe5\x49\x30\xf9\x7f\x21\x36\xf0\x53\x0a\x8c\x1c", - /* [draft-ietf-quic-tls-33] Section 5.8 */ + /* [RFC 9001] Section 5.8 (Retry Packet Integrity) */ (unsigned char *) "\x46\x15\x99\xd3\x5d\x63\x2b\xf2\x23\x98\x25\xbb", - /* [draft-draft-ietf-quic-v2] Section 3.3.3 */ + /* [RFC 9369] Section 3.3.3 (QUIC Version 2) */ (unsigned char *) "\xd8\x69\x69\xbc\x2d\x7c\x6d\x99\x90\xef\xb0\x4a", }; diff --git a/src/liblsquic/lsquic_engine.c b/src/liblsquic/lsquic_engine.c index 8477810ff..f75330412 100644 --- a/src/liblsquic/lsquic_engine.c +++ b/src/liblsquic/lsquic_engine.c @@ -3293,7 +3293,7 @@ lsquic_engine_packet_in (lsquic_engine_t *engine, break; } - /* [draft-ietf-quic-transport-30] Section 12.2: + /* [RFC 9000] Section 12.2 (Coalescing Packets): * " Receivers SHOULD ignore any subsequent packets with a different * " Destination Connection ID than the first packet in the datagram. */ diff --git a/src/liblsquic/lsquic_full_conn_ietf.c b/src/liblsquic/lsquic_full_conn_ietf.c index de32fe80b..0c14c6818 100644 --- a/src/liblsquic/lsquic_full_conn_ietf.c +++ b/src/liblsquic/lsquic_full_conn_ietf.c @@ -6514,9 +6514,9 @@ process_retire_connection_id_frame (struct ietf_full_conn *conn, uint64_t seqno; int parsed_len; - /* [draft-ietf-quic-transport-25] Section 19.16 + /* [RFC 9000] Section 19.16 (RETIRE_CONNECTION_ID Frame): * - * - Peer cannot retire zero-lenth CID. (MUST treat as PROTOCOL_VIOLATION) + * - Peer cannot retire zero-length CID. (MUST treat as PROTOCOL_VIOLATION) * - Peer cannot retire CID with sequence number that has not been * allocated yet. (MUST treat as PROTOCOL_VIOLATION) * - Peer cannot retire CID that matches the DCID in packet. @@ -6608,7 +6608,7 @@ process_new_token_frame (struct ietf_full_conn *conn, } if (conn->ifc_flags & IFC_SERVER) - { /* [draft-ietf-quic-transport-34] Section 19.7 */ + { /* [RFC 9000] Section 19.7 (NEW_TOKEN Frame) */ ABORT_QUIETLY(0, TEC_PROTOCOL_VIOLATION, "received unexpected NEW_TOKEN frame"); return 0; @@ -7286,7 +7286,7 @@ process_retry_packet (struct ietf_full_conn *conn, if (conn->ifc_flags & (IFC_SERVER|IFC_RETRIED)) { - /* [draft-ietf-quic-transport-24] Section 17.2.5: + /* [RFC 9000] Section 17.2.5 (Retry Packet): " After the client has received and processed an Initial or Retry " packet from the server, it MUST discard any subsequent Retry " packets that it receives. @@ -7301,7 +7301,7 @@ process_retry_packet (struct ietf_full_conn *conn, packet_in->pi_scid_len)) { /* - * [draft-ietf-quic-transport-24] Section 17.2.5: + * [RFC 9000] Section 17.2.5 (Retry Packet): " A client MUST discard a Retry packet that contains a Source " Connection ID field that is identical to the Destination " Connection ID field of its Initial packet. @@ -7716,8 +7716,8 @@ process_regular_packet (struct ietf_full_conn *conn, if (PNS_APP == pns && (cpath = &conn->ifc_paths[packet_in->pi_path_id], cpath->cop_flags & COP_SPIN_BIT) - /* [draft-ietf-quic-transport-30] Section 17.3.1 talks about - * how spin bit value is set. + /* [RFC 9000] Section 17.3.1 (1-RTT Packet) talks about how + * spin bit value is set. */ && (packet_in->pi_packno > cpath->cop_max_packno /* Zero means "unset", in which case any incoming packet @@ -7831,7 +7831,7 @@ process_incoming_packet_verneg (struct ietf_full_conn *conn, } } - /* [draft-ietf-quic-transport-28] Section 6.2: + /* [RFC 9000] Section 6.2 (Using Server Retry): " A client MUST discard a Version Negotiation packet that lists the " QUIC version selected by the client. */ @@ -7842,7 +7842,7 @@ process_incoming_packet_verneg (struct ietf_full_conn *conn, return 0; } - /* [draft-ietf-quic-transport-28] Section 6.2: + /* [RFC 9000] Section 6.2 (Using Server Retry): " A client that supports only this version of QUIC MUST abandon the " current connection attempt if it receives a Version Negotiation " packet [...] @@ -8693,7 +8693,7 @@ ietf_full_conn_ci_tick (struct lsquic_conn *lconn, lsquic_time_t now) conn->ifc_send_flags &= ~SF_SEND_PING; /* It may have rung */ } - /* [draft-ietf-quic-transport-11] Section 7.9: + /* [RFC 9000] Section 19.2 (PING Frame): * * The PING frame can be used to keep a connection alive when an * application or application protocol wishes to prevent the connection @@ -9354,7 +9354,7 @@ on_setting (void *ctx, uint64_t setting_id, uint64_t value) case 3: /* HTTP/2 SETTINGS_MAX_CONCURRENT_STREAMS */ case 4: /* HTTP/2 SETTINGS_INITIAL_WINDOW_SIZE */ case 5: /* HTTP/2 SETTINGS_MAX_FRAME_SIZE */ - /* [draft-ietf-quic-http-30] Section 7.2.4.1 */ + /* [RFC 9114] Section 7.2.4.1 (Defined SETTINGS Parameters) */ ABORT_QUIETLY(1, HEC_SETTINGS_ERROR, "unexpected HTTP/2 setting " "%"PRIu64, setting_id); break; diff --git a/src/liblsquic/lsquic_handshake.c b/src/liblsquic/lsquic_handshake.c index da2e0d8e7..e0e8b53c8 100644 --- a/src/liblsquic/lsquic_handshake.c +++ b/src/liblsquic/lsquic_handshake.c @@ -4000,7 +4000,7 @@ gquic2_esf_encrypt_packet (enc_session_t *enc_session_p, if (packet_out->po_data_sz < 3) { - /* [draft-ietf-quic-tls-20] Section 5.4.2 */ + /* [RFC 9001] Section 5.4.2 (Packet Protection) */ enum packno_bits bits = lsquic_packet_out_packno_bits(packet_out); /* XXX same packet rules as in IETF QUIC? */ unsigned len = iquic_packno_bits2len(bits); diff --git a/src/liblsquic/lsquic_headers_stream.c b/src/liblsquic/lsquic_headers_stream.c index dadd19793..2fbc9bb54 100644 --- a/src/liblsquic/lsquic_headers_stream.c +++ b/src/liblsquic/lsquic_headers_stream.c @@ -358,7 +358,7 @@ headers_on_settings (void *ctx, uint16_t setting_id, uint32_t setting_value) case SETTINGS_MAX_CONCURRENT_STREAMS: case SETTINGS_INITIAL_WINDOW_SIZE: case SETTINGS_MAX_FRAME_SIZE: - /* [draft-ietf-quic-http-00], Section 3 */ + /* [RFC 9114], Section 3.2.1 (HTTP/3 vs HTTP/2 Settings) */ LSQ_INFO("Specifying setting 0x%X is a QUIC error", setting_id); hs->hs_callbacks->hsc_on_conn_error(hs->hs_cb_ctx); break; diff --git a/src/liblsquic/lsquic_hkdf.c b/src/liblsquic/lsquic_hkdf.c index 0928bf30e..fa10715ad 100644 --- a/src/liblsquic/lsquic_hkdf.c +++ b/src/liblsquic/lsquic_hkdf.c @@ -8,7 +8,7 @@ #include "lsquic_hkdf.h" -/* [draft-ietf-quic-tls-17] Section 5 */ +/* [RFC 9001] Section 5.1 (Packet Protection Keys) */ void lsquic_qhkdf_expand (const EVP_MD *md, const unsigned char *secret, unsigned secret_len, const char *label, uint8_t label_len, diff --git a/src/liblsquic/lsquic_hkdf.h b/src/liblsquic/lsquic_hkdf.h index 7d83c9f03..14bbc4669 100644 --- a/src/liblsquic/lsquic_hkdf.h +++ b/src/liblsquic/lsquic_hkdf.h @@ -2,19 +2,19 @@ #ifndef LSQUIC_HKDF_H #define LSQUIC_HKDF_H 1 -/* [draft-ietf-quic-tls-23] Section 5.2 */ +/* [RFC 9001] Section 5.2 (Initial Secrets) - draft-23 for backward compatibility */ #define HSK_SALT_BUF "\xc3\xee\xf7\x12\xc7\x2e\xbb\x5a\x11\xa7" \ "\xd2\x43\x2b\xb4\x63\x65\xbe\xf9\xf5\x02" #define HSK_SALT_PRE29 ((unsigned char *) HSK_SALT_BUF) -/* [draft-ietf-quic-tls-29] Section 5.2 */ +/* [RFC 9001] Section 5.2 (Initial Secrets) - draft-29 for backward compatibility */ #define HSK_SALT_PRE33 ((unsigned char *) \ "\xaf\xbf\xec\x28\x99\x93\xd2\x4c\x9e\x97" \ "\x86\xf1\x9c\x61\x11\xe0\x43\x90\xa8\x99") -/* [draft-ietf-quic-tls-33] Section 5.2 */ +/* [RFC 9001] Section 5.2 (Initial Secrets) */ #define HSK_SALT ((unsigned char *) \ "\x38\x76\x2c\xf7\xf5\x59\x34\xb3\x4d\x17" \ "\x9a\xe6\xa4\xc8\x0c\xad\xcc\xbb\x7f\x0a") -/* [draft-ietf-quic-v2] Section 3.3.1 */ +/* [RFC 9369] Section 3.2 (QUIC Version 2 Initial Salt) */ #define HSK_SALT_V2 ((unsigned char *) \ "\x0d\xed\xe3\xde\xf7\x00\xa6\xdb\x81\x93" \ "\x81\xbe\x6e\x26\x9d\xcb\xf9\xbd\x2e\xd9") diff --git a/src/liblsquic/lsquic_hq.h b/src/liblsquic/lsquic_hq.h index 062dfa730..4a5177407 100644 --- a/src/liblsquic/lsquic_hq.h +++ b/src/liblsquic/lsquic_hq.h @@ -8,7 +8,7 @@ struct lsquic_ext_http_prio; -/* [draft-ietf-quic-http-27] Section 11.2.1 */ +/* [RFC 9114] Section 7.2.1 (HTTP/3 Frame Types) */ enum hq_frame_type { HQFT_DATA = 0, @@ -47,8 +47,8 @@ enum hq_setting_id #define HQ_DF_QPACK_BLOCKED_STREAMS 0 -/* [draft-ietf-quic-http-19] Section 10.6, - * [draft-ietf-quic-qpack-07] Section 8.2 +/* [RFC 9114] Section 6.2 (Unidirectional Stream Types), + * [RFC 9204] Section 4.2 (QPACK Encoder and Decoder Streams) */ enum hq_uni_stream_type { @@ -59,8 +59,7 @@ enum hq_uni_stream_type }; -/* [draft-ietf-quic-http-23] Section 8.1 and - * [draft-ietf-quic-qpack-08], Section 8.3 +/* [RFC 9114] Section 8.1 (HTTP/3 Error Codes) */ enum http_error_code { diff --git a/src/liblsquic/lsquic_ietf.h b/src/liblsquic/lsquic_ietf.h index e9349e390..bcfb39c02 100644 --- a/src/liblsquic/lsquic_ietf.h +++ b/src/liblsquic/lsquic_ietf.h @@ -4,7 +4,7 @@ /* Things specific to the IETF version of QUIC that do not fit anywhere else */ -/* [draft-ietf-quic-transport-33] Section 20 */ +/* [RFC 9000] Section 20 (Error Codes) */ enum trans_error_code { TEC_NO_ERROR = 0x0, @@ -30,7 +30,7 @@ enum trans_error_code /* Must be at least two */ #define MAX_IETF_CONN_DCIDS 8 -/* [draft-ietf-quic-tls-25] Section 5.8 */ +/* [RFC 9001] Section 5.8 (Retry Packet Integrity) */ #define IETF_RETRY_KEY_SZ 16 #define IETF_RETRY_NONCE_SZ 12 diff --git a/src/liblsquic/lsquic_mini_conn_ietf.c b/src/liblsquic/lsquic_mini_conn_ietf.c index f052387e2..0b3b4b971 100644 --- a/src/liblsquic/lsquic_mini_conn_ietf.c +++ b/src/liblsquic/lsquic_mini_conn_ietf.c @@ -529,7 +529,7 @@ is_first_packet_ok (const struct lsquic_packet_in *packet_in, { if (udp_payload_size < IQUIC_MIN_INIT_PACKET_SZ) { - /* [draft-ietf-quic-transport-24] Section 14 */ + /* [RFC 9000] Section 14.1 (Initial Datagram Size) */ LSQ_LOG1(LSQ_LOG_DEBUG, "incoming UDP payload too small: %zu bytes", udp_payload_size); return 0; @@ -923,8 +923,8 @@ ietf_mini_conn_ci_next_packet_to_send (struct lsquic_conn *lconn, { if (packet_out->po_flags & PO_SENT) continue; - /* [draft-ietf-quic-transport-32] Section 14.1: - " a server MUST expand the payload of all UDP datagrams carrying + /* [RFC 9000] Section 14.1 (Initial Datagram Size): + " A server MUST expand the payload of all UDP datagrams carrying " ack-eliciting Initial packets to at least the smallest allowed " maximum datagram size of 1200 bytes. */ @@ -1549,7 +1549,7 @@ imico_maybe_delay_processing (struct ietf_mini_conn *conn, } -/* [draft-ietf-quic-transport-30] Section 8.1: +/* [RFC 9000] Section 8.1 (Address Validation During Connection Establishment): " Additionally, a server MAY consider the client address validated if " the client uses a connection ID chosen by the server and the " connection ID contains at least 64 bits of entropy. @@ -2211,7 +2211,7 @@ imico_generate_conn_close (struct ietf_mini_conn *conn) } -/* [draft-ietf-quic-transport-28] Section 10.3.1: +/* [RFC 9000] Section 10.2.3 (Immediate Close during the Handshake): * " A client will always know whether the server has Handshake keys (see " Section 17.2.2.1), but it is possible that a server does not know diff --git a/src/liblsquic/lsquic_mini_conn_ietf.h b/src/liblsquic/lsquic_mini_conn_ietf.h index 9308d06bc..3fc82b0b5 100644 --- a/src/liblsquic/lsquic_mini_conn_ietf.h +++ b/src/liblsquic/lsquic_mini_conn_ietf.h @@ -120,7 +120,7 @@ struct ietf_mini_conn struct network_path imc_path; }; -/* [draft-ietf-quic-transport-24] Section 7.4 +/* [RFC 9000] Section 7.5 (Cryptographic Message Buffering): * " Implementations MUST support buffering at least 4096 bytes of data " received in CRYPTO frames out of order. Endpoints MAY choose to diff --git a/src/liblsquic/lsquic_packet_common.c b/src/liblsquic/lsquic_packet_common.c index dde7a1a6a..b4942a190 100644 --- a/src/liblsquic/lsquic_packet_common.c +++ b/src/liblsquic/lsquic_packet_common.c @@ -89,7 +89,7 @@ const char *const lsquic_hety2str[] = }; -/* [draft-ietf-quic-tls-14], Section 4 */ +/* [RFC 9001], Section 4.1.4 (Packet Numbers) */ const enum packnum_space lsquic_hety2pns[] = { [HETY_SHORT] = PNS_APP, @@ -101,7 +101,7 @@ const enum packnum_space lsquic_hety2pns[] = }; -/* [draft-ietf-quic-tls-14], Section 4 */ +/* [RFC 9001], Section 4.1.4 (Packet Numbers) */ const enum packnum_space lsquic_enclev2pns[] = { [ENC_LEV_INIT] = PNS_INIT, diff --git a/src/liblsquic/lsquic_packet_common.h b/src/liblsquic/lsquic_packet_common.h index c82d0580b..2d255a5c0 100644 --- a/src/liblsquic/lsquic_packet_common.h +++ b/src/liblsquic/lsquic_packet_common.h @@ -206,13 +206,13 @@ extern const char *const lsquic_pns2str[]; | QUIC_FTBIT_TIMESTAMP \ | QUIC_FTBIT_CRYPTO ) -/* [draft-ietf-quic-transport-24] Section 1.2 */ +/* [RFC 9000] Section 13.2.1 (Frames and Frame Types) */ #define IQUIC_FRAME_ACKABLE_MASK ( \ (ALL_IQUIC_FRAMES | QUIC_FTBIT_DATAGRAM) \ & ~(QUIC_FTBIT_ACK | QUIC_FTBIT_PADDING \ | QUIC_FTBIT_CONNECTION_CLOSE | QUIC_FTBIT_TIMESTAMP)) -/* [draft-ietf-quic-transport-20], Section 13.2 */ +/* [RFC 9000], Section 13.3 (Retransmission of Information) */ /* We bend some rules and retransmit BLOCKED, MAX_DATA, MAX_STREAM_DATA, * MAX_STREAMS, STREAM_BLOCKED, and STREAMS_BLOCKED frames instead of * regenerating them. This keeps the code simple(r). diff --git a/src/liblsquic/lsquic_packet_ietf.h b/src/liblsquic/lsquic_packet_ietf.h index c744cf9c0..69a9df59a 100644 --- a/src/liblsquic/lsquic_packet_ietf.h +++ b/src/liblsquic/lsquic_packet_ietf.h @@ -11,7 +11,7 @@ iquic_packno_bits2len(uint64_t b) return (b) + 1; } -/* [draft-ietf-quic-transport-22] Section 7.2: +/* [RFC 9000] Section 7.2 (Negotiating Connection IDs): " When an Initial packet is sent by a client that has not previously received an Initial or Retry packet from the server, it populates the @@ -24,7 +24,7 @@ iquic_packno_bits2len(uint64_t b) */ #define MIN_INITIAL_DCID_LEN 8 -/* [draft-ietf-quic-transport-24] Section 8.1 */ +/* [RFC 9000] Section 14.1 (Initial Datagram Size) */ #define IQUIC_MIN_INIT_PACKET_SZ 1200 /* Our stream code makes an assumption that packet size is smaller than the diff --git a/src/liblsquic/lsquic_parse_Q046.c b/src/liblsquic/lsquic_parse_Q046.c index c6fc7b801..8ab46e380 100644 --- a/src/liblsquic/lsquic_parse_Q046.c +++ b/src/liblsquic/lsquic_parse_Q046.c @@ -129,7 +129,7 @@ gquic_Q046_packout_header_size_long (const struct lsquic_conn *lconn, } -/* [draft-ietf-quic-transport-17] Section-17.2 */ +/* [RFC 9000] Section 17.2 (Long Header Packet Types) */ static const unsigned char header_type_to_bin[] = { [HETY_INITIAL] = 0x0, [HETY_0RTT] = 0x1, diff --git a/src/liblsquic/lsquic_parse_Q050.c b/src/liblsquic/lsquic_parse_Q050.c index 210e5bb51..5c4d1ba84 100644 --- a/src/liblsquic/lsquic_parse_Q050.c +++ b/src/liblsquic/lsquic_parse_Q050.c @@ -35,7 +35,7 @@ #include "lsquic_logger.h" -/* [draft-ietf-quic-transport-24] Section-17.2 */ +/* [RFC 9000] Section 17.2 (Long Header Packet Types) */ static const enum header_type bits2ht[4] = { [0] = HETY_INITIAL, @@ -318,7 +318,7 @@ gquic_Q050_packout_header_size_long_by_flags (const struct lsquic_conn *lconn, } -/* [draft-ietf-quic-transport-17] Section-17.2 */ +/* [RFC 9000] Section 17.2 (Long Header Packet Types) */ static const unsigned char header_type_to_bin[] = { [HETY_INITIAL] = 0x0, [HETY_0RTT] = 0x1, diff --git a/src/liblsquic/lsquic_parse_ietf_v1.c b/src/liblsquic/lsquic_parse_ietf_v1.c index a0e6747e2..d60a219c4 100644 --- a/src/liblsquic/lsquic_parse_ietf_v1.c +++ b/src/liblsquic/lsquic_parse_ietf_v1.c @@ -150,7 +150,7 @@ ietf_v1_packout_max_header_size (const struct lsquic_conn *lconn, } -/* [draft-ietf-quic-transport-17] Section-17.2 */ +/* [RFC 9000] Section 17.2 (Long Header Packet Types) */ static const unsigned char header_type_to_bin[] = { [HETY_INITIAL] = 0x0, [HETY_0RTT] = 0x1, @@ -159,7 +159,7 @@ static const unsigned char header_type_to_bin[] = { }; -/* [draft-ietf-quic-v2] Section-3.2 */ +/* [RFC 9369] Section 3.2 (Long Header Packet Types) */ static const unsigned char header_type_to_bin_v2[] = { [HETY_INITIAL] = 0x1, [HETY_0RTT] = 0x2, @@ -1117,7 +1117,7 @@ ietf_v1_calc_stream_frame_header_sz (lsquic_stream_id_t stream_id, } -/* [draft-ietf-quic-transport-24] Section 19.6 */ +/* [RFC 9000] Section 19.6 (CRYPTO Frame) */ static size_t ietf_v1_calc_crypto_frame_header_sz (uint64_t offset, unsigned data_sz) { @@ -1705,7 +1705,7 @@ ietf_v1_gen_new_connection_id_frame (unsigned char *buf, size_t buf_sz, } -/* [draft-ietf-quic-transport-17] Section-17.2 */ +/* [RFC 9000] Section 17.2 (Long Header Packet Types) */ static const enum header_type bits2ht[4] = { [0] = HETY_INITIAL, @@ -1855,9 +1855,9 @@ lsquic_ietf_v1_parse_packet_in_long_begin (struct lsquic_packet_in *packet_in, if (p >= end) return -1; if (p - /* [draft-ietf-quic-transport-25] Section 17.2.5 says that "a - * client MUST discard a Retry packet with a zero-length Retry - * Token field." We might as well do it here. + /* [RFC 9000] Section 17.2.5 (Retry Packet) says that "a client + * MUST discard a Retry packet with a zero-length Retry Token + * field." We might as well do it here. */ + 1 /* Integrity tag length: */ @@ -2005,7 +2005,7 @@ lsquic_ietf_v1_parse_packet_in_short_begin (struct lsquic_packet_in *packet_in, /* By the time this function has been called, we know length is non-zero */ byte = packet_in->pi_data[0]; - /* [draft-ietf-quic-transport-17] Section 17.3 */ + /* [RFC 9000] Section 17.3.1 (1-RTT Packet) */ /* 01SRRKPP */ if (cid_len) diff --git a/src/liblsquic/lsquic_parse_iquic_common.c b/src/liblsquic/lsquic_parse_iquic_common.c index 88a074c57..d3d4e54fe 100644 --- a/src/liblsquic/lsquic_parse_iquic_common.c +++ b/src/liblsquic/lsquic_parse_iquic_common.c @@ -31,7 +31,7 @@ #include "lsquic_ietf.h" -/* [draft-ietf-quic-transport-17] Section-17.2 */ +/* [RFC 9000] Section 17.2 (Long Header Packet Types) */ static const enum header_type bits2ht[4] = { [0] = HETY_INITIAL, @@ -395,8 +395,8 @@ lsquic_iquic_gen_retry_pkt (unsigned char *buf, size_t bufsz, ssize_t sz; #define INTEGRITY_TAG_LEN 16 - /* [draft-ietf-quic-tls-25] Section 5.8 specifies the layout of the - * Retry Pseudo-Packet: + /* [RFC 9001] Section 5.8 (Retry Packet Integrity) specifies the layout + * of the Retry Pseudo-Packet: */ unsigned char ad_buf[ 1 + MAX_CID_LEN /* ODCID */ diff --git a/src/liblsquic/lsquic_pr_queue.c b/src/liblsquic/lsquic_pr_queue.c index 6e5c3f831..92fcbe967 100644 --- a/src/liblsquic/lsquic_pr_queue.c +++ b/src/liblsquic/lsquic_pr_queue.c @@ -79,12 +79,12 @@ struct evanescent_conn }; -/* [draft-ietf-quic-transport-22], Section 17.2.1 */ +/* [RFC 9000], Section 17.2.1 (Version Negotiation Packet) */ #define IQUIC_VERNEG_SIZE (1 /* Type */ + 4 /* Version (zero tag) */ \ + 1 /* DCIL */ + MAX_CID_LEN + 1 /* SCIL */ + MAX_CID_LEN + \ 4 * N_LSQVER) -/* [draft-ietf-quic-transport-22], Section 17.2.5 */ +/* [RFC 9000], Section 17.2.5 (Retry Packet) */ #define IQUIC_RETRY_SIZE (1 /* Type */ + 4 /* Version */ + \ + 1 /* DCIL */ + MAX_CID_LEN + 1 /* SCIL */ + MAX_CID_LEN + \ + 1 /* ODCIL */ + MAX_CID_LEN + MAX_RETRY_TOKEN_LEN) diff --git a/src/liblsquic/lsquic_send_ctl.c b/src/liblsquic/lsquic_send_ctl.c index c4c20daf2..890e9fc97 100644 --- a/src/liblsquic/lsquic_send_ctl.c +++ b/src/liblsquic/lsquic_send_ctl.c @@ -487,7 +487,9 @@ set_retx_alarm (struct lsquic_send_ctl *ctl, enum packnum_space pns, switch (rm) { case RETX_MODE_HANDSHAKE: - /* [draft-iyengar-quic-loss-recovery-01]: + /* Google QUIC handshake retransmission timeout (not used for IETF QUIC). + * Based on draft-iyengar-quic-loss-recovery-01 (pre-IETF). + * IETF QUIC uses PTO algorithm from RFC 9002 Section 6.2 instead. * * if (handshake packets are outstanding): * alarm_duration = max(1.5 * smoothed_rtt, 10ms) << handshake_count; diff --git a/src/liblsquic/lsquic_stream.c b/src/liblsquic/lsquic_stream.c index eca58b667..54db205ac 100644 --- a/src/liblsquic/lsquic_stream.c +++ b/src/liblsquic/lsquic_stream.c @@ -4842,7 +4842,7 @@ update_type_hist_and_check (const struct lsquic_stream *stream, filter->hqfi_flags |= HQFI_FLAG_DATA; break; case HQFT_PUSH_PROMISE: - /* [draft-ietf-quic-http-24], Section 7 */ + /* [RFC 9114], Section 7.2.5 (PUSH_PROMISE) */ if ((stream->id & SIT_MASK) == SIT_BIDI_CLIENT && !(stream->sm_bflags & SMBF_SERVER)) return 0; @@ -4852,13 +4852,13 @@ update_type_hist_and_check (const struct lsquic_stream *stream, case HQFT_SETTINGS: case HQFT_GOAWAY: case HQFT_MAX_PUSH_ID: - /* [draft-ietf-quic-http-24], Section 7 */ + /* [RFC 9114], Section 6.2 (Unidirectional Streams) */ return -1; case 2: /* HTTP/2 PRIORITY */ case 6: /* HTTP/2 PING */ case 8: /* HTTP/2 WINDOW_UPDATE */ case 9: /* HTTP/2 CONTINUATION */ - /* [draft-ietf-quic-http-30], Section 7.2.8 */ + /* [RFC 9114], Section 7.2.8 (HTTP/2 Frames) */ return -1; case HQFT_PRIORITY_UPDATE_STREAM: case HQFT_PRIORITY_UPDATE_PUSH: diff --git a/src/liblsquic/lsquic_stream.h b/src/liblsquic/lsquic_stream.h index e1240d98b..eb20ef46a 100644 --- a/src/liblsquic/lsquic_stream.h +++ b/src/liblsquic/lsquic_stream.h @@ -602,7 +602,7 @@ lsquic_stream_set_stream_if (struct lsquic_stream *, uint64_t lsquic_stream_combined_send_off (const struct lsquic_stream *); -/* [draft-ietf-quic-transport-16] Section 3.1 */ +/* [RFC 9000] Section 3.1 (Stream States - Sending) */ enum stream_state_sending { SSS_READY, @@ -618,7 +618,7 @@ extern const char *const lsquic_sss2str[]; enum stream_state_sending lsquic_stream_sending_state (const struct lsquic_stream *); -/* [draft-ietf-quic-transport-16] Section 3.2 */ +/* [RFC 9000] Section 3.2 (Stream States - Receiving) */ enum stream_state_receiving { SSR_RECV, diff --git a/src/liblsquic/lsquic_trans_params.c b/src/liblsquic/lsquic_trans_params.c index 77cbe6259..2fb91f55f 100644 --- a/src/liblsquic/lsquic_trans_params.c +++ b/src/liblsquic/lsquic_trans_params.c @@ -615,7 +615,7 @@ lsquic_tp_decode (const unsigned char *const buf, size_t bufsz, break; case TPI_ORIGINAL_DEST_CID: case TPI_RETRY_SOURCE_CID: - /* [draft-ietf-quic-transport-28] Section 18.2: + /* [RFC 9000] Section 18.2 (Transport Parameter Definitions): " A client MUST NOT include any server-only transport parameter: " original_destination_connection_id, preferred_address, " retry_source_connection_id, or stateless_reset_token. diff --git a/src/liblsquic/lsquic_trans_params.h b/src/liblsquic/lsquic_trans_params.h index 2521815a5..b9624e37c 100644 --- a/src/liblsquic/lsquic_trans_params.h +++ b/src/liblsquic/lsquic_trans_params.h @@ -133,10 +133,10 @@ struct transport_params #define TP_DEF_MAX_ACK_DELAY 25u #define TP_DEF_ACTIVE_CONNECTION_ID_LIMIT 2 -/* [draft-ietf-quic-transport-34], Section 18.2 */ +/* [RFC 9000], Section 18.2 */ #define TP_MAX_ACK_DELAY_EXP 20 -/* [draft-ietf-quic-transport-18], Section 18.1 */ +/* [RFC 9000], Section 18.2 */ #define TP_MAX_MAX_ACK_DELAY ((1u << 14) - 1) #define TP_DEFAULT_VALUES \ @@ -191,7 +191,7 @@ lsquic_tp_has_pref_ipv6 (const struct transport_params *); extern const char * const lsquic_tpi2str[LAST_TPI + 1]; -/* From [draft-huitema-quic-ts-03] */ +/* From [draft-huitema-quic-ts-08] */ #define TS_WANT_THEM 1 #define TS_GENERATE_THEM 2 @@ -201,7 +201,7 @@ lsquic_tp_get_quantum_sz (void); #endif #define SERVER_0RTT_TPS (0 \ - /* [draft-ietf-quic-transport-31] Section 7.4.1: */ \ + /* [RFC 9000] Section 7.4.1 (Accepting and Rejecting 0-RTT): */ \ | (1 << TPI_ACTIVE_CONNECTION_ID_LIMIT) \ | (1 << TPI_INIT_MAX_DATA) \ | (1 << TPI_INIT_MAX_STREAMS_UNI) \ @@ -213,14 +213,16 @@ lsquic_tp_get_quantum_sz (void); | (1 << TPI_MAX_UDP_PAYLOAD_SIZE) \ | (1 << TPI_DISABLE_ACTIVE_MIGRATION) \ /* Not including TPI_LOSS_BITS, see */ \ - /* draft-ferrieuxhamchaoui-quic-lossbits-03, Section 5.1 */ \ - /* [draft-ietf-quic-datagram-01] Section 3: */ \ + /* [draft-ferrieuxhamchaoui-quic-lossbits-03], Section 5.1 */ \ + /* [RFC 9221] Section 3: */ \ | (1 << TPI_MAX_DATAGRAM_FRAME_SIZE) \ - /* [draft-iyengar-quic-delayed-ack-01] does not specfiy, store: */ \ + /* [draft-ietf-quic-ack-frequency-12] Section 3 does not specify */ \ + /* whether min_ack_delay should be stored for 0-RTT, we store: */ \ | (1 << TPI_MIN_ACK_DELAY) \ - /* [draft-iyengar-quic-delayed-ack-02] does not specfiy, store: */ \ + /* Support both -01 and -02 versions of delayed-ack draft (now */ \ + /* superseded by ack-frequency-12). Functionally identical: */ \ | (1 << TPI_MIN_ACK_DELAY_02) \ - /* [draft-huitema-quic-ts-03] does not specfiy, store: */ \ + /* [draft-huitema-quic-ts-08] does not specify, store: */ \ | (1 << TPI_TIMESTAMPS) \ ) From 63e36b5a1f4f90afecc87f37f379738e3b1b2517 Mon Sep 17 00:00:00 2001 From: Dmitri Tikhonov Date: Thu, 27 Nov 2025 08:08:19 -0500 Subject: [PATCH 2/2] Update src/liblsquic/lsquic_enc_sess_ietf.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/liblsquic/lsquic_enc_sess_ietf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liblsquic/lsquic_enc_sess_ietf.c b/src/liblsquic/lsquic_enc_sess_ietf.c index 8d39bbe77..23d98a6dc 100644 --- a/src/liblsquic/lsquic_enc_sess_ietf.c +++ b/src/liblsquic/lsquic_enc_sess_ietf.c @@ -1667,7 +1667,7 @@ get_crypto_params (const struct enc_sess_iquic *enc_sess, } -/* [RFC 9001] Section 7.4.1 (Accepting and Rejecting 0-RTT): +/* [RFC 9000] Section 7.4.1 (Accepting and Rejecting 0-RTT): " If 0-RTT data is accepted by the server, the server MUST NOT reduce " any limits or alter any values that might be violated by the client " with its 0-RTT data. In particular, a server that accepts 0-RTT data