Files
iroh/.github
Philipp Krüger 387c2e4fcb feat(iroh): Pluggable crypto backends (#3992)
## Description

- Introduces a `ring` feature flag that enables turning off the ring
dependency
- Introduces a `aws-lc-rs` feature flag that enables using aws-lc-rs as
the crypto provider for rustls for everything TLS in iroh
- Adds `iroh::endpoint::Builder::crypto_provider` allowing anyone to
configure custom crypto providers beyond ring and aws-lc-rs. This is a
required call when neither `ring` nor `aws-lc-rs` are enabled, but will
default to either (preferring ring) if the features are enabled.
- Adds `presets::Empty` and `presets::Minimal`. The latter sets the
minimal set of required options on the builder, but is only available on
the `ring` or `aws-lc-rs` feature flags.
- Removes `Endpoint::empty_builder` in favor of `Endpoint::builder`
together with either the `presets::Empty` or `presets::Minimal`.

Depends on https://github.com/n0-computer/noq/pull/496

## Breaking Changes

- Added `iroh::endpoint::Builder::crypto_provider` for configuring the
crypto provider. After having built the Endpoint, you can get back the
crypto provider via `endpoint.tls_config().crypto_provider()`.
- Removed `Endpoint::empty_builder`. Use
`Endpoint::builder(presets::Empty)` or
`Endpoint::builder(presets::Minimal)` instead.
- **Behavioral**: If you don't call
`iroh::endpoint::Builder::crypto_provider`, you will get an error when
building in the call `Builder::bind()`.

## Notes & Open Questions

It's probably worth asking ourselves if we want to change the way we run
CI now.
Most of our tests are cfg-ed out when you disable *both* the ring and
aws-lc-rs features.
However, maybe we should add another test category that's like
`--no-default-features --feature ring/aws-lc-rs`?
We could call it `minimal` (and I guess we'd have to decide to use
either ring or aws-lc-rs).
2026-03-20 13:08:36 +00:00
..