Commit Graph

4838 Commits

Author SHA1 Message Date
Rüdiger Klaehn 67be5b889f Merge branch 'main' into swallow-send-error 2026-03-09 15:03:43 +01:00
Ruediger Klaehn 4f5ea195ae Log and drop transient send errors instead of forwarding them
On ESP32 I got ENOMEM occasionally when sending, which before this change
would tear down the entire connection.

The fn is_transient_send_error should maybe be extended to other error codes,
but this is the only one I encountered.
2026-03-09 15:56:46 +02:00
dignifiedquire 6b1767964d chore: fix release config 2026-03-09 14:45:33 +01:00
Ruediger Klaehn e9ecada0f0 Log and drop send errors instead of forwarding them, which tears down the connection 2026-03-09 15:43:17 +02:00
dignifiedquire 87bc101847 docs: create CHANGELOG.md 2026-03-09 14:42:54 +01:00
dignifiedquire faeddf58ee chore: Release noq-proto-v0.16.0 noq-udp-v0.9.0 noq-v0.17.0 2026-03-09 14:41:38 +01:00
dignifiedquire 13695a47ab chore: release prep 2026-03-09 14:40:18 +01:00
Philipp Krüger 752588b980 fix(proto): Avoid unwrapping VarInt decoding during TransportParameter parsing (#485)
* fuzz: add fuzzing target for parsing transport parameters

* proto: avoid unwrapping varint decoding during parameters parsing

---------

Co-authored-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
2026-03-09 10:57:09 +00:00
Diva Martínez c5c0d2f856 reduce log level (#482) 2026-03-06 14:49:36 +00:00
Philipp Krüger bb46490ea7 feat(proto)!: Don't require a HKDF construction in HandshakeTokenKey (#480)
* Implement HandshakeTokenKeys directly using AES-GCM

* Revert to old HDKF-based construction, but with changed trait

* Cleanup

* Clippy fix
2026-03-06 12:27:27 +00:00
Rüdiger Klaehn 018517663d feat: Add minimal socket2 based impl (previously fallback.rs) (#478)
* Rename fallback.rs to posix_minimal.rs

Use it for platforms that are unix, but don't support advanced stuff like
CMSG, GRO, GSO.

Also fix some compile errors in the former fallback.rs

* Test noq-udp with the new posix_minimal configuration

* Eliminate warnings for posix_minimal config.

* shut up clippy
2026-03-05 11:18:14 +00:00
Philipp Krüger 6f48f3ab4a chore(proto): Fix unused import warning with only rustls + platform-verifier (#473) 2026-03-04 09:52:14 +00:00
Asmir Avdicevic caf81fd2e2 chore(ci): adjust runner usage and storage policies (#471)
* chore(ci): adjust runner usage and storage policies

* fix android

* fix android again
2026-03-03 12:58:06 +00:00
Floris Bruynooghe e71b78b88a chore: Attempt at drafting a readme (#467)
* chore: Attempt at drafting a readme

* spelling

* Fix crypto wording

* typo

* remove support for version 2

seems that needs a little more work

* add modern stuff folks demand

* qlog typo

* Try and be slightly less confusing
2026-03-03 12:39:50 +00:00
Rüdiger Klaehn b342c4683f Parse ALPNs at incoming level (#454)
* WIP

* Prettify parsing code

* Fix error in docs

* clippy

* Some optimizations:

- use a lazy iterator over the ALPNs
- fast path for when the ALPNs are in the first crypto frame

Also some tests for the rarely used assembly stuff.

* Fix doc comments regarding allocations

* Add a newtype wrapper for the decrypted initial packet.

We can then add all the various convenience methods to it, not to the main Incoming.
So even if we have a lot of stuff on it we don't pollute the incoming API.

Also we cache the decryption.

* Extend comments about decrypt
2026-03-03 11:52:50 +00:00
Philipp Krüger ee63d4bc48 fix(proto): Don't generate endpoint events in drained connection state (#470)
* fix(proto): Don't generate endpoint events in drained connection state

* Change a `!self.state.is_drained` check into `debug_assert!`
2026-03-03 10:36:03 +00:00
Philipp Krüger 13a1c456f5 feat!: Allow compiling with rustls, but without any crypto providers compiled into rustls (#462)
* Switch to `aes-gcm` crate for retry token logic when using rustls

* Split `rustls-ring` and `rustls-aws-lc-rs` features into `rustls`, `ring` and `aws-lc-rs` features.

* Better document the features.

* `cargo make format`

* Fix outdated feature references

* Avoid double-defining `configured_provider`

* File an issue about suddenly working PQC handshakes now breaking a test

* Fix rebase

* Only enable `aes-gcm` dependency when needed

* Add features for backwards compatibility

* Add some links to the spec's retry packet integrity section
2026-03-02 11:56:51 +00:00
Ben Hagen 6c4de8557e fix: avoid lock re-entry in open_path_ensure and add regression test (#464)
Drop the connection state lock before cloning ConnectionRef in the existing-path branch of open_path_ensure, and add a multipath regression test that verifies ensuring an existing path resolves quickly and returns consistent path details.
2026-03-02 09:04:12 +00:00
Friedel Ziegelmayer 294e3ea603 refactor!: rename to noq (#461)
* refactor!: rename to noq

* fixup python scripts

* fixup

* fixup

* fixup: cr
2026-02-27 14:57:21 +00:00
Floris Bruynooghe 6f06f1f3bd refactor: switch back to pending name for this (#460)
We decided to stick with the pending naming scheme after all.
2026-02-27 10:42:18 +00:00
Diva Martínez 8a9a7021fd fix(proto): set open path timer when first packet is sent (#458)
* set the open path timer only when the path challenge frame has been sent

* test

simplify test comments

* clarify
2026-02-26 19:18:48 +00:00
Philipp Krüger 6ec9ffec6a fix(proto): Remove race condition between take_error & overwriting in move_to_draining (#452)
* Write regression test

* fix(proto): Remove race condition between taking error & overwriting it in `move_to_draining`

* `cargo make format`
2026-02-24 13:43:55 +00:00
Floris Bruynooghe 588efa507c refactor: remove needless variable (#453)
At some point in the past this probably worked around some borrowing
issues. Now it is distracting (just kidding, it was always
distracting but sadly necessary).
2026-02-24 11:58:52 +00:00
Philipp Krüger b966872d35 fix(proto): Properly separate on-path and off-path challenge logic (#449)
* refactor: Some renames

* fix(proto): Only clear and resend on-path challenges

* cr: Renames discussed in discord

* cr: log response
2026-02-23 15:49:42 +00:00
Floris Bruynooghe 0696c830d8 refactor: defensive styel & move code around (#450)
Some refactors:

- Move code around so that helpers structs come after the Connection,
  kind of more the style and keeps connection code more together.
- Use some defensive coding in the spaces impls. Fix a few bugs
  detected by it
2026-02-23 14:18:11 +00:00
Philipp Krüger 5e6ee88d79 regression test: infinite path challenge resending (#442)
* Write regression test

* Add comments to regression test

* Add comment on how we fixed the test
2026-02-23 09:42:16 +00:00
Diva Martínez 565ebec2c0 chore: unify nat traversal naming (#445)
* remove iroh from code, in favor of n0; remove hole punching in favor of nat traversal

* updates

* url fmt
2026-02-23 08:52:44 +00:00
Diva Martínez 8fc9cdd77a fix(proto): fix checks to understand if a path response is valid (#443)
* fix path challenge issues

* the tests

* keep two set of challenges

* fmt

* remove proptest, there's no need

* tone down descriptions

* passive migration sets ip

* adjust test

* spelling

* take into account MSRV

* add more info to the ignored variant

* allow the case when the challenge was sent without knowing our src ip
2026-02-23 08:44:01 +00:00
Diva Martínez c69a939edb fix(quinn-proto): path abandon does not clear all timers, in particular, not loss detection (#438)
* do not clear _all_ timers

* Apply suggestions from code review

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>

* fmt

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-02-20 21:51:07 +00:00
Franz Heinzmann 88cf95fcd0 refactor!: improve path events around path closing (#427)
* refactor: improve path events around path closing

* chore: clippy, codespell

* improve docs

* address PR review
2026-02-20 17:12:23 +00:00
Philipp Krüger 041777b9d2 ci: Fix daily proptest runs (#441) 2026-02-20 14:43:57 +00:00
Friedel Ziegelmayer f41f278609 ci: add expanded proptest runs to ci (#395)
* test(proto): add failing seeds found in CI

* ci: add expanded proptest runs to ci

Adds daily runs, and a longer run for regular tests, also available as cargo make tasks

* ci: fight windows

* another failing seed

* apply CR

* add seeds found in CI

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-02-19 15:24:28 +00:00
Philipp Krüger 2903b55dde fix(proto): Avoid generating protocol violation errors in bad network conditions (#436)
* Failing regression test extract from failing proptest

* fix(proto): Avoid generating protocol violation errors for unreciprocated path abandons

* Only increase MAX_PATH_ID once we drain paths, remove AbandonState
2026-02-19 15:00:40 +00:00
Diva Martínez 20e1fcc073 refactor(proto): expand use of SpaceKind where SpaceId::Data(PathId) is not suitable (#432)
* expand use of SpaceKind where SpaceId::Data(PathId) does not fit

* remove methods no longer needed

* upgrade_crypto needs a kind not a spaceid

* move SpaceKind to spaces.rs

* fix import

* fmt

* address review
2026-02-18 13:44:36 +00:00
Diva Martínez 9dfd941bc5 improve logs (#433) 2026-02-18 12:31:43 +00:00
fun with rust 653d6ee268 fix: CidQueue out of bounds panic (#431)
* fix: cid next ring mod

* add: cid_queue test reserve_many_next_clears_across_wraparound
2026-02-18 12:24:26 +00:00
Diva Martínez 220dacbeed fix(proto): handle duplicated reach out frames (#430)
* track reahc_outs as a set

* improve readability

* do not claim too many addresses if the frame is repeated

* remove unused variable

* revert unintended change
2026-02-17 09:59:14 +00:00
Diva Martínez ebbd765465 fix(proto): some harmless bugs regarding confidentiality limits (#423)
* move `sent_with_keys` into `CryptoSpace` and out of `PacketNumberSpace`

* remove function with single call delegation

* wip

* move confidentiality limits to.. better places

* fix some bugs

* increase readability

* clippy

* add docs, sorry @flub
2026-02-13 15:51:00 +00:00
Franz Heinzmann c51afaeb6b refactor: stop EndpointDriver once endpoint is closed and all connections are drained (#426)
* refactor: stop endpoint driver after close & drain even if there's still Endpoint structs alive

* docs

* fix: wake endpoint driver on close
2026-02-13 15:03:28 +00:00
fun with rust 315f491bfb fix: open_path_ensure deadlock (#424)
* fix: open_path_ensure deadlock

* fix: cargo make format
2026-02-13 10:48:17 +00:00
Diva Martínez 4f8afee29f refactor(proto): Introduce CryptoState (#420)
* add CryptoState and burte force its usage

* add CryptoState::has_keys

* add CryptoState::local_crypto and CryptoState::remote_crypto

* use local_crypto and remote_crypto

* local_crypto uses SpaceId instead to select zero rtt when needed

* move update_keys to CryptoState

* add more util fns and rename EncryptionLevel

* rename to `EncryptionLevel` again

* add some util fns

* add space kind

* use SpaceKind were it fits

* use SpaceKind in connection too

* packet header declares encryption level, not packet number space

* move module functions to CryptoState methods

* random improvements

* fmt

* fix for merge

* key phase is also part of the connections crypto state

* revert making the highest space a SpaceKind. Leave for later PR

* revert taking SpaceKindn in Connection methods, leave for other PR

* packet.space.header is SpaceId again

* fmt

* fixes after self review

* address review
2026-02-12 15:57:44 +00:00
Diva Martínez c369b525be feat: switch from rand data to path challenges for nat traversal (#373)
* introduce CidQueue::remaining

* add method to send nat traversal path challenges

* remove rand data from poll transmit

* remove unused import

* remvoe active_probes from nat traversal state

* register all the things

* do not set the timer, handle ina different pr
2026-02-12 14:11:44 +00:00
Diva Martínez d5580a5292 fix: handle network changes in multipath (#383)
* deal with network changes

* expose new trait

* adjust test

* spelling

* add public api

* update behaviour based on review

* remove the need for a default hint value

* provide methods to get or not a hint

* so many annoying changes

* fixes

* remove mergetool file

* reduce awkwardness

* go back to a single method for even less awkwardness

* clippy and fmt

* make docs clearer (?), include client-side note

* update API name to match that of proto

* cleanup proto api by moving async bounds to the async crate

* aim for more clarity

* more failsafes

* public import

* add network change test for the vanilla quic case

* bugfix: do not send pathopen events for non-multipath

* add test for multipath network changes without a hint

* add a test for a selective network change hint

* add some logs
2026-02-10 19:07:38 +00:00
Diva Martínez d29726a1fa fix! make Path::close completely sync (this never returned in the happy case) (#419)
* remove PathEvent::Closed

* add test

* remove unused public api types

* spelling

* make test finish reliably
2026-02-10 15:46:17 +00:00
Philipp Krüger e7c23e94e6 fix(proto): Don't allow closing paths without multipath (#387)
* fix(proto): Don't allow closing paths without multipath

* cr: Reorder `MultipathNotNegotiated` error to top
2026-02-09 15:29:53 +00:00
Asmir Avdicevic 325db0f070 fix(ci): address dns issues in daily job (#416)
* fix(ci): address dns issues in daily job

* maybe?

* maybe?

* pin deps version
2026-02-09 13:21:59 +00:00
Franz Heinzmann b068cda8ed feat: Retain final path stats if a Path is alive, add WeakPathHandle (#386)
* fix: update final path stats before emitting in event

* wip: keep final stats alive as long as Path or WeakPathHandle exists

* add Clone for Path

* docs

* chore: clippy

* fix: path ref counter increment on clone

* chore: fmt

* add docs and test

* chore: clippy

* address review

* fixup test

* Update quinn/src/connection.rs

Co-authored-by: Floris Bruynooghe <flub@n0.computer>

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2026-02-09 08:41:17 +00:00
Friedel Ziegelmayer 708a6a0119 fix(quinn-udp): more wine fixes (#414)
* fix(quinn-udp): disable IP_PKTINFO under Wine

Wine's IP_PKTINFO implementation maps Linux's ipi_addr (the IP header
destination address) to Windows' IN_PKTINFO.ipi_addr. On multi-homed hosts,
ipi_addr and ipi_spec_dst (the local address) can differ, causing QUIC to
discard packets with 'sent to incorrect interface'.

This commit:
- Detects Wine at runtime via ntdll.dll's wine_get_version export
- Disables pktinfo when running under Wine (both send and recv paths)
- Exports is_wine() from the crate for use by downstream tests
- Skips the local_ip assertion in echo tests under Wine
- Upgrades windows-sys to 0.61

See:
- Wine's convert_control_headers(): https://github.com/wine-mirror/wine/blob/master/dlls/ntdll/unix/socket.c
- Linux in_pktinfo fields: https://man7.org/linux/man-pages/man7/ip.7.html
- Windows IN_PKTINFO: https://learn.microsoft.com/en-us/windows/win32/api/ws2ipdef/ns-ws2ipdef-in_pktinfo

* apply CR

* fixup

* cleanup
2026-02-06 17:24:48 +00:00
Diva Martínez ef105ad6ca migrate test location (#411) 2026-02-06 13:12:44 +00:00
Asmir Avdicevic 093cf62908 fix(ci): daily jobs deps (#413) 2026-02-06 13:09:33 +00:00