Skip to content

rebase: port Reality feature onto upstream rustls main#8

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

rebase: port Reality feature onto upstream rustls main#8
ibigbug wants to merge 1522 commits into
utls-0.23from
rebase/reality-on-upstream-main

Conversation

@ibigbug
Copy link
Copy Markdown
Member

@ibigbug ibigbug commented May 11, 2026

Summary

Rebases the Watfaq Reality feature onto the latest upstream rustls main, replacing the old utls-0.23 base (rustls 0.23.21 / webpki 0.102.8).

This supersedes PR #7 (webpki 0.103.13 bump) — by tracking upstream we get a much newer webpki and all security fixes for free going forward.

Changes

  • Base: upstream rustls main (~0.23.x → latest, webpki =0.104.0-alpha.7)
  • Package: renamed to watfaq-rustls (lib crate name stays rustls for doctest compatibility)
  • Reality feature ported: rustls/src/client/reality.rs, hooks in hs.rs, builder.rs, client_conn.rs
  • Custom session ID generator ported
  • Workspace package references updated

Validation

  • cargo check -p watfaq-rustls --all-features
  • cargo check -p rustls-ring -p rustls-aws-lc-rs
  • cargo test -p watfaq-rustls --all-features

Next step

Once merged to utls-0.23, 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 26 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>
@ibigbug
Copy link
Copy Markdown
Member Author

ibigbug commented May 11, 2026

Closing — branch was missing the actual Reality commits. Will redo properly.

@ibigbug ibigbug closed this May 11, 2026
@ibigbug ibigbug deleted the rebase/reality-on-upstream-main 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.