Commit Graph

4831 Commits

Author SHA1 Message Date
Rüdiger Klaehn 72c4e9bb6c Merge branch 'main' into fix-fallback 2026-03-04 17:15:14 +01: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
Rüdiger Klaehn 58ed6c4010 Merge branch 'main' into fix-fallback 2026-03-03 12:22:33 +01: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
Ruediger Klaehn 63859d7a50 Add force_fallback cfg so we can actually test that fallback.rs at least compiles.
Not sure how to do this. You could make non-fallback use a feature flag that is enabled by default,
but then everybody that runs no-default-features would not get GSO/GRO despite
being on unix...
2026-03-03 12:16:03 +02:00
Ruediger Klaehn d3dafa00aa Fix compile errors in fallback.rs
We never hit this in CI because we either compile for windows, some sort
of unix, or wasm. But we should at least have it compile.
2026-03-03 12:05:46 +02: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
Franz Heinzmann f89efda9d6 refactor: use named future for SendStream::stopped (#409)
* refactor: use named future for SendStream::stopped

* address review

* deps: bump min tokio version to 1.47
2026-02-06 10:41:42 +00:00
Asmir Avdicevic c332d420ce ci: add testing on wine (#393)
* feat(ci): wine testing

* capture all exe

---------

Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
2026-02-06 10:04:56 +00:00
Friedel Ziegelmayer 1a91e0b538 fix: update time dep to address RUSTSEC-2026-0009 (#412) 2026-02-06 09:17:27 +00:00
Diva Martínez 7cabfe8392 tests: introduce ConnPair and testresult to simplify tests (#408)
* add basic struct and methods

* dispatch using side

* use ConnPair in multipath tests

* use `Side` variants directly

* add testresult to dev deps

* always use time from underlying pair

* use ConnPair in multipath tests even if they don't use multipath_pair

* use stats(side) directly

* introduce ConnPair::connect_with

* introduce ConnPair::with_default_endpoint

* reduce LOCs

* introduce ConnPair::with_transport_cfg for even less noise

* only keep the public api

* fmt

* take advantage of derive_more

* add some basic docs

* revert weird windows update
2026-02-05 16:33:45 +00:00
Diva Martínez 8c146d2da4 tests: document proptest interactions (#406)
* make all `TestOp` variants struct variants

* add docs
2026-02-05 13:51:03 +00:00
Friedel Ziegelmayer eda1e01644 fix(udp): windows: make potentially non available socket options optional (#392)
* fix(udp): make potentially non available socket options optional

This is likely the reason we are seeing issues when trying to bind under wine currently

Ref https://github.com/n0-computer/iroh/issues/3901

* fix(udp): track ecn for ipv4 and ipv6 seperately

* fix: expand error type checks

* fix: make DONTFRAGMENT socket options gracefully degrade

Wine doesn't support IP_DONTFRAGMENT and IPV6_DONTFRAG socket options,
returning WSAEOPNOTSUPP. Allow these to fail gracefully with a warning
instead of failing socket creation entirely.

* fmt

* fix: only query IPV6_V6ONLY on IPv6 sockets

On Wine, calling getsockopt with IPPROTO_IPV6 on an IPv4 socket
returns WSAEOPNOTSUPP (10045). Only query IPV6_V6ONLY when the
socket is actually IPv6.

* fix: detect wine in tests

* fixup: feature enabling

* fixup: types

* fix(udp): properly track may_fragment

* fixup: add comment
2026-02-04 15:19:13 +00:00
Diva Martínez b5e2b8f0e3 update bytes to address advisory RUSTSEC-2026-0007 (#405) 2026-02-03 16:33:31 +00:00