37 Commits

Author SHA1 Message Date
Nicholas S. Husin
7b75446a98 internal/http3: add shutdown support for server
Currently, our HTTP/3 server that has been registered against a net/http
Server will keep running even after the net/http Server has shutdown.

Therefore, add support for shutting down a running HTTP/3 server, and
use it as part of net/http.Server.RegisterOnShutdown.

For golang/go#70914
For golang/go#77440

Change-Id: I5d2acd2cb0fef64ecf5f8d81ae79f3399ed97b00
Reviewed-on: https://go-review.googlesource.com/c/net/+/754580
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
2026-03-26 17:43:53 -07:00
Nicholas S. Husin
157f4d57d9 quic: prevent server panic when handling Retry packets with short connection ID
Per RFC 9000, a Destination Connection ID in a Retry packet is of valid
length as long as it is 20 bytes or shorter. However, when validating
tokens for Retry packets, our server currently makes an assumption that
it will only deal with a Destination Connection ID that is exactly 20
bytes long. As a result, a misbehaving or malicious client can cause our
server to panic.

When our server validates a token for a Retry packet, the nonce is
partially constructed from the Destination Connection ID. Due to our
server's bad assumption, a shorter-than-expected Destination Connection
ID will result in cipher.AEAD.Open being given a nonce of bad length. We
currently use XChaCha20-Poly1305 from x/crypto for our AEAD
implementation, which will panic when given a nonce of bad length.

Fixes golang/go#78292

Change-Id: Ieb65d8b84bcb5c531bdb46d5c75b13dad9c76eb2
Reviewed-on: https://go-review.googlesource.com/c/net/+/758360
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2026-03-23 13:38:59 -07:00
Damien Neil
faf99b58f2 quic: document that this is not yet covered by the security policy
Implied by "work in progress", but let's be explicit about it.

Change-Id: I5cc39129e5af8effb4cc64b0b07ff2176a6a6964
Reviewed-on: https://go-review.googlesource.com/c/net/+/758240
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>
2026-03-23 11:07:07 -07:00
Nicholas S. Husin
af27605f51 quic: avoid usage of net.ReadMsgUDPAddrPort in non-linux and darwin builds
Amongst the non-linux and darwin builds, net.ReadMsgUDPAddrPort is not
implemented yet in plan9. There does not seem to be any reason why we
could not use net.ReadFromUDPAddrPort instead, which is implemented in
plan9.

Therefore, use net.ReadFromUDPAddrPort instead for better compatibility.

Fixes golang/go#78223

Change-Id: Id397f28368f0cc291b12c6e06df3de64321a623b
Reviewed-on: https://go-review.googlesource.com/c/net/+/757100
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Nicholas Husin <nsh@golang.org>
Reviewed-by: Ethan Lee <ethanalee@google.com>
Reviewed-by: Richard Miller <millerresearch@gmail.com>
2026-03-19 19:36:52 -07:00
Dmitri Shuralyov
29181b8c03 all: remove go1.25 and older build constraints
Now that the x/net module requires Go 1.25.0,
the go1.25 build constraint is always satisfied.
Simplify the code accordingly.

Change-Id: I3d6fe4a132a26918455489b998730b494f5273c4
Reviewed-on: https://go-review.googlesource.com/c/net/+/744800
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-02-12 07:53:52 -08:00
Damien Neil
0b37bdfdf0 quic: don't run TestStreamsCreateConcurrency in synctest bubble
This test creates a pair of real UDP sockets; synctest doesn't work
well with real network connections and interactions between the
real network and synctest are probably causing flakiness.

Fixes golang/go#76510

Change-Id: I9e8a959e7d0077d8191ceb8284f6c338dd2688ab
Reviewed-on: https://go-review.googlesource.com/c/net/+/743402
Auto-Submit: Nicholas Husin <husin@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
2026-02-09 11:37:01 -08:00
Neal Patel
bcf2273e01 quic: clean up impossible nil conditions
Change-Id: I755d937332f671a7f5bedc73aaff31e6fbf07159
Reviewed-on: https://go-review.googlesource.com/c/net/+/739760
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-27 14:57:05 -08:00
Damien Neil
d1f64cc670 quic: use testing/synctest
Replace bespoke fake time and synchronization with testing/synctest.

