Commit Graph

105 Commits

Author SHA1 Message Date
Brian Smith 2dae2124f5 wip 2024-02-18 14:49:11 -08:00
Brian Smith f84a538a5c 0.22.4. 2023-10-08 18:27:19 -07:00
Brian Smith 60e688b6c2 0.22.3. 2023-10-08 17:33:58 -07:00
Brian Smith e7873ffe4b Restore MSRV to 1.61.0. 2023-10-08 10:31:11 -07:00
Brian Smith ba29bbfce2 Move rcgen-based tests to their own crate.
Remove the `rcgen` dev-dependency from the webpki crate.
2023-10-08 10:31:11 -07:00
Brian Smith cef4925a16 Use *ring* 0.17.2. 2023-10-06 17:43:50 -07:00
Brian Smith 16a2638bd0 Upgrade to *ring* 0.17 and untrusted 0.9.
untrusted 0.9 is used by *ring*. untrusted stopped providing a `PartialEq`
for `Input` in 0.9; this was the driver for all the code changes.
2023-10-02 14:24:17 -07:00
Brian Smith 301128fa01 0.22.2. 2023-10-02 10:28:27 -07:00
Daniel McCarney b5a6f4d9e6 Cargo: unpin rcgen dev-dependency
Rcgen 0.11.3 has been released and fixed the semver breakage that
required temporarily pinning to 0.11.1.
2023-10-02 10:23:59 -07:00
Brian Smith 93aca11db8 Use `"src/**/*.rs"` in Cargo.toml to include sources. 2023-09-30 09:03:22 -07:00
Daniel McCarney 52f4db4b85 tests: add BetterTLS path building test suite.
[`git cherry-pick 4a39e2b67d4cddf58b0ea16dd821a04ee2240058`, with support
for Edition 2018 added by Brian.]

This commit introduces the Netflix BetterTLS[0]'s path building test
suite to the webpki integration tests.

This project has a test runner for Rustls that will stand up TLS servers
to exercise these tests but:

* It requires Go.
* It needs Rustls in order to do a full TLS handshake with the test
  servers.
* It's slower than testing the path building directly without the TLS
  bits.

To avoid these issues this commit takes a different approach and vendors
the exported path building test suite. This is a supported feature[1] of
the upstream project and allow us to directly test webpki's path
building against the test suite without needing Rustls or Go.

[0]: https://github.com/Netflix/bettertls
[1]: https://github.com/Netflix/bettertls#exporting-tests-to-run-outside-of-the-bettertls-executor
2023-09-29 21:50:11 -07:00
Brian Smith 31987f3f09 Pin `rcgen` to 0.11.1 since 0.11.2 broke semver. 2023-09-29 20:21:44 -07:00
Brian Smith ad1fe9288e Documentation: Stop hard-coding briansmith.org paths.
Let people find the docs on docs.rs.
2023-08-30 17:04:56 -07:00
Brian Smith c81f92e4e8 0.22.1 2023-08-30 14:48:28 -07:00
Daniel McCarney 30a108e080 verify_cert: enforce maximum number of signatures.
Cherry-picked from e473ee1ecb335d8efa3d4ceb2feb369f46b125f2 and modified
by Brian Smith. The main modifications were:

1. Maintain API compatibility with webpki 0.22.0.
2. (In `build_chain_inner`), stop immediately on fatal error, without
   considering any more paths. The point of having such fatal errors
   is to fail ASAP and avoid unneeded work in the failure case.
3. The test uses rcgen which requires Rust 1.67.0 or later. (I don't
   think the non-test MSRV of webpki changes though.)

The original commit message is below:

Pathbuilding complexity can be quadratic, particularly when the set of
intermediates all have subjects matching a trust anchor. In these cases
we need to bound the number of expensive signature validation operations
that are performed to avoid a DoS on CPU usage.

This commit implements a simple maximum signature check limit inspired
by the approach taken in the Golang x509 package. No more than 100
signatures will be evaluated while pathbuilding. This limit works in
practice for Go when processing real world certificate chains and so
should be appropriate for our use case as well.
2023-08-30 14:08:00 -07:00
Brian Smith 0cd0b31beb Revert main branch crate contents to the 0.22.0 release contents.
Reset the crate contents (sources, tests, etc.)
to what they were at that commit, while retaining the newer CI
configuration.

The changes since the 0.22.0 release were primarily intended to
accomplish two goals:

* Fix and improve the GitHub Actions configuration.
* Prepare a 0.21.5 release that was backward compatible with 0.21.4
  but which also contained the improvements that were in 0.22.0.

0.21.5 was never released and will not be released. Therefore all
of the noise to facilitate the 0.21.5 release can just be deleted,
as long as we leave the CI changes that are necessary for GitHub
Actions to work correctly now.

The exact commands I used were:

```
git checkout \
    6c334a2cf5 \
    -- \
    Cargo.toml \
    LICENSE \
    README.md \
    src \
    tests \
    third-party
git rm src/trust_anchor_util.rs
```

Commit 6c334a2cf5 was the commit from
which 0.22.0 was released. It is confusing because the commit
immediately prior, 0b7cbf2d32, has
commit message "0.22.0". It appears that I merged the "0.22.0"
commit, expecting to `cargo publish` from that commit, but then
`cargo publish` failed. Then I added
6c334a2cf5 to fix `cargo publish`
and did the `cargo publish` from that commit. That's why I added
the `package` CI step at that time, to prevent this confusing
situation from happening again.

