-
Notifications
You must be signed in to change notification settings - Fork 746
Prepare 0.22 #1651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare 0.22 #1651
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1651 +/- ##
=======================================
Coverage 95.90% 95.90%
=======================================
Files 78 78
Lines 16083 16083
=======================================
Hits 15424 15424
Misses 659 659 ☔ View full report in Codecov by Sentry. |
Looks great! I've done a pass through the commits and spotted a couple tweaks:
This bit fell out of date as of d963be3 - the Some other breaking changes to mention: |
What do you think of adding the full list of items that have been moved / renamed / added / removed, like I summarized at #1435 (comment) ? I suspect most people will upgrade by building with the new version, seeing what breaks, then checking the changelog for the affected symbols. That will be be made easier if they are all named. Note my list only contains structs/enums/traits/functions. If it's useful I can add methods to the mix as well. Also: can we add a stub CHANGELOG.md that points people to the GitHub Releases list? And/or link to the GitHub Releases list from lib.rs / README.md? |
Edited these into the above.
Have expanded/added more of the moved items, but ran out of steam for today. Feels like this is something that is best automated from the cargo doc json / cargo-public-api.
We actually have that -- https://github.com/rustls/rustls#release-history |
I provided a list in the linked comment that I think is more comprehensive and easier to read than the old/new table: #1435 (comment). I think it should be possible to just copy-paste that in place of the old/new table. Agreed that this is best automated (with some human editing on top to help it all make sense). I did try using cargo-public-api to generate the list, but it produced excessive diffs; I think it may be having trouble with rustdoc JSON generated by different versions of rustdoc.
Huh, I went looking several times and didn't notice that link. I think that's because "release history can be found on GitHub" sounds like a tautology to me, since all releases are published on GitHub. I was searching for "changes" or "changelog" to find the human-curated description of the changes in each release. I'll submit a separate PR for this. |
I feel like crypto providers should be at top of the list, before CRL support, since I suspect it will have impact for more of our audience. Otherwise, this looks good! |
I see what you're saying now. The release note item with the table was really intended to record types that moved specifically for the crypto provider work. Not a list of absolutely everything moved/removed/added (some of which are better covered in other release note items, eg |
I feel like we should consider addressing #1628 (review) before we release. |
I think this is much too fundamental to be changing at this point. |
Agreed, maybe for similar reasons we should put the aws-lc-rs support after the crypto provider and before the CRL bits? |
This is mainly a user interface change. Under the hood nothing would change. The reason I think it's useful to squeeze in is that #1628 wound up introducing By making that proposed change we can (a) get rid of an unwrap during config building and (b) have exactly one place to specify the protocol versions (by specifying a CryptoProvider with an empty list of TLS 1.2 ciphersuites). |
I'm not sure I understand what's confusing about it. Can you expand on your thought process? |
Sure! If I'm a user looking at the docs and I know I want to turn off TLS 1.2, I might find ConfigBuilder::with_protocol_versions. So I write: let config = rustls::ClientConfig::builder()
.with_protocol_versions(&[&rustls::version::TLS13])
.unwrap()
.with_root_certificates(root_store)
.with_no_client_auth(); And I get the error:
That error is a bit confusing if you haven't internalized the state machine of ConfigBuilder- that is, if you aren't paying close attention to the type parameters. If I look in the docs for Or I might notice at the same time that there is also |
@jsha Ahh! yes ok, I understand now. Thank you, that's helpful. |
Have done that reordering.
Not disagreeing, but the constraint we have here is to release 0.22 really very soon (today), to clear to board for 0.23 PRs to start being landed. Those need to be landed by EOY for rather dry contractual reasons. |
Fair point. And with the additional discussion on #1628 (comment) I'm convinced it's not practical to land the change to configuring protocol versions in time for 0.22. Thanks for considering. 👍🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
FYI made some edits to the top post to mention that OwnedTrustAnchor and ServerName were moved to rustls_pki_types. If I find more things that should be in the changelog after the release is published, do you mind if I go ahead and edit them into the release notes, or would you like a code review process for changelog updates? Also I think the changelog could use a section on related crates, saying for instance: You will probably need to add a dependency on rustls-pki-types:
Also, if you have dependencies on these related crates you will need to upgrade to these versions:
|
One question I've had is if we should be re-exporting the pki-types, maybe as |
Bump on this:
There are some items I've noticed as I upgrade |
Yes, please do improve the release notes as you see fit. |
Release notes
New features
CryptoProvider
trait. ring is now optional, but remains the default provider.Breaking changes
RootCertStore::add_parsable_certificates
now takes aimpl IntoIterator<Item = impl AsRef<[u8]>>
.inclusion of SCTs in certificates.
WebPkiVerifier
toWebPkiServerVerifier
ServerCertVerifier
/ClientCertVerifier
so the trait doesn't depend on webpki. Instead the previous implementations are exposed asrustls::crypto::verify_tls12_signature
,rustls::crypto::verify_tls13_signature
and$PROVIDER.signature_verification_algorithms.supported_schemes()
, using the crypto provider of your choice.WebPkiServerVerifier::builder()
andWebPkiClientVerifier::builder()
.dangerous_configuration
,secret_extraction
andquic
crate features. The API features those previously gated are now available without a crate feature. Types previously gated on thedangerous_configuration
feature now appear indanger
modules in the same place.rustls::Certificate
has been replaced withrustls_pki_types::CertificateDer
from the new rustls-pki-types crate. Likewise,rustls::PrivateKey
has been replaced withrustls_pki_types::PrivateKeyDer
andrustls::OwnedTrustAnchor
has been replaced withrustls_pki_types::TrustAnchor
.RootCertStore
is now passed around wrapped in anArc
, to improve efficiency when creating a different verifier for different servers/clients but with the same roots.Debug
bound. Please exercise caution in using#[derive(Debug)]
on types that contain secret data.RootCertStore::add_server_trust_anchors
becameRootCertStore::add_trust_anchors
(6978464)ConfigBuilder<ClientConfig, WantsClientCert>::with_single_cert
fn was removed in favour ofwith_client_auth_cert
(42cda46)rustls::CipherSuiteCommon
rustls::crypto::CipherSuiteCommon
rustls::SupportedKxGroup
rustls::crypto::SupportedKxGroup
rustls::cipher_suite::*
rustls::crypto::ring::cipher_suite::*
rustls::Ticketer
rustls::crypto::ring::Ticketer
rustls::ALL_KX_GROUPS
rustls::crypto::ring::ALL_KX_GROUPS
rustls::ALL_CIPHER_SUITES
rustls::crypto::ring::ALL_CIPHER_SUITES
rustls::DEFAULT_CIPHER_SUITES
rustls::crypto::ring::DEFAULT_CIPHER_SUITES
rustls::kx_group::*
rustls::crypto::ring::kx_group::*
rustls::sign::any_ecdsa_type
rustls::crypto::ring::sign::any_ecdsa_type
rustls::sign::any_eddsa_type
rustls::crypto::ring::sign::any_eddsa_type
rustls::sign::any_supported_type
rustls::crypto::ring::sign::any_supported_type
Moved/renamed/new items
Moved
ALL_CIPHER_SUITES
(crypto providers)ALL_KX_GROUPS
(crypto providers)DEFAULT_CIPHER_SUITES
(crypto providers)SECP256R1
(crypto providers)SECP384R1
(crypto providers)any_ecdsa_type
(crypto providers)any_eddsa_type
(crypto providers)any_supported_type
(crypto providers)CipherSuiteCommon
(crypto
)ClientCertVerified
(server::danger
)ClientCertVerifier
(server::danger
)DangerousClientConfig
(client::danger
)HandshakeSignatureValid
(client::danger
)ServerCertVerified
(client::danger
)ServerCertVerifier
(client::danger
)SupportedKxGroup
(crypto
)Ticketer
(crypto providers)TLS13_AES_128_GCM_SHA256
(crypto providers)TLS13_AES_256_GCM_SHA384
(crypto providers)TLS13_CHACHA20_POLY1305_SHA256
(crypto providers)TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
(crypto providers)TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
(crypto providers)TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
(crypto providers)TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(crypto providers)TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
(crypto providers)TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
(crypto providers)X25519
(crypto providers)Renamed
WebPkiVerifier
(client::WebPkiServerVerifier
)Certificate
(rustls_pki_types::CertificateDer
)OwnedTrustAnchor
(rustls_pki_types::TrustAnchor
)PrivateKey
(rustls_pki_types::PrivateKeyDer
)ServerName
(rustls_pki_types::ServerName
)SignError
(crypto::ring::sign::InvalidKeyError
)Added/newly public
ActiveKeyExchange
(crypto
)AeadKey
(crypto::cipher
)Algorithm
(quic
)ClientCertVerifierBuilder
(server
)DangerousClientConfigBuilder
(client::danger
)expand
(crypto::tls13
)OkmBlock
(crypto::tls13
)OutputLengthError
(crypto::tls13
)ServerCertVerifierBuilder
(client
)TicketSwitcher
(ticketer
)WebPkiClientVerifier
(server
)Added/newly public (crypto provider extensibility)
default_provider()
(crypto::ring
)default_provider()
(crypto::aws_lc_rs
)HashAlgorithm
(crypto::hash
)Hash
(crypto::hash
)Hkdf
(crypto::tls13
)HkdfExpander
(crypto::tls13
)HkdfExpanderUsingHmac
(crypto::tls13
)HkdfUsingHmac
(crypto::tls13
)Hmac
(crypto::hmac
)Iv
(crypto::cipher
)KeyBlockShape
(crypto::cipher
)Key
(crypto::hmac
)KeyExchangeAlgorithm
(crypto
)make_tls12_aad
(crypto::cipher
)make_tls13_aad
(crypto::cipher
)MessageDecrypter
(crypto::cipher
)MessageEncrypter
(crypto::cipher
)Nonce
(crypto::cipher
)Nonce
(crypto::cipher
)OpaqueMessage
(crypto::cipher
)Output
(crypto::hash
)PlainMessage
(crypto::cipher
)Prf
(crypto::tls12
)PrfUsingHmac
(crypto::tls12
)SharedSecret
(crypto
)Tag
(crypto::hmac
)Tls12AeadAlgorithm
(crypto::cipher
)UnsupportedOperationError
(crypto::cipher
)WebPkiSupportedAlgorithms
(crypto
)Added/newly public (error types)
GetRandomFailed
(crypto
)OtherError
(top level)UnsupportedOperationError
(crypto::cipher
)VerifierBuilderError
(client
)VerifierBuilderError
(server
)Removed
AllowAnyAnonymousOrAuthenticatedClient
AllowAnyAuthenticatedClient
BulkAlgorithm
CertificateTransparencyPolicy
supported_sign_tls13
WantsTransparencyPolicyOrClientCert
closes #1435