Change-Id: Ic3fe9635dbad36c890783c38e00708c6cb7a15f8
Reviewed-on: https://go-review.googlesource.com/c/net/+/714482
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-10-27 13:48:05 -07:00
Damien Neil
8d76a2c082 quic: don't defer MAX_STREAMS frames indefinitely
Avoid a state where we can have a MAX_STREAMS frame to send,
but do not send the frame for an indefinite amount of time.

Conn.appendStreamFrames writes stream-related frames to
the current packet. It also handles removing streams
from the Conn when we no longer need to track their state.

Removing streams can affect the frames we want to send.
In particular, we may want to send a MAX_STREAMS to the
peer indicating that it can open more streams because
we've closed out some of the existing ones.

Add MAX_STREAMS after removing streams, to ensure we
pick up any changes to the sent value before adding it.

This case doesn't show up in  tests, because the test harness's
idleness detection causes the Conn's event loop to run and notice
the pending MAX_STREAMS frame. Changing tests to use
testing/synctest (a followup CL) causes the problem to
appear, because the event loop isn't run while the Conn
is idle.

Change-Id: Ia7394891317dae6ecfd529a9b3501ac082cb453e
Reviewed-on: https://go-review.googlesource.com/c/net/+/714481
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
2025-10-24 07:51:19 -07:00
Damien Neil
027f8b700e quic: fix expected ACK Delay in client's ACK after HANDSHAKE_DONE
testConn.handshake runs through the initial QUIC handshake
and verifies that the connection under test sends an expected
sequence of handshake messages.

The last datagram in the handshake is sent by the client,
and contains an ACK for the last datagram sent by the server.

The client sends this ACK after max_ack_delay (25ms) passes, minus
the timer granularity (1ms). The timer granularity is a constant
containing the expected maximum delay between a timer event's
scheduled time and the timer actually firing.

The expected handshake datagram used by testConn.handshake contains
an ACK with an ACK Delay value of 25ms (max_ack_delay).
This doesn't account for the timer granularity adjustment.
However, since testConn.handshake advances time by 25ms rather than 24ms,
the test connection sends the ACK at the later time and includes a
larger ACK Delay value.

Fix testConn.handshake to sleep for the expected delay (24ms).
Fix the expected handshake datagram accordingly.

This all avoids test failures after switching this package to use
testing/synctest's fake clock, under which the connection sends
this ACK at the scheduled time rather than a time under direct
control of the test.

Change-Id: I1af6e02e02f6493758e41db45a46d06a65441a7b
Reviewed-on: https://go-review.googlesource.com/c/net/+/714480
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
2025-10-24 07:51:16 -07:00
Rhys Hiltner
6e243da531 quic: update Initial keys when handling Retry
A Retry packet specifies a new connection ID for the client to use as a
destination address, in what the server will consider to be the client's
"first" Initial packet. Re-derive the Initial space's packet protection
keys, since that address is an input to their derivation function.

"Changing the Destination Connection ID field also results in a change
to the keys used to protect the Initial packet."
https://www.rfc-editor.org/rfc/rfc9000#section-17.2.5.2-4

For golang/go#58547

