Hide algorithms behind features #98
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes allows you to select which algorithms are supported using Cargo features. By default, the newly added features are all selected, so there should be no functional/API changes.
The motivating factor was that I wanted to use
rustls-webpki
crate for X.509 Certificate Path Validation algorithm in a context other than TLS. For that, I don't need any of the AES/ChaCha20 etc support, and I don't want to pull these libraries into my SBOM.In addition, to support the above, the change also exposes
SignatureVerificationAlgorithm
s fromverify::{rsa,ecdsa,eddsa}
modules through public API.One change I made was to remove
SignatureScheme::ECDSA_NISTP521_SHA512
fromTLS12_ECDSA_SCHEMES
list: this is not actually supported by this provider, and correct me if I'm wrong, but I think it got there by mistake.Two questions:
#[cfg(...)]
to remove them. I currently went with 1), because 2) is bad, 3) makes the code unreadable because almost all of the symbols need to be qualified, and 4) requires a lot of extra cfg flags. Please let me know if you'd like me to implement 3 or 4.