`trust_anchor_utils.rs` was not in 0.22.0; the `git checkout` didn't
delete it, so I had to do it separately.

I left the tests added subsequent to 0.22.0 in `tests/` (e.g.
`name_tests.rs`) since those tests pass with the 0.22.0 sources too.

Unfortunately, this requires disabling a bunch of Clippy lints, to
avoid modifying the contents from 0.22.0.

(I know it is confusing. It took me a while to figure it out myself
today.)
2023-08-30 08:31:51 -07:00
Fabio Valentini 6e037e3de0 update base64 dev-dependency to 0.13 2021-05-07 15:30:49 -07:00
Brian Smith 17d9189981 Temporarily undo some renaming that can't be alised, to get back webpki 0.21.4 compat.
Make it easier to maintain support for Rustls 0.19.1 by restoring the webpki main branch to a
state compatible with webpki 0.21.4.
2021-05-07 15:12:11 -07:00
Brian Smith de7fb02d2e Restore `Time::try_from`. 2021-05-07 15:12:11 -07:00
Brian Smith 5d5c71095c Add more backward-compatibility aliases. 2021-05-07 15:12:11 -07:00
Brian Smith 6c334a2cf5 CI/CD: Add a `package` job. 2021-04-09 17:12:55 -07:00
Brian Smith 0b7cbf2d32 0.22.0. 2021-04-09 16:15:55 -07:00
Brian Smith 5d6f260215 Rename main module file to `lib.rs` from `webpki.rs`. 2021-01-25 21:49:15 -08:00
Brian Smith 28951a0d46 Don't enable *ring*'s `alloc` feature by default; Require `alloc` for RSA.
Only use *ring*'s `alloc` feature if webpki's `alloc` feature is enabled. This
disables RSA by default.

Adjust some tests that return different results depending on whether RSA is
available.
2021-01-07 13:08:30 -08:00
Brian Smith 2deeb79c74 Refactor features.
Test all feature configurations in CI.

Remove the `trust_anchor_utils` feature flag.

Guard all features that directly require allocation with a new `alloc` feature.
The RSA features will be handled separately.

Document the features. Tell docs.rs to document all features.

Adjust some tests so that tests are run in more configurations.
2021-01-07 00:36:28 -08:00
Brian Smith 3fccb4395e Make all features non-default; test default and --all-features configs in CI/CD. 2020-12-29 22:02:56 -08:00
Brian Smith e51f215d2e 0.21.4. 2020-12-07 15:37:11 -08:00
Brian Smith 4c3971f803 Require *ring* 0.16.19 or later. 2020-12-01 20:09:47 -08:00
Brian Smith 049c5ad5c5 0.21.3: Use *ring* 0.16.14 and untrusted 0.7.1. 2020-05-30 01:03:58 -05:00
Joseph Birr-Pixton a271a29a31 Include test input files in cargo package 2020-03-22 11:33:32 -05:00
Brian Smith 750b4ff8b6 0.21.2: Use *ring* 0.16.10 or later. 2020-01-31 10:50:14 -06:00
Jeffrey Griffin 3c92126b95 fix no_std compatibility 2020-01-17 17:14:18 -06:00
Brian Smith 482627c40d 0.21.0 using *ring* 0.16.0 and untrusted 0.7.0. 2019-07-15 22:07:45 -10:00
Brian Smith a3a72bf655 0.20.0 using *ring* 0.15.0 2019-07-14 08:53:52 -10:00
Brian Smith 07e799cac4 0.20.0-alpha6 using *ring* 0.15.0-alpha6. 2019-07-13 15:15:57 -10:00
Brian Smith 6440a12b21 0.20.0-alpha5 using *ring* 0.15.0-alpha5 2019-07-13 14:55:41 -10:00
Brian Smith d60ee6e296 0.20.0-alpha1 2019-07-09 18:27:05 -10:00
Brian Smith 0ea46b594b Use *ring* 0.15.0-alpha3. 2019-07-09 18:27:05 -10:00
Brian Smith d31d80121a Fix Cargo.toml includes. 2019-07-09 18:27:03 -10:00
Brian Smith 0d8a27161a Switch to Rust 2018 Edition. 2019-03-28 15:26:38 -10:00
Brian Smith 003f503124 Update dependencies to in-development versions. 2019-03-28 15:19:47 -10:00
Brian Smith f12b339918 0.19.1 using *ring* 0.14.2. 2019-01-23 10:03:45 -10:00
Brian Smith daa400e1ed 0.19.0. 2019-01-09 09:12:23 -10:00
Brian Smith 9d536ccd9e 0.19.0-alpha1: Update to *ring* 0.14.0-alpha2. 2018-12-21 15:59:01 -10:00
Brian Smith 4329ed1c25 Bump version number for incompatible changes. 2018-11-28 13:35:31 -10:00
Brian Smith 43a5b747c0 0.18.1. 2018-07-13 09:24:57 -10:00
Brian Smith 68558df613 0.18.0. 2018-07-13 09:14:27 -10:00
Brian Smith a69287be1e 0.18.0-alpha4. 2018-06-05 09:45:03 -10:00
Brian Smith 68fcf3dd3b 0.18.0-alpha3. 2018-05-15 11:16:36 -10:00
Brian Smith d813158c1b 0.18.0-alpha2. 2018-05-15 11:12:56 -10:00