Commit Graph

2538 Commits

Author SHA1 Message Date
Josh Aas 10411018e9 Update text regarding production status. 2023-09-15 16:36:52 +00:00
Josh Aas 0b9e07847e Fix to stay within 90 character line limit 2023-09-15 16:36:52 +00:00
Josh Aas 274b285d15 Update the readme with the following changes:
- Don't list dependencies in the headline
- Remove relativistic language like "mature" and "widely"
- Remove possible future features as it is incomplete and thus misleading, should eventually replace with a roadmap
- Make it clear that Rustls provides no unsafe features *by default*
- remove self-signed certs and compression from non-features list because it's nuanced and we don't want to turn people away
- Add a list of project leadership
2023-09-15 16:36:52 +00:00
Daniel McCarney cb9884de63 style docs: clarify expect/unwrap OK for tests 2023-09-14 13:54:11 +00:00
Daniel McCarney 87d3e0ceae style docs: advice on numeric literals 2023-09-14 13:54:11 +00:00
Daniel McCarney a5329212fe style docs: active verbs for enum variants 2023-09-14 13:54:11 +00:00
Daniel McCarney e3c8b0efc3 style docs: alphabetize enum variants 2023-09-14 13:54:11 +00:00
Daniel McCarney d97973a572 style docs: avoid type aliases 2023-09-14 13:54:11 +00:00
Daniel McCarney 1d3f066081 style docs: use `impl` where possible 2023-09-14 13:54:11 +00:00
Daniel McCarney 014cfdc36f style docs: don't elide lifetimes 2023-09-14 13:54:11 +00:00
Daniel McCarney 0d0cf38d89 style docs: "parse, don't validate" style 2023-09-14 13:54:11 +00:00
Daniel McCarney bcedd9d26a style docs: avoid ref in match 2023-09-14 13:54:11 +00:00
Daniel McCarney 22fab108e4 style docs: note about hoisting expression commonality 2023-09-14 13:54:11 +00:00
Daniel McCarney 8698e093a4 style docs: add note about avoiding qualified types 2023-09-14 13:54:11 +00:00
Daniel McCarney fe4d029e1a style docs: add note to prefer expanding acronyms 2023-09-14 13:54:11 +00:00
Daniel McCarney 8f582862fe style docs: add free-standing function note 2023-09-14 13:54:11 +00:00
Daniel McCarney 87f1a69aa7 docs: update CONTRIBUTING security policy
The existing text has fallen out of sync with `SECURITY.md` and
recommends sending security issues through regular GitHub issue, or
email to Ctz.

This commit updates the text to match what's in the up-to-date
`SECURITY.md`: use the GitHub security advisory tooling. That's what
it's made for.
2023-09-14 13:54:11 +00:00
Dirkjan Ochtman 91709e6c30 Add a style guide 2023-09-14 13:54:11 +00:00
Dirkjan Ochtman ee33acfcd0 Tweak formatting for provider-example Cargo manifest 2023-09-14 13:22:08 +00:00
Dirkjan Ochtman e3c3ed5c8f More consistently use modules for unit tests 2023-09-14 13:22:08 +00:00
Joseph Birr-Pixton 5a1b369080 icount-bench: apt update before relying on index 2023-09-14 09:52:32 +00:00
Dirkjan Ochtman 64f36a79dd Fix pki-types dependency 2023-09-14 09:44:52 +00:00
Joseph Birr-Pixton a1950e84cf Add demonstration of custom crypto
This is an example that builds a mostly-unchanged rustls example
(simpleclient), but only using crypto from the rust-crypto project
and elsewhere.

This is intended to be minimalistic, and not a complete replacement
for *ring*.

It implements:

- TLS1.3 TLS13_CHACHA20_POLY1305_SHA256 cipher suite.
- TLS1.2 TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 cipher suite.
- X25519 key exchange.
- RSA-PSS-SHA256 and RSA-PKCS1-SHA256 signature verification for
  verifying the server, integrated into the webpki crate.
- random generation using `rand_core`.

This means it can fetch www.rust-lang.org.

TLS1.2 is not strictly necessary for this server, but serves to
demonstrate that part of the API.
2023-09-13 15:32:29 +00:00
Joseph Birr-Pixton 6c55ca81a8 crypto::Iv::copy: allow use outside crate 2023-09-13 15:32:29 +00:00
Joseph Birr-Pixton f6f7df55c9 OpaqueMessage: privatize payload type
This removes a further need for `Payload` to be understood outside
this crate.  `payload()` allows immutable access as a slice,
`payload_mut()` allows mutable access to the underlying vec (such
as needed to decrypt the message without a copy).
2023-09-13 15:32:29 +00:00
Joseph Birr-Pixton 49f071b775 OpaqueMessage: allow construction without exposing `Payload` 2023-09-13 15:32:29 +00:00
Joseph Birr-Pixton 521758a957 Allow control of which `pki_types::SignatureVerificationAlgorithm`s are used
The prior arrangements are still available (and the default), if the
crate is built with the *ring* feature.

