Commit Graph

41 Commits

Author SHA1 Message Date
Brian Smith 8f81719df5 Appease Clippy. 2024-02-18 13:14:42 -08: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
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 5b67fb92da Rename error variants according to Rust conventions. 2021-04-09 15:58:41 -07:00
Brian Smith 628b8d6d6f Remove `der::Value::tlv`.
This was added as a prerequisite for a feature that hasn't landed yet, but it
is currently unused. Further, it is using deprecated features of `untrusted`.
Remove it. We'll add it back if/when we need it, probably with a different
implementation.
2021-02-18 13:30:21 -08:00
Brian Smith 0789a90d94 Avoid using `as` for conversions from `Tag` to `u8`.
*ring* added a safer way to do this conversion a while back.
2021-02-18 12:30:28 -08:00
Brian Smith ead26ed429 Style: use `impl Trait` instead of explicitly-named type parameters. 2021-02-18 10:54:16 -08:00
Brian Smith 07306a64a3 Remove `nested_mut`.
`nested_mut` does what `nested` does. It was written when the author was
confused about how the closure traits work.
2021-02-17 00:53:17 -08:00
Brian Smith f653e01acc der: Rewrite `read_digit`.
Address Clippy 1.49.0 `clippy::manual_range_contains` complain.
2021-01-06 23:50:17 -08:00
Brian Smith 0486ea10f6 `cargo fmt`. 2020-12-29 13:09:55 -08:00
Brian Smith 264a98860c Clippy: Remove unneeded lifetime annotations. 2020-12-07 17:57:08 -08:00
Brian Smith f559cbcb49 Clippy: Address `clippy::cast-lossless` warnings. 2020-12-07 17:57:08 -08:00
Brian Smith d2c995a842 Retain the entire `SubjectPublicKeyInfo` structure when parsing.
Retain the tag and value of the `subjectPublicKeyInfo` field so that
the entire `SEQUENCE` can be accessed in future code.
2020-03-22 14:33:12 -05:00
Brian Smith 0d2699a389 Remove use of `untrusted` from the public API. 2019-07-15 21:25:11 -10:00
Brian Smith 8c73c9c9f1 `cargo +nightly fmt.` 2019-03-28 15:26:38 -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 faa7f2b88b Revert "`cargo +nightly fmt`."
This reverts commit 7379d6062b. We'll merge
some outstanding PRs before doing the reformat.
2019-01-29 17:06:47 -10:00
Brian Smith d71a5588e3 Use `untrusted::read_all` instead of `untrusted::read_all_mut`.
`read_all_mut()` will be removed from `untrusted` soon since it is
redundant with `read_all()`.
2019-01-29 17:05:55 -10:00
Brian Smith 7379d6062b `cargo +nightly fmt`. 2019-01-29 17:03:53 -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 5a739cd967 Replace `try!(...)` with `...?`. 2017-08-25 09:00:43 -10:00
Joseph Birr-Pixton 7f38a1dbc7 Expose our own time type `webpki::Time`
You can make one of these using `webpki::Time::from_seconds_from_unix_epoch`.

- Move ASN1 conversion functions to "calendar.rs", and add some tests.
- The new feature `use_std` adds `from<std::time::SystemTime>` to `webpki::Time`.
- Fixate time in tests/integration to prevent future expiry.
- Add a library-external test of `use_std` feature.
- Run tests with `use_std` and without.
2017-08-18 10:40:46 -10:00
Brian Smith edbbb81329 Drop dependency on the time crate; use `std::time::SystemTime`. 2017-08-18 10:40:25 -10:00
Brian Smith d2169004c0 Simplify AlgorithmIdentifier parsing & matching.
Simplify the way algorithm identifiers are parsed. Simplify the tests
to account for the new simpler parsing.

Simplify how algorithm identifiers are matched against known algorithm
identifiers by using just bytewise comparison.

Simplify the storage of known algorithm identifiers by including their
binary DER-encoded values from files in src/data/. Remove most of the
macros for encoding OID values as they are no longer needed. Remove the
script for generating PSS-related AlgorithmIdentifier parts in favor of
using der-ascii in the future, as documented in src/data/README.md.
Remove the encoded PSS parts generated from the deleted script, as they
were replaced in this transition.
2016-11-21 13:19:40 -10:00
Brian Smith 272de41132 Use `use` more consistently.
Follow the way it is done in *ring* (mostly).
2016-08-12 23:08:27 -10:00
Brian Smith 01025339d9 Fix typos in documentation of der::optional_boolean. 2016-08-12 21:54:33 -10:00
Brian Smith 011adae3af Rename {expect,read}_tag_and_get_input -> {expect,read}_tag_and_get_value.
Be consistent with the *ring* names.
2016-08-12 21:52:59 -10:00
Brian Smith fad3e4fbc5 Consistently use the name "webpki" instead of "libwebpki." 2016-06-30 17:07:39 -10:00
Brian Smith 3497ab6ea6 Use `ring::der::small_nonnegative_integer`.
`webpki::der::integer` was moved to *ring* and renamed.
2016-06-17 18:07:37 -10:00
Brian Smith 2f3c98c178 Updates for untrusted.rs API changes. 2016-06-05 13:26:46 -10:00
Brian Smith 72a3ad9d3c Use `ring::der::positive_integer` for serial numbers. 2016-05-23 18:10:54 -10:00
Brian Smith 0a2d7891d4 use new |ring::signature| API for verifying signatures. 2015-12-10 18:25:16 -10:00
Brian Smith 46d1725a95 Use |ring::input| and |ring::der|.
|webpki::input| was copied to |ring::input|. The core of |webpki::der|
was copied to |ring::der|. This change removes the duplicate code from
libwebpki and adapts the rest of libwebpki accordingly.
2015-12-10 17:48:32 -10:00
Brian Smith b808268039 Improve the parsing and matching of OIDs.
This just factors out the matching of common prefixes when looking up
OIDs. It probably isn't significantly faster but it is less code and
hopefully less object code.

This also removes support for the id-pe-authorityInfoAccess extension.
We saved the value of the extension but it wasn't being used anywhere.
2015-09-01 11:19:31 -07:00
Brian Smith 293355f7dc Name validation [2/2]: Add |verify_cert_dns_name|. 2015-08-27 10:23:34 -07:00
Brian Smith d1d54f169e Name validation [1/2]: Validate DNS ID syntax. 2015-08-27 10:23:34 -07:00
Brian Smith f9ac40dd2b Add time parsing. 2015-08-27 10:23:29 -07:00
Brian Smith 7cff654f54 Add certificate parsing. 2015-08-27 10:23:29 -07:00
Brian Smith a43b691427 Add parsing and verification of signed data. 2015-08-27 10:23:28 -07:00
Brian Smith 6b60cbd719 Add ASN.1 DER parsing framework. 2015-08-27 10:23:27 -07:00