Skip to content

Avoid multiple cryptography dependencies - #78

Merged
gdsks-dev merged 3 commits into
glincker:mainfrom
cpu:avoid-dupe-crypto
Nov 19, 2026
Merged

gdsks-dev merged 3 commits into
glincker:mainfrom
cpu:avoid-dupe-crypto

Conversation

@cpu

@cpu cpu commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Hi there,

Interesting project! I have no love for the openssl CLI and it was nice to see you using rustls for a modern replacement :-)

What does this PR do?

Previously sslx builds used both ring and aws-lc-rs due to a combination of upstream dependency features & an explicit ring dependency for SHA256.

There was a comment in Cargo.toml that suggested that ring was already brought in via rustls, but that hasn't been an accurate description of the default Rustls cryptography provider since 0.23.0:

sslx/Cargo.toml

Lines 39 to 40 in a89969b

# SHA-256 (ring is already pulled in by rustls, just making it explicit)
ring = "0.17"

I think standardizing on aws-lc-rs throughout is the best choice. It's drop-in compatible for the ring APIs you were already using, it has post-quantum algorithm support, it receives regular updates, it has the best performance, and isn't self-declared as experimental. If you'd prefer to standardize on ring it would be possible to write a similar PR adjusting features in the inverse direction to arrive at just ring and no aws-lc-rs but I wouldn't personally recommend that.

How to test

You can use cargo tree to verify the before/after state.

Before, ring was being brought in by sslx (for SHA256), rcgen (by its default features), and x509-parser (via the verify feature that wasn't actually used in-tree AFAICT).

$ git rev-parse HEAD
a89969b911535cfa1ef0e5287454dd16508d622a

$ cargo tree -i ring
ring v0.17.14
├── rcgen v0.14.10
│   └── sslx v0.4.0 (/home/daniel/Code/Rust/sslx)
├── sslx v0.4.0 (/home/daniel/Code/Rust/sslx)
└── x509-parser v0.18.1
    └── sslx v0.4.0 (/home/daniel/Code/Rust/sslx)

$ cargo tree -i aws-lc-rs
aws-lc-rs v1.18.1
├── rustls v0.23.45
│   └── sslx v0.4.0 (/home/daniel/Code/Rust/sslx)
└── rustls-webpki v0.103.15
    └── rustls v0.23.45 (*)

Afterwards, only aws-lc-rs is present:

$ git rev-parse HEAD
86d7d62dba6f3308a62a70134e0656e3f311c535

$ cargo tree -i ring
warning: nothing to print.

To find dependencies that require specific target platforms, try to use option `--target all` first, and then narrow your search scope accordingly.

$ cargo tree -i aws-lc-rs
aws-lc-rs v1.18.1
├── rcgen v0.14.10
│   └── sslx v0.4.0 (/home/daniel/Code/Rust/sslx)
├── rustls v0.23.45
│   └── sslx v0.4.0 (/home/daniel/Code/Rust/sslx)
├── rustls-webpki v0.103.15
│   └── rustls v0.23.45 (*)
└── sslx v0.4.0 (/home/daniel/Code/Rust/sslx)

Checklist

  • cargo test passes
  • cargo clippy clean
  • cargo fmt applied

I tacked on two extra commits to fix cargo fmt and cargo clippy.

cpu added 3 commits October 16, 2026 10:39
Rustls uses aws-lc-rs by default, while rcgen is still using ring as
default. Similarly, x509-parser w/ the base verification feature uses
ring, but since this feature isn't in use we can drop it as opposed to
switching to the aws-lc-rs backed verification feature.

Instead of having a mix of both ring and aws-lc-rs, this commit
standardizes on aws-lc-rs throughout.
Of the form:
```
warning: redundant reference in `format!` argument
  --> src/output/terminal.rs:98:41
   |
98 |         format!("{}{}{}", colors::CYAN, &empty, colors::RESET)
   |                                         ^^^^^^ help: remove the redundant `&`: `empty`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#useless_borrows_in_formatting
   = note: `#[warn(clippy::useless_borrows_in_formatting)]` on by default
```
@gdsks-dev
gdsks-dev merged commit 2d126db into glincker:main Nov 19, 2026
@cpu
cpu deleted the avoid-dupe-crypto branch November 19, 2026 17:21
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.

2 participants