Change-Id: Id8acf5788a05d367f952dce33ef4b06f7e8b66e2
Reviewed-on: https://go-review.googlesource.com/c/net/+/712341
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2025-10-17 13:07:34 -07:00
Rhys Hiltner
98daa2e33a quic: send ECN feedback to peers
Track the total number of ECT(0), ECT(1), and ECN-CE state of packets we
process in each packet number space. Send it back to the peer in each
ACK frame (unless it's all zeros).

"Even if an endpoint does not set an ECT field in packets it sends, the
endpoint MUST provide feedback about ECN markings it receives, if these
are accessible."
https://www.rfc-editor.org/rfc/rfc9000#section-13.4.1-2

For golang/go#58547

Change-Id: I3ce5be6c536198eaa711f527402503b0567fc7a5
Reviewed-on: https://go-review.googlesource.com/c/net/+/712280
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-10-17 13:04:03 -07:00
cuishuang
875d966983 all: fix some comments
Including mismatched function names/struct names, repeated words, typos, etc.

Change-Id: Ia576274bce6e6fbfe4d2fca6dcd6d31bf00936fb
Reviewed-on: https://go-review.googlesource.com/c/net/+/683875
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
2025-09-15 17:28:39 -07:00
Damien Neil
3e7a445bf4 quic: skip packet numbers for optimistic ack defense
An "optimistic ACK attack" involves an attacker sending ACKs
for packets it hasn't received, causing the victim's
congestion controller to improperly send at a higher rate.

The standard defense against this attack is to skip the occasional
packet number, and to close the connection with an error if the
peer ACKs an unsent packet.

Implement this defense, increasing the gap between skipped
packet numbers as a connection's lifetime grows and correspondingly
the amount of work required on the part of the attacker.

Change-Id: I01f44f13367821b86af6535ffb69d380e2b4d7b7
Reviewed-on: https://go-review.googlesource.com/c/net/+/664298
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-04-10 11:38:36 -07:00
Damien Neil
3f563d3b0d quic: use an enum for sentPacket state
The sentPacket type tracks the state of a packet sent to the peer.
Packets can be in progress, acknowledged, or lost.
Track this state with an enum rather than a set of bools,
to avoid the possibility of nonsensical states such as a packet
being both acknowledged and lost.

This also simplifies a following change to add an "unsent" state
for intentionally skipped packet numbers.

Change-Id: I87c8fc399c72337c033ab7ec5ec8db2c56c732f9
Reviewed-on: https://go-review.googlesource.com/c/net/+/664297
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-04-09 16:02:25 -07:00
Damien Neil
a3b6e772dc quic: don't re-lose packets when discarding keys
When discarding keys for a packet number space, we remove any
in-flight packets in that space from our count of bytes in flight.
Skip any packets in the space that were already acked or declared lost.

Also skip over acked/lost packets when discarding state in response
to a Reset message. This change shouldn't have any effect, since we
never declare packets acked/lost until we receive an ACK, and we
never handle a Reset after receiving an ACK.

Change-Id: I8842f03aa06e57a834a211f1284a48fe5d469db3
Reviewed-on: https://go-review.googlesource.com/c/net/+/664335
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-04-09 16:02:13 -07:00
Damien Neil
22500a668c quic: decode packet numbers >255 in tests
Decoding QUIC packet numbers requires keeping track of the largest
packet number received so far from the peer. Our tests haven't
bothered doing that so far, so tests can't work with packet
numbers past 255.

Fix that so we can write tests that use more packets.

Change-Id: Icb795e5cf69794381c12a3a03b0da6bcf47a69c0
Reviewed-on: https://go-review.googlesource.com/c/net/+/664296
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-04-09 15:11:48 -07:00
Damien Neil
dd0b200aed quic: remove go1.21 build constraint
The x/net go.mod now depends on go1.23.

Change-Id: I24960949d84753f84f75fbdc97b7dfb92191a4d2
Reviewed-on: https://go-review.googlesource.com/c/net/+/664295
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-04-09 15:11:44 -07:00
Damien Neil
0d7dc54a59 quic: add Conn.ConnectionState
Add a method that returns the tls.ConnectionState for a connection.
Generally useful, and also required to let HTTP/3 expose the
ConnectionState in Requests.

Change-Id: Iba725e0f40c68020fc6ee45d49f5c609a2b6b493
Reviewed-on: https://go-review.googlesource.com/c/net/+/647075
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-02-25 10:41:37 -08:00
Damien Neil
56691ee141 quic: don't return EOF from ReadByte when we have a byte
Change-Id: I3be7c43fa6ceeb75582f648ee56025991eda9611
Reviewed-on: https://go-review.googlesource.com/c/net/+/642515
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>
2025-01-13 15:50:21 -08:00
Damien Neil
5566b43feb quic: add the ability to create an endpoint with a fake network
Add a NewEndpoint function to create an *Endpoint using a net.PacketConn.
We rely on a number of features of *net.UDPConn which aren't provided
by PacketConn, so an Endpoint using anything other than a UDPConn will
be limited. The main use case for providing a non-UDPConn connection
is testing, in particular tests which use testing/synctest and cannot
use a concrete network connection.

Change-Id: I9e62cb8d7d545f64d99103beb9a32f149d4119bf
Reviewed-on: https://go-review.googlesource.com/c/net/+/641498
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-01-09 11:13:18 -08:00
Damien Neil
35e1007cf8 quic, internal/quic/quicwire: split wire encode/decode functions to new package
HTTP/3 also uses QUIC varints. Move the more general-purpose wire
encoding/decoding functions into a new internal/quic/quicwire package
so they can be shared.

For golang/go#70914

Change-Id: Id888baf131e90a12247e15a6f7bc7dc37c6dc572
Reviewed-on: https://go-review.googlesource.com/c/net/+/641496
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-01-09 11:12:58 -08:00
Damien Neil
03179ce033 quic: report error string when peer closes connection
Change-Id: I2eaf8ef90dc84440e9d38b4d0573c9f6e44f71b0
Reviewed-on: https://go-review.googlesource.com/c/net/+/640798
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-01-07 14:34:40 -08:00
Damien Neil
4428704833 quic: surface connection errors in stream methods
When reading from or writing to a stream associated with a closed
connection, return the connection-level error.

Change-Id: I7f0a4b7f531d06ad1daa46d1942d37bca8ca5698
Reviewed-on: https://go-review.googlesource.com/c/net/+/640797
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-01-07 14:34:38 -08:00
Damien Neil
dc3b8a8dce quic: return error from Stream.Flush
Report errors (stream closed, stream reset) when flushing.

Change-Id: I94b7a35fe874372eb7969aacebc861c5f2e29b3c
Reviewed-on: https://go-review.googlesource.com/c/net/+/640796
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2025-01-07 08:52:09 -08:00
Damien Neil
2e6010204e quic, internal/testcert: move test cert to internal package
Move the testing-only localhost certificate to an internal package
so it can be accessed by other packages' tests.

Change-Id: I52e8cc1220ce49f99e40a5be78d4cdc2f6998a0e
Reviewed-on: https://go-review.googlesource.com/c/net/+/640795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2025-01-07 08:52:02 -08:00
cuishuang
2124140b04 all: make function and struct comments match the names
Change-Id: I1f4a4c8daec5ac7d26f1d4df76726af664adcb36
Reviewed-on: https://go-review.googlesource.com/c/net/+/639576
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Auto-Submit: Damien Neil <dneil@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2025-01-02 13:01:20 -08:00
Damien Neil
c2be9921fe quic: remember which remote connection IDs have been retired
Keep track of which peer-provided connection ID sequence numbers
we have sent a RETIRE_CONNECTION_ID for, received an ack, and
removed from our set of tracked IDs.

Rework how we track retired connection IDs in general:
Rather than keeping all state for retired IDs, just keep a
set of the sequence numbers of IDs which we're in the process
of retiring.

Change-Id: I14da8b5295d5fbe8318c8afe556cbd2c8a56d856
Reviewed-on: https://go-review.googlesource.com/c/net/+/635717
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-12-30 08:49:17 -08:00
Damien Neil
6705db9a4d quic: clean up crypto streams when dropping packet protection keys
When dropping packet protection keys for a number space:

Check to see if there is unused CRYPTO data received from the peer
in the space. If so, close the connection with an error. This can
only happen if the peer has sent us data with a gap in it. We
can never read the data that fills that gap (because we're dropping
the key it would be encrypted with), and this situation cannot
happen without the peer sending invalid TLS handshake data.

Drop any buffered CRYPTO data being sent to the peer.
Under normal operations, we may have data that was sent to the peer
but which we haven't received an ACK for yet. The peer has
received the data (or we wouldn't be dropping the number space)
and we will never see the ACK (because we're dropping the key it
would be encrypted with).

Fixes golang/go#70704

Change-Id: I53380169cb59a2a6f87e69b38522ba81ad38c2b0
Reviewed-on: https://go-review.googlesource.com/c/net/+/634617
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2024-12-10 23:31:58 +00:00
Damien Neil
4ef7588d2b quic: handle ACK frame in packet which drops number space
Avoid incorrectly closing a connection with a protocol violation
error when we receive a single packet containing a CRYPTO frame
that causes us to drop a packet number space (forgetting what
packet numbers we've sent in that space) followed by an ACK frame.

Fixes golang/go#70703

Change-Id: I37554cb6a3086736cb9d772f8a3441b544d414dc
Reviewed-on: https://go-review.googlesource.com/c/net/+/634616
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-12-10 16:56:59 +00:00
jfgiorgi
d7f220d3b8 quic: add LocalAddr and RemoteAddr to quic.Conn
These are missing for quic.Conn.

Fixes golang/go#70138

Change-Id: Ia443ffe0e73e143be5c29233a1ceb7cb16951acd
GitHub-Last-Rev: a326378fdd
GitHub-Pull-Request: golang/net#225
Reviewed-on: https://go-review.googlesource.com/c/net/+/623157
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-11-06 23:00:02 +00:00
Richard Miller
77708f716e quic: skip tests which depend on unimplemented UDP functions on Plan 9
The ReadMsgUDP and WriteMsgUDP methods of UDPConn are not implemented
(yet?) on Plan 9. Skip tests which require them.

Fixes golang/go#68288

Change-Id: Ic6c81b19322d589c10b16da61e9b89284294be05
Reviewed-on: https://go-review.googlesource.com/c/net/+/596795
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-07-05 10:47:41 +00:00
Damien Neil
603e3e6390 quic: disable X25519Kyber768Draft00 in tests
Enabling this bloats the TLS handshake so flights no longer
fit in a single datagram. Disable it in tests. Add a test
using the crypto/tls defaults, to ensure we do handshake
properly with them.

Fixes golang/go#67783

Change-Id: I521188e7b5a313e9289e726935e5b26994090b4a
Reviewed-on: https://go-review.googlesource.com/c/net/+/589855
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-06-03 16:01:40 +00:00
Damien Neil
b20cd5933a quic: initiate key rotation earlier in connections
The QUIC interop runner "keyrotate" test requires that the client
initiate a key rotation early in the connection. With our current
ack frequency, it seems that we need to rotate within the first
300-400 packets for the test to pass.

Reduce the initial key rotation from 1000 to 100 packets.
Rotating earlier shouldn't have any real downsides
(rotation is cheap and generally done once per connection,
except for very long-lived connections), and this is simpler
than providing a way to tune the rotation interval in one
specific test.

For golang/go#67138

Change-Id: I33d47ea35ed39f0a13c171adb2b0698f8c93050e
Reviewed-on: https://go-review.googlesource.com/c/net/+/582855
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-05-03 21:52:40 +00:00
Damien Neil
a130fcc1c1 quic: don't consider goroutines running when tests start as leaked
Change-Id: I138e284ee74c9402402f564d25e50ab753c51e9e
Reviewed-on: https://go-review.googlesource.com/c/net/+/576536
Reviewed-by: Chressie Himpel <chressie@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-04 20:10:37 +00:00
vitalmotif
ebc8168ac8 all: fix some typos
Change-Id: I7e2c867efcc960553da77e395b0069ab6776cd9f
GitHub-Last-Rev: eaa122d1b6
GitHub-Pull-Request: golang/net#205
Reviewed-on: https://go-review.googlesource.com/c/net/+/572995
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2024-03-21 09:28:29 +00:00
Damien Neil
fa11427993 quic: move package out of internal
For golang/go#58547

Change-Id: I119d820824f82bfdd236c6826f960d0c934745ca
Reviewed-on: https://go-review.googlesource.com/c/net/+/566295
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-02-27 18:30:56 +00:00