From ba85a58b4c3b428e57b63870d5547fcb43d46191 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 02:07:27 -0800 Subject: [PATCH 1/6] chore(quest): claim quest/a1/router-crypto-features.md Quest-Claim: 356e3014eded8846 From d7caff6cee0e0b4be8b40eacee09283b49ee6824 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 02:15:02 -0800 Subject: [PATCH 2/6] feat(router): forward native crypto-provider features (Written by GPT-6.1 Sol with xhigh) --- quest/a1/README.md | 1 - quest/a1/rind/README.md | 4 ---- quest/a1/router-crypto-features.md | 25 ------------------------- 3 files changed, 30 deletions(-) delete mode 100644 quest/a1/router-crypto-features.md diff --git a/quest/a1/README.md b/quest/a1/README.md index 951db889..3bc0dae1 100644 --- a/quest/a1/README.md +++ b/quest/a1/README.md @@ -13,7 +13,6 @@ The Required list is ordered by priority. Independent children may proceed concu - [QMux send-rate filter](/quest/a1/qmux-rate-filter.md) - app-limited samples no longer lower the estimate, on main and 0.5 - [QMux send-rate filter on 0.5](/quest/a1/qmux-rate-filter-0.5.md) - backport for published moq-relay - [Dual-stack bind](/quest/a1/dual-stack-bind.md) - native clients bind by the server's address family -- [Router crypto features](/quest/a1/router-crypto-features.md) - interim aws-lc-rs/ring features on `web-transport` - [Rust crates on rind](/quest/a1/rind/README.md) - no C crypto outside Quiche - [Binding runtime coverage](/quest/a1/bindings/README.md) - independent language jobs - [Node idle configuration](/quest/a1/node-idle/README.md) - typed native input and Node options diff --git a/quest/a1/rind/README.md b/quest/a1/rind/README.md index 5c4e7a52..79d4f031 100644 --- a/quest/a1/rind/README.md +++ b/quest/a1/rind/README.md @@ -37,7 +37,3 @@ Decision prompts (✅ chosen): - [Noq on rind](/quest/a1/rind/noq.md) - Noq's rustls without ring, with rind keys - [iroh on rind](/quest/a1/rind/iroh.md) - iroh endpoint built with rind's provider - [QMux on rind](/quest/a1/rind/qmux.md) - TLS and WSS paths with no aws-lc-rs - -## Related - -- [Router crypto features](/quest/a1/router-crypto-features.md) - interim features that the Quinn child removes diff --git a/quest/a1/router-crypto-features.md b/quest/a1/router-crypto-features.md deleted file mode 100644 index 626ad214..00000000 --- a/quest/a1/router-crypto-features.md +++ /dev/null @@ -1,25 +0,0 @@ -# [XS] Forward crypto-provider features through the router crate - -## Goal - -Native users of `web-transport` can build the router on `ring` instead of aws-lc-rs: the crate gains `aws-lc-rs` (default) and `ring` features that pass through to web-transport-quinn, and they do nothing on WASM. - -## Plan - -Decided with the maintainer on 2026-11-06 (planning interview): - -- Forward `aws-lc-rs` and `ring` to `web-transport-quinn` with its default features off. -- With neither feature on, the native `ClientBuilder` disappears, mirroring web-transport-quinn's gate. Session and Server conversion still compile, so callers can build web-transport-quinn clients themselves (for example with `Client::new` and quinn's own rustls features). No `compile_error!`. -- With both features on, behave as web-transport-quinn already does: an installed process provider wins, else the builder panics. Document both the neither-feature rule and the both-features rule in the crate docs; changing web-transport-quinn's rule is out of scope for this interim change. -- These features are interim. [Quinn on rind](/quest/a1/rind/quinn.md) removes them when the router moves to rind. Ship this anyway: the reporter gets an option without aws-lc-sys sooner (ring still builds C and assembly through `cc`), and the churn is accepted. If the rind switch lands first, delete this quest instead. -- Check that the WASM build still compiles with each feature combination. - -Decision prompts (✅ chosen): - -- Goal: ✅ forward features / fold into #135 quest / won't fix. -- Neither feature: ✅ gate ClientBuilder / `compile_error!`. -- After rind was planned: fold into rind / ✅ ship interim features. - -## Closes - -- [#477](https://github.com/moq-dev/web-transport/issues/477) - the forwarded features answer the request From 5ece67467cf0c2a7281a5536919b3bea9094ad13 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 02:15:44 -0800 Subject: [PATCH 3/6] feat(router): expose crypto-provider selection (Written by GPT-6.1 Sol with xhigh) --- quest/a1/rind/quinn.md | 2 +- rs/web-transport/Cargo.toml | 7 ++++++- rs/web-transport/README.md | 18 ++++++++++++++++++ rs/web-transport/src/lib.rs | 16 ++++++++++++++++ rs/web-transport/src/quinn.rs | 3 +++ rs/web-transport/tests/crypto.rs | 19 +++++++++++++++++++ 6 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 rs/web-transport/tests/crypto.rs diff --git a/quest/a1/rind/quinn.md b/quest/a1/rind/quinn.md index effa0be7..95289dea 100644 --- a/quest/a1/rind/quinn.md +++ b/quest/a1/rind/quinn.md @@ -12,7 +12,7 @@ Decided with the maintainer on 2026-11-06 (planning interview): - A public `web_transport_quinn::crypto` module implements quinn-proto's public crypto traits over `rustls::quic`: the session, `QuicClientConfig`/`QuicServerConfig` equivalents, packet and header keys, the Retry integrity tag (AES-128-GCM), the reset `HmacKey`, and the `HandshakeTokenKey` (HKDF). Retry, HMAC and HKDF come from rind. The session accepts any rustls provider with QUIC suites. Endpoints are built with `Endpoint::new` and an `EndpointConfig` from this module, since `Endpoint::client`/`server` need ring. - FFI and callers of `Client::new(endpoint, quinn::ClientConfig)` build their configs from this module. Document the migration from `quinn::crypto::rustls`. - Builders default to the installed process provider, else rind. A CPU rind refuses returns a new `UnsupportedCpu` error from the finishing methods. `rind::cpu::check()` runs before any rind primitive is built (the Retry, reset and token keys), even when an installed provider is used. FFI's client constructor, which builds configs from this module, runs the same check first and returns the refusal as a `WebTransportError`. `Client::default()` keeps its `with_system_roots().unwrap()` and documents that it panics on such a CPU. -- Remove `aws-lc-rs`/`ring` from web-transport-quinn, web-transport-ffi, and the router (the features from [router crypto features](/quest/a1/router-crypto-features.md)). Check that py/kt/swift and Node still build and pass their binding CI. +- Remove `aws-lc-rs`/`ring` from web-transport-quinn, web-transport-ffi, and the router. Check that py/kt/swift and Node still build and pass their binding CI. - Test interop against an unmodified quinn peer on aws-lc-rs: handshake, Retry, stateless reset, key update, 0-RTT rejection, and a CPU-refusal path. Use controlled time where the protocol allows. - The adapter is deleted once upstream allows any provider; see [Quinn adapter removal](/quest/a2/quinn-adapter-removal.md). diff --git a/rs/web-transport/Cargo.toml b/rs/web-transport/Cargo.toml index 8b9a2bb8..62605415 100644 --- a/rs/web-transport/Cargo.toml +++ b/rs/web-transport/Cargo.toml @@ -12,13 +12,18 @@ keywords = ["quic", "http3", "webtransport"] categories = ["network-programming", "web-programming"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["aws-lc-rs"] +aws-lc-rs = ["web-transport-quinn/aws-lc-rs"] +ring = ["web-transport-quinn/ring"] + [dependencies] bytes = "1" thiserror = "2" url = "2" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -web-transport-quinn = { version = "0.13.6", path = "../web-transport-quinn" } +web-transport-quinn = { version = "0.13.6", path = "../web-transport-quinn", default-features = false } [target.'cfg(target_arch = "wasm32")'.dependencies] web-transport-wasm = { version = "0.8.8", path = "../web-transport-wasm" } diff --git a/rs/web-transport/README.md b/rs/web-transport/README.md index 0720376f..4aac2f42 100644 --- a/rs/web-transport/README.md +++ b/rs/web-transport/README.md @@ -15,6 +15,24 @@ This crate provides a generic WebTransport implementation depending on the platf WASM builds additionally require `--cfg=web_sys_unstable_apis`; see [web-transport-wasm](../web-transport-wasm/README.md#requirements). +## Crypto providers + +Native builds use aws-lc-rs by default. To use ring without aws-lc-rs: + +```toml +web-transport = { version = "0.13", default-features = false, features = ["ring"] } +``` + +The `aws-lc-rs` and `ring` features forward to `web-transport-quinn`. +An installed process-wide rustls crypto provider takes precedence. When both +features are enabled, install one with `CryptoProvider::install_default()` before +constructing a `ClientBuilder`; otherwise construction panics. +When neither feature is enabled, the native `ClientBuilder` is unavailable; +`Session` and `Server` conversions remain available for callers configuring the +backend directly, for example through `web_transport_quinn::Client::new`. + +These features have no effect on WASM. The browser handles TLS, and +`ClientBuilder` is available with every feature combination. ## Why no trait? diff --git a/rs/web-transport/src/lib.rs b/rs/web-transport/src/lib.rs index 00d1369a..0d87f405 100644 --- a/rs/web-transport/src/lib.rs +++ b/rs/web-transport/src/lib.rs @@ -5,6 +5,22 @@ //! - web: [web-transport-wasm](https://docs.rs/web-transport-wasm/latest) //! //! WASM lacks server support, so for native you first establish a [web_transport_quinn::Session] and then use [Session::from()] to cast to this generic interface. +//! +//! # Crypto providers +//! +//! On native targets, the `aws-lc-rs` feature (enabled by default) and `ring` +//! forward to `web-transport-quinn`. To use ring without aws-lc-rs, disable +//! default features and enable only `ring`. +//! +//! An installed process-wide rustls crypto provider takes precedence. With both +//! features enabled, install a provider with `CryptoProvider::install_default()` +//! before constructing a `ClientBuilder`; otherwise construction panics. +//! With neither feature enabled, the native `ClientBuilder` is unavailable. +//! `Session` and `Server` conversions remain available for callers that configure +//! `web-transport-quinn` themselves, for example through its `Client::new`. +//! +//! These features have no effect on WASM, where the browser handles TLS and +//! `ClientBuilder` is always available. #[cfg(any(not(target_arch = "wasm32"), target_os = "wasi"))] #[path = "quinn.rs"] diff --git a/rs/web-transport/src/quinn.rs b/rs/web-transport/src/quinn.rs index 9c90a05d..64c33b75 100644 --- a/rs/web-transport/src/quinn.rs +++ b/rs/web-transport/src/quinn.rs @@ -7,13 +7,16 @@ pub use web_transport_quinn as quinn; pub use web_transport_quinn::CongestionControl; /// Create a [Client] that can be used to dial multiple [Session]s. +#[cfg(any(feature = "aws-lc-rs", feature = "ring"))] #[derive(Default, Clone)] pub struct ClientBuilder { inner: quinn::ClientBuilder, protocols: Vec, } +#[cfg(any(feature = "aws-lc-rs", feature = "ring"))] impl ClientBuilder { + /// Create a client builder using the selected crypto provider. pub fn new() -> Self { Self::default() } diff --git a/rs/web-transport/tests/crypto.rs b/rs/web-transport/tests/crypto.rs new file mode 100644 index 00000000..d6446fd2 --- /dev/null +++ b/rs/web-transport/tests/crypto.rs @@ -0,0 +1,19 @@ +#![cfg(all( + not(target_arch = "wasm32"), + any(feature = "aws-lc-rs", feature = "ring") +))] + +#[test] +fn builder_provider_selection() { + #[cfg(all(feature = "aws-lc-rs", feature = "ring"))] + { + use web_transport::quinn::quinn::rustls::crypto; + + assert!(crypto::CryptoProvider::get_default().is_none()); + assert!(std::panic::catch_unwind(web_transport::ClientBuilder::new).is_err()); + + crypto::ring::default_provider().install_default().unwrap(); + } + + let _ = web_transport::ClientBuilder::new(); +} From 14d38213182d1d8b7cd2a362b58b99c38646edec Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 02:53:38 -0800 Subject: [PATCH 4/6] test(router): verify provider selection in each CI configuration (Written by GPT-6.1 Sol with xhigh) --- justfile | 2 ++ rs/web-transport/README.md | 8 +++++--- rs/web-transport/src/lib.rs | 8 +++++--- rs/web-transport/tests/crypto.rs | 31 ++++++++++++++++++++++++++++--- 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/justfile b/justfile index 0c892969..98402efe 100644 --- a/justfile +++ b/justfile @@ -60,6 +60,8 @@ check: # Run any CI tests test: cargo test --workspace --all-targets --all-features + cargo test -p web-transport --no-default-features --features aws-lc-rs --test crypto + cargo test -p web-transport --no-default-features --features ring --test crypto cargo test --target wasm32-unknown-unknown -p web-transport --all-targets --all-features cargo test --target wasm32-unknown-unknown -p web-transport-wasm --all-targets --all-features diff --git a/rs/web-transport/README.md b/rs/web-transport/README.md index 4aac2f42..e0b18b2f 100644 --- a/rs/web-transport/README.md +++ b/rs/web-transport/README.md @@ -24,9 +24,11 @@ web-transport = { version = "0.13", default-features = false, features = ["ring" ``` The `aws-lc-rs` and `ring` features forward to `web-transport-quinn`. -An installed process-wide rustls crypto provider takes precedence. When both -features are enabled, install one with `CryptoProvider::install_default()` before -constructing a `ClientBuilder`; otherwise construction panics. +An installed process-wide rustls crypto provider takes precedence. Cargo unifies +backend features across dependencies, so another dependency can enable an +additional provider. When both backend providers are enabled, install one with +`CryptoProvider::install_default()` before constructing a `ClientBuilder`; +otherwise construction panics. When neither feature is enabled, the native `ClientBuilder` is unavailable; `Session` and `Server` conversions remain available for callers configuring the backend directly, for example through `web_transport_quinn::Client::new`. diff --git a/rs/web-transport/src/lib.rs b/rs/web-transport/src/lib.rs index 0d87f405..f3a9a6b9 100644 --- a/rs/web-transport/src/lib.rs +++ b/rs/web-transport/src/lib.rs @@ -12,9 +12,11 @@ //! forward to `web-transport-quinn`. To use ring without aws-lc-rs, disable //! default features and enable only `ring`. //! -//! An installed process-wide rustls crypto provider takes precedence. With both -//! features enabled, install a provider with `CryptoProvider::install_default()` -//! before constructing a `ClientBuilder`; otherwise construction panics. +//! An installed process-wide rustls crypto provider takes precedence. Cargo +//! unifies backend features across dependencies, so another dependency can enable +//! an additional provider. With both backend providers enabled, install one with +//! `CryptoProvider::install_default()` before constructing a `ClientBuilder`; +//! otherwise construction panics. //! With neither feature enabled, the native `ClientBuilder` is unavailable. //! `Session` and `Server` conversions remain available for callers that configure //! `web-transport-quinn` themselves, for example through its `Client::new`. diff --git a/rs/web-transport/tests/crypto.rs b/rs/web-transport/tests/crypto.rs index d6446fd2..0ee88295 100644 --- a/rs/web-transport/tests/crypto.rs +++ b/rs/web-transport/tests/crypto.rs @@ -5,15 +5,40 @@ #[test] fn builder_provider_selection() { + use web_transport::quinn::quinn::rustls::crypto; + + #[cfg(feature = "ring")] + let expected = crypto::ring::default_provider(); + #[cfg(not(feature = "ring"))] + let expected = crypto::aws_lc_rs::default_provider(); + #[cfg(all(feature = "aws-lc-rs", feature = "ring"))] { - use web_transport::quinn::quinn::rustls::crypto; - assert!(crypto::CryptoProvider::get_default().is_none()); assert!(std::panic::catch_unwind(web_transport::ClientBuilder::new).is_err()); - crypto::ring::default_provider().install_default().unwrap(); + expected.clone().install_default().unwrap(); } let _ = web_transport::ClientBuilder::new(); + let actual = web_transport::quinn::crypto::default_provider(); + assert_eq!(actual.cipher_suites, expected.cipher_suites); + assert_eq!( + actual + .kx_groups + .iter() + .map(|g| g.name()) + .collect::>(), + expected + .kx_groups + .iter() + .map(|g| g.name()) + .collect::>() + ); + + #[cfg(all(feature = "aws-lc-rs", feature = "ring"))] + assert!(std::sync::Arc::ptr_eq( + &actual, + crypto::CryptoProvider::get_default().unwrap() + )); } From c471d63d38125ad7705b3016e501a806dc1be152 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 8 Nov 2026 09:09:56 -0800 Subject: [PATCH 5/6] chore: restore main's tree before deleting the quest --- justfile | 2 -- quest/a1/README.md | 1 + quest/a1/rind/README.md | 4 +++ quest/a1/rind/quinn.md | 2 +- quest/a1/router-crypto-features.md | 25 +++++++++++++++++ rs/web-transport/Cargo.toml | 7 +---- rs/web-transport/README.md | 20 -------------- rs/web-transport/src/lib.rs | 18 ------------ rs/web-transport/src/quinn.rs | 3 -- rs/web-transport/tests/crypto.rs | 44 ------------------------------ 10 files changed, 32 insertions(+), 94 deletions(-) create mode 100644 quest/a1/router-crypto-features.md delete mode 100644 rs/web-transport/tests/crypto.rs diff --git a/justfile b/justfile index 98402efe..0c892969 100644 --- a/justfile +++ b/justfile @@ -60,8 +60,6 @@ check: # Run any CI tests test: cargo test --workspace --all-targets --all-features - cargo test -p web-transport --no-default-features --features aws-lc-rs --test crypto - cargo test -p web-transport --no-default-features --features ring --test crypto cargo test --target wasm32-unknown-unknown -p web-transport --all-targets --all-features cargo test --target wasm32-unknown-unknown -p web-transport-wasm --all-targets --all-features diff --git a/quest/a1/README.md b/quest/a1/README.md index 3bc0dae1..951db889 100644 --- a/quest/a1/README.md +++ b/quest/a1/README.md @@ -13,6 +13,7 @@ The Required list is ordered by priority. Independent children may proceed concu - [QMux send-rate filter](/quest/a1/qmux-rate-filter.md) - app-limited samples no longer lower the estimate, on main and 0.5 - [QMux send-rate filter on 0.5](/quest/a1/qmux-rate-filter-0.5.md) - backport for published moq-relay - [Dual-stack bind](/quest/a1/dual-stack-bind.md) - native clients bind by the server's address family +- [Router crypto features](/quest/a1/router-crypto-features.md) - interim aws-lc-rs/ring features on `web-transport` - [Rust crates on rind](/quest/a1/rind/README.md) - no C crypto outside Quiche - [Binding runtime coverage](/quest/a1/bindings/README.md) - independent language jobs - [Node idle configuration](/quest/a1/node-idle/README.md) - typed native input and Node options diff --git a/quest/a1/rind/README.md b/quest/a1/rind/README.md index 79d4f031..5c4e7a52 100644 --- a/quest/a1/rind/README.md +++ b/quest/a1/rind/README.md @@ -37,3 +37,7 @@ Decision prompts (✅ chosen): - [Noq on rind](/quest/a1/rind/noq.md) - Noq's rustls without ring, with rind keys - [iroh on rind](/quest/a1/rind/iroh.md) - iroh endpoint built with rind's provider - [QMux on rind](/quest/a1/rind/qmux.md) - TLS and WSS paths with no aws-lc-rs + +## Related + +- [Router crypto features](/quest/a1/router-crypto-features.md) - interim features that the Quinn child removes diff --git a/quest/a1/rind/quinn.md b/quest/a1/rind/quinn.md index 95289dea..effa0be7 100644 --- a/quest/a1/rind/quinn.md +++ b/quest/a1/rind/quinn.md @@ -12,7 +12,7 @@ Decided with the maintainer on 2026-11-06 (planning interview): - A public `web_transport_quinn::crypto` module implements quinn-proto's public crypto traits over `rustls::quic`: the session, `QuicClientConfig`/`QuicServerConfig` equivalents, packet and header keys, the Retry integrity tag (AES-128-GCM), the reset `HmacKey`, and the `HandshakeTokenKey` (HKDF). Retry, HMAC and HKDF come from rind. The session accepts any rustls provider with QUIC suites. Endpoints are built with `Endpoint::new` and an `EndpointConfig` from this module, since `Endpoint::client`/`server` need ring. - FFI and callers of `Client::new(endpoint, quinn::ClientConfig)` build their configs from this module. Document the migration from `quinn::crypto::rustls`. - Builders default to the installed process provider, else rind. A CPU rind refuses returns a new `UnsupportedCpu` error from the finishing methods. `rind::cpu::check()` runs before any rind primitive is built (the Retry, reset and token keys), even when an installed provider is used. FFI's client constructor, which builds configs from this module, runs the same check first and returns the refusal as a `WebTransportError`. `Client::default()` keeps its `with_system_roots().unwrap()` and documents that it panics on such a CPU. -- Remove `aws-lc-rs`/`ring` from web-transport-quinn, web-transport-ffi, and the router. Check that py/kt/swift and Node still build and pass their binding CI. +- Remove `aws-lc-rs`/`ring` from web-transport-quinn, web-transport-ffi, and the router (the features from [router crypto features](/quest/a1/router-crypto-features.md)). Check that py/kt/swift and Node still build and pass their binding CI. - Test interop against an unmodified quinn peer on aws-lc-rs: handshake, Retry, stateless reset, key update, 0-RTT rejection, and a CPU-refusal path. Use controlled time where the protocol allows. - The adapter is deleted once upstream allows any provider; see [Quinn adapter removal](/quest/a2/quinn-adapter-removal.md). diff --git a/quest/a1/router-crypto-features.md b/quest/a1/router-crypto-features.md new file mode 100644 index 00000000..626ad214 --- /dev/null +++ b/quest/a1/router-crypto-features.md @@ -0,0 +1,25 @@ +# [XS] Forward crypto-provider features through the router crate + +## Goal + +Native users of `web-transport` can build the router on `ring` instead of aws-lc-rs: the crate gains `aws-lc-rs` (default) and `ring` features that pass through to web-transport-quinn, and they do nothing on WASM. + +## Plan + +Decided with the maintainer on 2026-11-06 (planning interview): + +- Forward `aws-lc-rs` and `ring` to `web-transport-quinn` with its default features off. +- With neither feature on, the native `ClientBuilder` disappears, mirroring web-transport-quinn's gate. Session and Server conversion still compile, so callers can build web-transport-quinn clients themselves (for example with `Client::new` and quinn's own rustls features). No `compile_error!`. +- With both features on, behave as web-transport-quinn already does: an installed process provider wins, else the builder panics. Document both the neither-feature rule and the both-features rule in the crate docs; changing web-transport-quinn's rule is out of scope for this interim change. +- These features are interim. [Quinn on rind](/quest/a1/rind/quinn.md) removes them when the router moves to rind. Ship this anyway: the reporter gets an option without aws-lc-sys sooner (ring still builds C and assembly through `cc`), and the churn is accepted. If the rind switch lands first, delete this quest instead. +- Check that the WASM build still compiles with each feature combination. + +Decision prompts (✅ chosen): + +- Goal: ✅ forward features / fold into #135 quest / won't fix. +- Neither feature: ✅ gate ClientBuilder / `compile_error!`. +- After rind was planned: fold into rind / ✅ ship interim features. + +## Closes + +- [#477](https://github.com/moq-dev/web-transport/issues/477) - the forwarded features answer the request diff --git a/rs/web-transport/Cargo.toml b/rs/web-transport/Cargo.toml index 62605415..8b9a2bb8 100644 --- a/rs/web-transport/Cargo.toml +++ b/rs/web-transport/Cargo.toml @@ -12,18 +12,13 @@ keywords = ["quic", "http3", "webtransport"] categories = ["network-programming", "web-programming"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[features] -default = ["aws-lc-rs"] -aws-lc-rs = ["web-transport-quinn/aws-lc-rs"] -ring = ["web-transport-quinn/ring"] - [dependencies] bytes = "1" thiserror = "2" url = "2" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -web-transport-quinn = { version = "0.13.6", path = "../web-transport-quinn", default-features = false } +web-transport-quinn = { version = "0.13.6", path = "../web-transport-quinn" } [target.'cfg(target_arch = "wasm32")'.dependencies] web-transport-wasm = { version = "0.8.8", path = "../web-transport-wasm" } diff --git a/rs/web-transport/README.md b/rs/web-transport/README.md index e0b18b2f..0720376f 100644 --- a/rs/web-transport/README.md +++ b/rs/web-transport/README.md @@ -15,26 +15,6 @@ This crate provides a generic WebTransport implementation depending on the platf WASM builds additionally require `--cfg=web_sys_unstable_apis`; see [web-transport-wasm](../web-transport-wasm/README.md#requirements). -## Crypto providers - -Native builds use aws-lc-rs by default. To use ring without aws-lc-rs: - -```toml -web-transport = { version = "0.13", default-features = false, features = ["ring"] } -``` - -The `aws-lc-rs` and `ring` features forward to `web-transport-quinn`. -An installed process-wide rustls crypto provider takes precedence. Cargo unifies -backend features across dependencies, so another dependency can enable an -additional provider. When both backend providers are enabled, install one with -`CryptoProvider::install_default()` before constructing a `ClientBuilder`; -otherwise construction panics. -When neither feature is enabled, the native `ClientBuilder` is unavailable; -`Session` and `Server` conversions remain available for callers configuring the -backend directly, for example through `web_transport_quinn::Client::new`. - -These features have no effect on WASM. The browser handles TLS, and -`ClientBuilder` is available with every feature combination. ## Why no trait? diff --git a/rs/web-transport/src/lib.rs b/rs/web-transport/src/lib.rs index f3a9a6b9..00d1369a 100644 --- a/rs/web-transport/src/lib.rs +++ b/rs/web-transport/src/lib.rs @@ -5,24 +5,6 @@ //! - web: [web-transport-wasm](https://docs.rs/web-transport-wasm/latest) //! //! WASM lacks server support, so for native you first establish a [web_transport_quinn::Session] and then use [Session::from()] to cast to this generic interface. -//! -//! # Crypto providers -//! -//! On native targets, the `aws-lc-rs` feature (enabled by default) and `ring` -//! forward to `web-transport-quinn`. To use ring without aws-lc-rs, disable -//! default features and enable only `ring`. -//! -//! An installed process-wide rustls crypto provider takes precedence. Cargo -//! unifies backend features across dependencies, so another dependency can enable -//! an additional provider. With both backend providers enabled, install one with -//! `CryptoProvider::install_default()` before constructing a `ClientBuilder`; -//! otherwise construction panics. -//! With neither feature enabled, the native `ClientBuilder` is unavailable. -//! `Session` and `Server` conversions remain available for callers that configure -//! `web-transport-quinn` themselves, for example through its `Client::new`. -//! -//! These features have no effect on WASM, where the browser handles TLS and -//! `ClientBuilder` is always available. #[cfg(any(not(target_arch = "wasm32"), target_os = "wasi"))] #[path = "quinn.rs"] diff --git a/rs/web-transport/src/quinn.rs b/rs/web-transport/src/quinn.rs index 64c33b75..9c90a05d 100644 --- a/rs/web-transport/src/quinn.rs +++ b/rs/web-transport/src/quinn.rs @@ -7,16 +7,13 @@ pub use web_transport_quinn as quinn; pub use web_transport_quinn::CongestionControl; /// Create a [Client] that can be used to dial multiple [Session]s. -#[cfg(any(feature = "aws-lc-rs", feature = "ring"))] #[derive(Default, Clone)] pub struct ClientBuilder { inner: quinn::ClientBuilder, protocols: Vec, } -#[cfg(any(feature = "aws-lc-rs", feature = "ring"))] impl ClientBuilder { - /// Create a client builder using the selected crypto provider. pub fn new() -> Self { Self::default() } diff --git a/rs/web-transport/tests/crypto.rs b/rs/web-transport/tests/crypto.rs deleted file mode 100644 index 0ee88295..00000000 --- a/rs/web-transport/tests/crypto.rs +++ /dev/null @@ -1,44 +0,0 @@ -#![cfg(all( - not(target_arch = "wasm32"), - any(feature = "aws-lc-rs", feature = "ring") -))] - -#[test] -fn builder_provider_selection() { - use web_transport::quinn::quinn::rustls::crypto; - - #[cfg(feature = "ring")] - let expected = crypto::ring::default_provider(); - #[cfg(not(feature = "ring"))] - let expected = crypto::aws_lc_rs::default_provider(); - - #[cfg(all(feature = "aws-lc-rs", feature = "ring"))] - { - assert!(crypto::CryptoProvider::get_default().is_none()); - assert!(std::panic::catch_unwind(web_transport::ClientBuilder::new).is_err()); - - expected.clone().install_default().unwrap(); - } - - let _ = web_transport::ClientBuilder::new(); - let actual = web_transport::quinn::crypto::default_provider(); - assert_eq!(actual.cipher_suites, expected.cipher_suites); - assert_eq!( - actual - .kx_groups - .iter() - .map(|g| g.name()) - .collect::>(), - expected - .kx_groups - .iter() - .map(|g| g.name()) - .collect::>() - ); - - #[cfg(all(feature = "aws-lc-rs", feature = "ring"))] - assert!(std::sync::Arc::ptr_eq( - &actual, - crypto::CryptoProvider::get_default().unwrap() - )); -} From 447f61ed0cb5fdff087ace2f55ba4df0de787b5b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 8 Nov 2026 09:10:11 -0800 Subject: [PATCH 6/6] quest: delete router crypto features; rind removes the providers instead Co-Authored-By: Claude Opus 5.5 --- quest/a1/README.md | 1 - quest/a1/rind/README.md | 4 ---- quest/a1/rind/quinn.md | 2 +- quest/a1/router-crypto-features.md | 25 ------------------------- 4 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 quest/a1/router-crypto-features.md diff --git a/quest/a1/README.md b/quest/a1/README.md index 951db889..3bc0dae1 100644 --- a/quest/a1/README.md +++ b/quest/a1/README.md @@ -13,7 +13,6 @@ The Required list is ordered by priority. Independent children may proceed concu - [QMux send-rate filter](/quest/a1/qmux-rate-filter.md) - app-limited samples no longer lower the estimate, on main and 0.5 - [QMux send-rate filter on 0.5](/quest/a1/qmux-rate-filter-0.5.md) - backport for published moq-relay - [Dual-stack bind](/quest/a1/dual-stack-bind.md) - native clients bind by the server's address family -- [Router crypto features](/quest/a1/router-crypto-features.md) - interim aws-lc-rs/ring features on `web-transport` - [Rust crates on rind](/quest/a1/rind/README.md) - no C crypto outside Quiche - [Binding runtime coverage](/quest/a1/bindings/README.md) - independent language jobs - [Node idle configuration](/quest/a1/node-idle/README.md) - typed native input and Node options diff --git a/quest/a1/rind/README.md b/quest/a1/rind/README.md index 5c4e7a52..79d4f031 100644 --- a/quest/a1/rind/README.md +++ b/quest/a1/rind/README.md @@ -37,7 +37,3 @@ Decision prompts (✅ chosen): - [Noq on rind](/quest/a1/rind/noq.md) - Noq's rustls without ring, with rind keys - [iroh on rind](/quest/a1/rind/iroh.md) - iroh endpoint built with rind's provider - [QMux on rind](/quest/a1/rind/qmux.md) - TLS and WSS paths with no aws-lc-rs - -## Related - -- [Router crypto features](/quest/a1/router-crypto-features.md) - interim features that the Quinn child removes diff --git a/quest/a1/rind/quinn.md b/quest/a1/rind/quinn.md index effa0be7..fc683dde 100644 --- a/quest/a1/rind/quinn.md +++ b/quest/a1/rind/quinn.md @@ -12,7 +12,7 @@ Decided with the maintainer on 2026-11-06 (planning interview): - A public `web_transport_quinn::crypto` module implements quinn-proto's public crypto traits over `rustls::quic`: the session, `QuicClientConfig`/`QuicServerConfig` equivalents, packet and header keys, the Retry integrity tag (AES-128-GCM), the reset `HmacKey`, and the `HandshakeTokenKey` (HKDF). Retry, HMAC and HKDF come from rind. The session accepts any rustls provider with QUIC suites. Endpoints are built with `Endpoint::new` and an `EndpointConfig` from this module, since `Endpoint::client`/`server` need ring. - FFI and callers of `Client::new(endpoint, quinn::ClientConfig)` build their configs from this module. Document the migration from `quinn::crypto::rustls`. - Builders default to the installed process provider, else rind. A CPU rind refuses returns a new `UnsupportedCpu` error from the finishing methods. `rind::cpu::check()` runs before any rind primitive is built (the Retry, reset and token keys), even when an installed provider is used. FFI's client constructor, which builds configs from this module, runs the same check first and returns the refusal as a `WebTransportError`. `Client::default()` keeps its `with_system_roots().unwrap()` and documents that it panics on such a CPU. -- Remove `aws-lc-rs`/`ring` from web-transport-quinn, web-transport-ffi, and the router (the features from [router crypto features](/quest/a1/router-crypto-features.md)). Check that py/kt/swift and Node still build and pass their binding CI. +- Remove `aws-lc-rs`/`ring` from web-transport-quinn and web-transport-ffi, so the router no longer pulls aws-lc-rs in through its default dependency. Check that py/kt/swift and Node still build and pass their binding CI. - Test interop against an unmodified quinn peer on aws-lc-rs: handshake, Retry, stateless reset, key update, 0-RTT rejection, and a CPU-refusal path. Use controlled time where the protocol allows. - The adapter is deleted once upstream allows any provider; see [Quinn adapter removal](/quest/a2/quinn-adapter-removal.md). diff --git a/quest/a1/router-crypto-features.md b/quest/a1/router-crypto-features.md deleted file mode 100644 index 626ad214..00000000 --- a/quest/a1/router-crypto-features.md +++ /dev/null @@ -1,25 +0,0 @@ -# [XS] Forward crypto-provider features through the router crate - -## Goal - -Native users of `web-transport` can build the router on `ring` instead of aws-lc-rs: the crate gains `aws-lc-rs` (default) and `ring` features that pass through to web-transport-quinn, and they do nothing on WASM. - -## Plan - -Decided with the maintainer on 2026-11-06 (planning interview): - -- Forward `aws-lc-rs` and `ring` to `web-transport-quinn` with its default features off. -- With neither feature on, the native `ClientBuilder` disappears, mirroring web-transport-quinn's gate. Session and Server conversion still compile, so callers can build web-transport-quinn clients themselves (for example with `Client::new` and quinn's own rustls features). No `compile_error!`. -- With both features on, behave as web-transport-quinn already does: an installed process provider wins, else the builder panics. Document both the neither-feature rule and the both-features rule in the crate docs; changing web-transport-quinn's rule is out of scope for this interim change. -- These features are interim. [Quinn on rind](/quest/a1/rind/quinn.md) removes them when the router moves to rind. Ship this anyway: the reporter gets an option without aws-lc-sys sooner (ring still builds C and assembly through `cc`), and the churn is accepted. If the rind switch lands first, delete this quest instead. -- Check that the WASM build still compiles with each feature combination. - -Decision prompts (✅ chosen): - -- Goal: ✅ forward features / fold into #135 quest / won't fix. -- Neither feature: ✅ gate ClientBuilder / `compile_error!`. -- After rind was planned: fold into rind / ✅ ship interim features. - -## Closes - -- [#477](https://github.com/moq-dev/web-transport/issues/477) - the forwarded features answer the request