Skip to content

0.22.0

Compare
Choose a tag to compare
@ctz ctz released this 02 Dec 17:33
· 482 commits to main since this release

New features

  • Configurable cryptography providers. The cryptography used by rustls is represented by the CryptoProvider trait. ring is now optional, but remains the default provider.
  • Certificate revocation list (CRL) support. The default certificate verifier used in rustls can now be configured with CRLs to control revocation of client and server certificates.
  • Optional support for cryptography from aws-lc-rs. Once the certification process completes , we will support FIPS mode using aws-lc-rs.
  • Separate configuration of root hints in client certificate verifier. To deal with cross-signed client certificate topologies, the list of hints sent to a client can now be configured. The default behaviour remains to send the names of the configured root certificates.

Related libraries

There are some related libraries in the rustls ecosystem. If you depend on these libraries, you'll need at least these versions to be compatible with rustls 0.22:

rustls-pki-types = { version = "1" }
webpki-roots = { version = "0.26" }
rustls-webpki = { version = "0.102" }
rustls-pemfile = { version = "2" }
rustls-native-certs = { version = "0.7"}

Breaking changes

  • Remove support for SCTs provided via TLS extension. Ecosystem support for this is rare compared to inclusion of SCTs in certificates.
  • Rename WebPkiVerifier to WebPkiServerVerifier and add WebPkiClientVerifier.
  • Remove default trait implementations in ServerCertVerifier/ClientCertVerifier so the trait doesn't depend on webpki. Instead the previous implementations are exposed as rustls::crypto::verify_tls12_signature, rustls::crypto::verify_tls13_signature and $PROVIDER.signature_verification_algorithms.supported_schemes(), using the crypto provider of your choice. See tlsclient-mio for an example verifier that has been updated for 0.22.
  • Rework certificate auth verifiers construction into a builder. This covers both server and client certificate verifiers: call WebPkiServerVerifier::builder() and WebPkiClientVerifier::builder().
  • Removed the crate features dangerous_configuration, secret_extraction and quic. The API features those previously gated are now available without a crate feature. Types previously gated on the dangerous_configuration feature now appear in danger modules in the same place.
  • New types for keys and certificates. rustls::Certificate has been replaced with CertificateDer from the new rustls-pki-types crate. Likewise, rustls::PrivateKey has been replaced with rustls_pki_types::PrivateKeyDer. These types come in both owned and borrowed variants, like std::borrow::Cow, but some uses, like rustls::RootCertStore, required the owned (<'static>) variant.
  • RootCertStore is now passed around wrapped in an Arc, to improve efficiency when creating a different verifier for different servers/clients but with the same roots.
  • RootCertStore::add_parsable_certificates now takes a impl IntoIterator<Item = impl AsRef<[u8]>>.
  • RootCertStore::add_server_trust_anchors became RootCertStore::extend.
  • Traits exposed by rustls now require a Debug bound. Please exercise caution in using #[derive(Debug)] on types that contain secret data.
  • The deprecated ConfigBuilder<ClientConfig, WantsClientCert>::with_single_cert fn was removed in favour of with_client_auth_cert (42cda46)
  • Some types and values have moved to accommodate cryptography provider work:
Old New
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)
  • PrivateKey (rustls_pki_types::PrivateKeyDer)
  • SignError (crypto::ring::sign::InvalidKeyError)