`WebPkiSupportedAlgorithms` is a new structure (designed for static
construction, and direct use in webpki calls) that links
`pki_types::SignatureVerificationAlgorithm`s to their corresponding TLS `SignatureScheme`.
This replaces the hardcoded mappings in `fn convert_scheme` etc.
2023-09-13 15:32:29 +00:00
Joseph Birr-Pixton b145054882 Make *ring* an optional dependency
Using the crate without this feature means something external
needs to provide all the cryptography, and (eg) convenient integrated
key loading APIs disappear.
2023-09-13 15:32:29 +00:00
Joseph Birr-Pixton 310738e031 Remove ring use in handshake_test.rs 2023-09-13 15:32:29 +00:00
Joseph Birr-Pixton 18442cbd15 Move ring-backed signature keys to crypto::ring 2023-09-13 15:32:29 +00:00
Joseph Birr-Pixton 8f2f34e913 Move crate::sign to crate::crypto::signer 2023-09-13 15:32:29 +00:00
Joseph Birr-Pixton 3fc1c93240 LengthPrefixedBuffer: use maximal dummy length
This is just for extreme paranoia and isn't fixing an extant issue.

It is safer to have a length prefix that is too large, so that an
accidental read of the buffer prior to the length being fixed cannot
be interpreted as an empty structure followed by something else.

eg, a `ClientExtension` (type 0x12 0x23) in this situation with body [0xff, 0x01, 0x00, 0x00]
with a zero dummy length would end up encoded as:

  0x12 0x23 0x00 0x00 0xff 0x01 0x00 0x00

Which decodes as two extensions (one empty, one RenegotiationInfo).  That would be bad.
Using maximal lengths:

  0x12 0x23 0xff 0xff 0xff 0x01 0x00 0x00

This cannot be decoded, and prevents the body from being interpreted as
something else.
2023-09-13 14:15:12 +00:00
Joseph Birr-Pixton 2014ab9bee Reuse nested length encoder
This avoids many small, short-lived allocations and copying during
message encoding.
2023-09-13 14:15:12 +00:00
Joseph Birr-Pixton 6e2842f747 Extract nested length code for reuse 2023-09-13 14:15:12 +00:00
Dirkjan Ochtman 1b33f8d46c Switch to using pki_types::UnixTime 2023-09-13 13:14:41 +00:00
tottoto b57204daab feat: impl Error for ClientCertVerifierBuilderError 2023-09-11 13:52:32 +00:00
Dirkjan Ochtman 53e9e77424 Implement Extend for RootCertStore instead of using a custom method 2023-09-11 13:38:42 +00:00
Dirkjan Ochtman e2e7a7c091 Remove TrustAnchorWithDn type 2023-09-11 13:38:42 +00:00
Dirkjan Ochtman eef89ca9ce Remove subject() accessor from TrustAnchorWithDn type 2023-09-11 13:38:42 +00:00
Dirkjan Ochtman f0d587e705 Move DistinguishedName wrapping into DistinguishedName method 2023-09-11 13:38:42 +00:00
Dirkjan Ochtman b253c10348 Add abstraction for MockClientVerifier construction 2023-09-11 13:38:42 +00:00
Dirkjan Ochtman b08776c84d Add StreamOwned::into_parts() API 2023-09-11 10:56:24 +00:00
Joseph Birr-Pixton 237ba876bc ci-bench: reduce noise in cg_diff output
The diffs produced tend to be noisy here because two separate
compilations have different per-type and per-compilation uniqueness. eg:

```
 29,792 (124.8%)  ???:_ZN5alloc7raw_vec11finish_grow17h463b2c6f0ba30854E.llvm.2614985587368234107
-29,792 (-124.8%)  ???:_ZN5alloc7raw_vec11finish_grow17h463b2c6f0ba30854E.llvm.3375118279659775674
```

This diff line is here because some per-compilation unique value (after the '.llvm.') changed, not
because the instruction count changed.

We can chop these out by giving a regular expression to cg_diff.
2023-09-11 08:21:28 +00:00
dependabot[bot] 1770e1e455 build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 05:31:12 +00:00
Dirkjan Ochtman 384dd1c3fa Bump version to alpha.2 2023-09-08 08:41:28 +00:00
Joseph Birr-Pixton c21eca793b Take latest webpki, pki-types, pemfile, webpki-roots 2023-09-07 15:46:48 +00:00
Jacob Hoffman-Andrews 3087811ec7 doc: link ResolvesServerCert to Acceptor
Previously, looking at ResolvesServerCert, it was not clear that there
was an async version available.
2023-09-07 13:17:13 +00:00
Dirkjan Ochtman e36559c193 Bump version to 0.22.0-alpha.1 2023-09-06 14:38:25 +00:00
Adolfo Ochagavía 490108e6c5 Show valgrind version in CI job 2023-09-06 08:40:39 +00:00
Adolfo Ochagavía 5b98394a61 Fix: create cg_diff tmp file at the cwd 2023-09-06 08:40:39 +00:00