Skip to content

feat: port VLESS Reality onto upstream rustls main (0.24.0-dev)#9

Closed
ibigbug wants to merge 1523 commits into
utls-0.23from
rebase/reality-on-upstream-main2
Closed

feat: port VLESS Reality onto upstream rustls main (0.24.0-dev)#9
ibigbug wants to merge 1523 commits into
utls-0.23from
rebase/reality-on-upstream-main2

Conversation

@ibigbug
Copy link
Copy Markdown
Member

@ibigbug ibigbug commented May 11, 2026

Summary

Ports the VLESS Reality feature onto the latest upstream rustls main (0.24.0-dev.0), replacing the old utls-0.23 base (rustls 0.23.21 / webpki 0.102.8). Supersedes PRs #7 and #8.

Key changes

New additions

  • Reality protocol fully ported to the new upstream API
  • Added workspace deps: x25519-dalek, aes-gcm, ed25519-dalek, hmac, sha2 (Reality no longer uses ring/aws-lc-rs directly for its crypto)

Architectural adaptations (0.23.21 → 0.24.0-dev)

  • key_share type changed: Option<Box<dyn ActiveKeyExchange>>Option<GroupAndKeyShare>
  • ServerCertVerifierServerVerifier with new verify_identity() / SignatureVerificationInput API
  • ring/aws_lc_rs removed from the rustls crate — Reality now uses x25519-dalek/aes-gcm directly
  • Package renamed to watfaq-rustls with [lib] name = "rustls" to keep doctests working

File renames handled

  • client/builder.rsclient/config.rs
  • client/client_conn.rsclient/connection.rs
  • crypto/ring/ → separate rustls-ring crate (not modified)
  • crypto/aws_lc_rs/ → separate rustls-aws-lc-rs crate (not modified)

Validation

  • cargo check -p watfaq-rustls
  • cargo test -p watfaq-rustls ✅ 215 passed, 0 failed

Next step

Once merged, update the rev pin in clash-rs/clash-lib/Cargo.toml to point at the new commit.

djc and others added 30 commits February 6, 2026 21:00
This changes `Connection` into a trait rather than enum, and ensures
that `ClientConnection` and `ServerConnection` impls it.  This
removes `ConnectionCommon` and `CommonState` derefs, and allows those
types to become private.  The `Deref` to `ConnectionOutputs` is maintained.

This becomes important later, because the use of Deref commits us
to using those parts for the internal representation of (eg) a
`ClientConnection`.

This comes with the pain that `use rustls::Connection` is needed
for most users.
This withdraws:

- `wants_read()`: not useful, since the library is only used for handshaking.

- `wants_write()`: `write_hs` has a useful base case, and `wants_write()` was
  incorrect in relation to it anyway (did not inspect pending `hs_secrets` or
  `traffic_secrets`).

- `send_close_notify()`: this produces a TLS-level alert, which is illegal in
  QUIC.

None of these are used by Quinn.
djc and others added 27 commits April 26, 2026 18:38
This should be adequately covered by the fragmenter yielding zero chunks.
And hoist perhaps_write_key_update() out of loops.
In the case where SNI is disabled, `inner_sni` falls out of sync with
`self.inner_name`.  `inner_sni` is used to alter the inner hello's
`server_name`, but `self.inner_name` was used as a basis for padding.

This means padding would be added even if the extension wasn't, which
ironically leaks the length of the inner name.
Bumps [openssl](https://github.com/rust-openssl/rust-openssl) from 0.10.78 to 0.10.79.
- [Release notes](https://github.com/rust-openssl/rust-openssl/releases)
- [Commits](rust-openssl/rust-openssl@openssl-v0.10.78...openssl-v0.10.79)

---
updated-dependencies:
- dependency-name: openssl
  dependency-version: 0.10.79
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ibigbug
Copy link
Copy Markdown
Member Author

ibigbug commented May 11, 2026

Closing — rebasing to latest 0.23.x instead.

@ibigbug ibigbug closed this May 11, 2026
@ibigbug ibigbug deleted the rebase/reality-on-upstream-main2 branch May 11, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.