Added

  • 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 (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 (error types)

  • GetRandomFailed (crypto)
  • OtherError (top level)
  • UnsupportedOperationError (crypto::cipher)
  • VerifierBuilderError (client)
  • VerifierBuilderError (server)

Removed

  • AllowAnyAnonymousOrAuthenticatedClient
  • AllowAnyAuthenticatedClient
  • BulkAlgorithm
  • CertificateTransparencyPolicy
  • supported_sign_tls13
  • WantsTransparencyPolicyOrClientCert
  • OwnedTrustAnchor - use rustls_pki_types::TrustAnchor instead, and replace from_subject_spki_name_constraints with direct assignment to the struct fields.
  • ConfigBuilder::with_safe_defaults - calls to this can simply be deleted since safe defaults are now implicit.

Changed

What's Changed

  • v0.21.3 release prep by @cpu in #1341
  • Improve coverage of ip address names by @ctz in #1338
  • Take Iterator in add_parsable_certificates() by @daxpedda in #1339
  • CI: add 32bit cross compilation target. by @cpu in #1342
  • build(deps): update webpki-roots requirement from 0.23 to 0.24 by @dependabot in #1346
  • Prep next release by @ctz in #1344
  • lib: export CertRevocationListError enum. by @cpu in #1347
  • ci: add merge_group trigger to ci tasks. by @cpu in #1349
  • client: with_single_cert -> with_client_auth_cert by @cpu in #1345
  • ci: add a cargo-semver-checks action. by @cpu in #1354
  • client::builder: fix PhantomData clippy lint by @ctz in #1359
  • Remove MSRV variant of connect-tests by @ctz in #1358
  • docs: update RELEASING w/ maintenance release steps. by @cpu in #1351
  • Correct unnecessarily &mut function args by @ctz in #1363
  • Extract traits under crypto use (part 1) by @ctz in #1350
  • crypto: fix typo in docstring by @djc in #1370
  • Echo session_id in HRR by @ctz in #1374
  • build(deps): update webpki-roots requirement from 0.24 to 0.25 by @dependabot in #1375
  • ci: fix setup-go build cache warnings. by @cpu in #1376
  • Check usage/intro docs in README.md are in sync by @ctz in #1377
  • directly use core:: & alloc:: API instead of std:: re-exports by @japaric in #1378
  • msgs: make TlsListElement/ListLength pub(crate). by @cpu in #1379
  • readme: add some readability pauses by @tshepang in #1380
  • Fix up nightly clippy issue with incorrect comment by @djc in #1384
  • Move to using prerelease rustls-webpki 0.102.0-alpha.0 by @ctz in #1388
  • verifier: use (stateless) builder API for client verifier. by @cpu in #1368
  • Split out webpki callers into separate module by @ctz in #1389
  • examples: IPv6 for mio client/server examples. by @cpu in #1391
  • ConfigBuilder: expand documentation by @jsha in #1390
  • examples: print server address by @djc in #1394
  • Enable feature(doc_auto_cfg) by @ctz in #1395
  • relax handling of TLS 1.3 plaintext alerts pre-encrypted data exchange by @cpu in #1392
  • Fix new nightly clippy lints by @ctz in #1396
  • Generalise all crypto in rustls::SupportedCipherSuite (part 1) by @ctz in #1398
  • docs: Add note on unsupported self-signed certificates by @exdx in #1382
  • examples: add server_acceptor example. by @cpu in #1402
  • doc: fix max_fragment_size docs by @jsha in #1408
  • Pin specific rcgen commit by @ctz in #1411
  • SECURITY.md: use github vuln reporting tool by @ctz in #1412
  • Arc-wrap ClientConfig RootCertStore and remove expensiveness warnings by @djc in #1413
  • Apply clippy suggestions from Rust 1.72 by @djc in #1415
  • Generalise all crypto in rustls::SupportedCipherSuite (part deux) by @ctz in #1401
  • Enable warnings for cargo doc comments on private items by @ctz in #1419
  • examples: configure KeyLogFile for all examples. by @cpu in #1423
  • Correct cargo test for all feature combinations by @ctz in #1427
  • Implement CPU instruction benchmarks by @aochagavia in #1404
  • Hook up icount benchmarks to CI by @aochagavia in #1431
  • ci: rework connect tests to daily tests, add cargo hack. by @cpu in #1433
  • Affix rustls-webpki prerelease version by @ctz in #1436
  • ci: fix job name for cargo test by @jsha in #1438
  • Fix nightly clippy warning by @djc in #1443
  • Make ci-bench more deterministic by @aochagavia in #1444
  • Switch to using the pki-types crate by @djc in #1432
  • Show detailed icount diff for scenarios with noteworthy diffs by @aochagavia in #1445
  • CI bench fix: create cg_diff tmp file at the cwd by @aochagavia in #1446
  • Bump version to 0.22.0-alpha.1 by @djc in #1447
  • doc: link ResolvesServerCert to Acceptor by @jsha in #1439
  • Take latest webpki, pki-types, pemfile, webpki-roots by @ctz in #1449
  • Bump version to alpha.2 by @djc in #1451
  • build(deps): bump actions/checkout from 3 to 4 by @dependabot in #1456
  • ci-bench: reduce noise in cg_diff output by @ctz in #1453
  • Add StreamOwned::into_parts() API by @djc in #1458
  • Remove TrustAnchorWithDn type by @djc in #1459
  • feat: impl Error for ClientCertVerifierBuilderError by @tottoto in #1455
  • Switch to using pki_types::UnixTime by @djc in #1463
  • More efficient handshake encoding by @ctz in #1465
  • Make ring optional, and demonstrate how alternatives would be integrated by @ctz in #1405
  • Fix pki-types dependency by @djc in #1471
  • icount-bench: apt update before relying on index by @ctz in #1473
  • More consistently use modules for unit tests by @djc in #1470
  • RFC: add a style guide by @djc in #1407
  • Update the readme by @bdaehlie in #1479
  • Use dynamic dispatch for CryptoProvider by @ctz in #1448
  • Remove top-level re-exports by @cpu in #1477
  • proj: remove dangerous_configuration feature by @cpu in #1481
  • Use stable for coverage measurement by @ctz in #1486
  • doc: fix reference to CryptoProvider parameter by @jsha in #1483
  • Export DangerousClientConfigBuilder, follow-up doc tweaks by @cpu in #1488
  • Update rustls version to 0.22.0-alpha.3 by @stevefan1999-personal in #1489
  • Fix minimal versions job & version Cargo.lock by @djc in #1469
  • proj: remove secret_extraction feature. by @cpu in #1484
  • Cargo: remove rcgen git patch by @cpu in #1498
  • ci: run cargo dependabot weekly by @cpu in #1499
  • suites: rework ConnectionTrafficSecrets by @cpu in #1497
  • ci: remove --locked from cargo hack daily test by @cpu in #1500
  • tlsvulns.rs: add reference to "Marvin" attack by @ctz in #1504
  • build(deps): bump regex from 1.9.5 to 1.9.6 by @dependabot in #1505
  • build(deps): bump rcgen from 0.11.2 to 0.11.3 by @dependabot in #1507
  • Make connect-tests part of the workspace by @djc in #1509
  • Misc crypto micro-benchmarks by @ctz in #1511
  • manual: update to clarify downgrade protection by @cpu in #1514
  • docs: clarify self-signed certificate limitation. by @bdaehlie in #1480
  • Group Dependabot updates into a single PR by @djc in #1517
  • Bump MSRV to 1.61 by @djc in #1516
  • Take clap 4.4.6 by @ctz in #1521
  • fuzz: remove unused webpki dependency by @ctz in #1523
  • Upgrade to ring 0.17 by @djc in #1508
  • docs: add more import advice to CONTRIBUTING.md by @cpu in #1526
  • CI bench: save cachegrind logs by @aochagavia in #1531
  • Bump ring 0.17 in dev-deps, bump to latest by @djc in #1528
  • use core::prelude instead of std::prelude by @japaric in #1524
  • docs: adjust ring platform compatibility by @cpu in #1532
  • Fix: flush writers before potentially expecting a response by @robsdedude in #1542
  • Tidy up remaining non-standard names by @cpu in #1543
  • Use cargo-check-external-types to control type leakage in public API by @ctz in #1535
  • build(deps): bump rustix from 0.38.17 to 0.38.19 by @dependabot in #1545
  • ci: move external types config to cargo metadata by @cpu in #1546
  • Clean up rustls::internal exports by @ctz in #1544
  • Zeroize types/fields containing secrets by @ctz in #1492
  • crypto: fix nightly clippy get-first warning by @cpu in #1550
  • expand webpki verifier CRL support by @cpu in #1547
  • Rework KDF interface by @ctz in #1551
  • Reinstate verifier tests by @ctz in #1556
  • docs: create issue templates by @cpu in #1558
  • Separate server hints list from accepted trust anchors by @cpu in #1553
  • Improving webpki verifier CRL support ergonomics by @cpu in #1552
  • disable subtle's default features by @japaric in #1566
  • key_log_file: replace env::var with env::var_os by @paolobarbolini in #1572
  • Update semver-compatible dependencies by @djc in #1574
  • x509: reduce allocations for wrap_in_sequence by @jsha in #1563
  • Reduce allocation counts in a couple of places by @jsha in #1571
  • More general error used in trait SupportedKxGroup & new variant in Error by @Taowyoo in #1575
  • Encrypted client hello configuration messages and serialization by @cpu in #1568
  • replace HashSet with BTreeSet in msgs::handshake by @japaric in #1567
  • Support aws-lc-rs as an optional dependency by @ctz in #1414
  • Debug bounds for all non-internal traits by @cpu in #1559
  • Fix build: new feature needed for std::io::BorrowedBuf et al. by @ctz in #1582
  • General smoke-test for max_fragment_size by @ctz in #1581
  • Cargo: update semver compatible dependencies by @cpu in #1585
  • lib: export crate::error::OtherError by @cpu in #1590
  • Update semver-compatible versions (again) by @djc in #1588
  • add encrypted_payload_len to MessageEncrypter by @japaric in #1579
  • crypto: add HPKE module and traits, provider-example impl by @cpu in #1589
  • add server example for example provider by @ctz in #1596
  • Remove quic crate feature by @ctz in #1594
  • Update dependencies by @djc in #1600
  • Use -Z direct-minimal-versions for minimal versions checks by @ctz in #1601
  • client: remove deprecated with_single_cert by @cpu in #1602
  • crypto: doc-hide the HPKE module by @cpu in #1604
  • QUIC changes follow-up by @djc in #1599
  • aws-lc-rs: consume new TLS-specific APIs by @ctz in #1586
  • Improve crypto provider API documentation by @ctz in #1608
  • doc: update docs for SigningKey by @jsha in #1613
  • doc: replace "nb." with "Note:" by @jsha in #1615
  • turn CertificatePayload type alias into a newtype by @japaric in #1610
  • CI: run clippy on the entire workspace by @japaric in #1618
  • Rename SignError to InvalidKeyError by @djc in #1616
  • client: allow providing webpki cert verifier w/o dangerous by @cpu in #1609
  • crypto: make signer mod pub(crate) by @cpu in #1621
  • CONTRIBUTING: add note about fully qualified function calls by @cpu in #1620
  • doc: CryptoProvider defaults can be overridden by @jsha in #1623
  • Add wall-time mode for CI benchmarks by @aochagavia in #1593
  • Migrate to pki-types ServerName by @djc in #1606
  • Bump rustls version to alpha.5 by @djc in #1625
  • fix warnings in -default +ring build by @japaric in #1627
  • Issue-1632: Ensure SharedSecret::secret_bytes is publicly accessible by @janrueth in #1633
  • Update semver-compatible dependencies by @djc in #1631
  • provider-example: use Error::Other by @cpu in #1629
  • Update webpki, pki-types, bump alpha version by @cpu in #1641
  • RootCertStore: better Debug impl by @jsha in #1622
  • api: move TicketSwitcher to ticketer by @jsha in #1643
  • api: move WebPkiSupportedAlgorithms to crypto by @jsha in #1644
  • ci-bench: filter out noisy test cases from comparison by @ctz in #1649
  • export webpki signature validation helpers in client and server dangerous mods by @cpu in #1634
  • crypto: rework CryptoProvider as struct by @cpu in #1628
  • docs: update README project membership by @cpu in #1650
  • api: move CipherSuiteCommon into crypto by @jsha in #1646
  • doc: add detail on UnexpectedEof by @jsha in #1637
  • doc: make it easier to find changelog by @jsha in #1653
  • Prf: document guarantees and take &mut [u8; 48] by @jsha in #1656
  • api: use OtherError consistently by @jsha in #1654
  • remove InvalidKeyError by @ctz in #1657
  • Small doc tweaks by @cpu in #1658
  • Prepare 0.22 by @ctz in #1651

New Contributors

Full Changelog: v/0.21.9...v/0.22.0