Mercurial > hg > nginx
comparison src/event/quic/ngx_event_quic_output.c @ 9189:fcec773dd249
QUIC: avoid partial expansion of PATH_CHALLENGE/PATH_RESPONSE.
By default packets with these frames are expanded to 1200 bytes. Previously,
if anti-amplification limit did not allow this expansion, it was limited to
whatever size was allowed. However RFC 9000 clearly states no partial
expansion should happen in both cases.
Section 8.2.1. Initiating Path Validation:
An endpoint MUST expand datagrams that contain a PATH_CHALLENGE frame
to at least the smallest allowed maximum datagram size of 1200 bytes,
unless the anti-amplification limit for the path does not permit
sending a datagram of this size.
Section 8.2.2. Path Validation Responses:
An endpoint MUST expand datagrams that contain a PATH_RESPONSE frame
to at least the smallest allowed maximum datagram size of 1200 bytes.
...
However, an endpoint MUST NOT expand the datagram containing the
PATH_RESPONSE if the resulting data exceeds the anti-amplification limit.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Wed, 29 Nov 2023 18:13:25 +0400 |
parents | 7ec761f0365f |
children | 3a67dd34b6cc |
comparison
equal
deleted
inserted
replaced
9188:b05c622715fa | 9189:fcec773dd249 |
---|---|
61 static ngx_uint_t ngx_quic_get_padding_level(ngx_connection_t *c); | 61 static ngx_uint_t ngx_quic_get_padding_level(ngx_connection_t *c); |
62 static ssize_t ngx_quic_send(ngx_connection_t *c, u_char *buf, size_t len, | 62 static ssize_t ngx_quic_send(ngx_connection_t *c, u_char *buf, size_t len, |
63 struct sockaddr *sockaddr, socklen_t socklen); | 63 struct sockaddr *sockaddr, socklen_t socklen); |
64 static void ngx_quic_set_packet_number(ngx_quic_header_t *pkt, | 64 static void ngx_quic_set_packet_number(ngx_quic_header_t *pkt, |
65 ngx_quic_send_ctx_t *ctx); | 65 ngx_quic_send_ctx_t *ctx); |
66 static size_t ngx_quic_path_limit(ngx_connection_t *c, ngx_quic_path_t *path, | |
67 size_t size); | |
68 | 66 |
69 | 67 |
70 ngx_int_t | 68 ngx_int_t |
71 ngx_quic_output(ngx_connection_t *c) | 69 ngx_quic_output(ngx_connection_t *c) |
72 { | 70 { |
1248 | 1246 |
1249 return NGX_OK; | 1247 return NGX_OK; |
1250 } | 1248 } |
1251 | 1249 |
1252 | 1250 |
1253 static size_t | 1251 size_t |
1254 ngx_quic_path_limit(ngx_connection_t *c, ngx_quic_path_t *path, size_t size) | 1252 ngx_quic_path_limit(ngx_connection_t *c, ngx_quic_path_t *path, size_t size) |
1255 { | 1253 { |
1256 off_t max; | 1254 off_t max; |
1257 | 1255 |
1258 if (!path->validated) { | 1256 if (!path->validated) { |