Commit Graph

107 Commits

Author SHA1 Message Date
Dirkjan Ochtman 992e2364a0 Make connect-tests part of the workspace 2023-10-02 13:24:31 +00:00
Daniel McCarney f141da4a2e Cargo: remove rcgen git patch
The `rcgen` crate has cut a 0.11.2 release that includes the CRL
functionality we were using a Cargo patch to depend on previously. This
commit removes the patch, fixes one breakage in the server acceptor
example, and updates the `Cargo.toml` and `Cargo.lock` files.
2023-09-27 14:36:11 +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
Adolfo Ochagavía 676df24f53 Implement CPU instruction benchmarks 2023-08-30 08:04:00 +00:00
Joseph Birr-Pixton f65b11658e Pin specific rcgen commit 2023-08-22 12:32:34 +00:00
Daniel McCarney 6bdaf04e7a examples: add server_acceptor example.
This example has two main purposes:

1. It shows how to use the `Acceptor` API to customize a `ServerConfig`
   per-connection, possibly using information from the received
   `ClientHello`.
2. It shows how to load CRL information per-connection to ensure the
   freshest CRL content is used when validating client certificate
   revocation status.

Additionally this example uses `rcgen` to generate its own test PKI,
potentially being a helpful reference for folks that want to do similar
without needing to manually construct certs with `openssl`.

To simulate CRL updates this example program spawns a background thread
that periodically replaces the CRL content, flipping back and forth
between a CRL that lists the client certificate as revoked, and a CRL
that has no revoked certificates.

Using `tlsclient-mio` (or another TLS client program) with the generated
client certificate/key you can observe the CRL updates happening by
connecting to the server, waiting a little bit, and then connecting
again. The result will differ based on the CRL update:

```
$ cargo run --bin tlsclient-mio -- --auth-certs ./client-cert.pem --auth-key ./client-key.pem --cafile ca-cert.pem --port 4443 --http localhost
TLS error: AlertReceived(CertificateRevoked)
Connection closed

<waiting>

$ cargo run --bin tlsclient-mio -- --auth-certs ./client-cert.pem --auth-key ./client-key.pem --cafile ca-cert.pem --port 4443 --http localhost
EOF
Connection closed
```
2023-08-16 16:30:06 +00:00
Josh Aas efe3aab3b5 List members in alphabetical order. 2022-09-05 12:10:08 +02:00
Josh Aas aad3a5805d Rename rustls-mio to examples. 2022-09-05 12:10:08 +02:00
Brian Smith 9159a82c33 Use the new feature resolver (`resolver = "2"`).
Use the new feature resolver stablized in Rust 1.51.0 to improve how
features are handled.
2022-01-14 00:28:46 +01:00
Brian Smith d367912ff8 Remove unintended webpki-roots patch from Cargo.toml.
This patch was part of the WIP PR but wasn't intended to be part of the
merged commit.
2021-04-11 07:53:35 +02:00
Brian Smith cc73faba35 Upgrade to webpki 0.22.0.
webpki 0.22.0 has breaking API changes. The most notable change is the
renaming of some types to conform to Rust naming conventions, in support
of Rustls's recent similar effort.
2021-04-10 18:26:55 +01:00
Dirkjan Ochtman 9ceff5e988 Add fmt script to admin dir 2021-03-27 13:47:49 +00:00
Joseph Birr-Pixton 1d70e45af6 Move to using cargo workspaces
- rustls (the library) now lives in rustls/
- the mio examples/tests continue to live in rustls-mio, but
  are built by (eg) `cargo test` in the root of the repo.
2019-08-24 20:55:20 +01:00
Joseph Birr-Pixton 17ee52c5d1 0.16.0 2019-08-10 09:54:11 +01:00
Brian Smith 1d99471355 Improve encapsulation of key material during TLS 1.3 key schedule. 2019-08-04 20:05:49 +01:00
Brian Smith 01e623d464 Use *ring* 0.16.4 HKDF API. 2019-07-26 21:14:40 +01:00
Brian Smith a039467f00 Simplify key schedule. 2019-07-26 21:14:40 +01:00
Brian Smith 675ad27250 Update to *ring* 0.16.2 to improve sealing operations.
Restore the allocation/copying behavior to what it was before the
*ring* 0.16.0 upgrade.
2019-07-24 19:02:30 +01:00
Joseph Birr-Pixton f5c0ac7a12 Use new sct.rs, ct-logs and webpki-roots 2019-07-21 11:13:27 +01:00
Jasper Bryant-Greene 14b2126298 Updated for Ring 0.16 2019-07-20 09:48:01 +01:00
Joseph Birr-Pixton 65c41ee804 Move deps 2019-07-14 10:56:09 +01:00
Marc-Antoine Perennou cb43065914 fix minimal dependencies versions
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-05-27 18:20:39 +01:00
Joseph Birr-Pixton 16f9743a75 Benchmark for read_tls with polled nbio 2019-04-22 20:34:01 +01:00
Joseph Birr-Pixton cd66549efd Prepare 0.15.2 2019-04-02 20:44:10 +01:00
Joseph Birr-Pixton edf98927dc Split up mio-using examples/tests 2019-03-08 19:04:05 +00:00
Erick Tryzelaar b3a06b9a38 Migrate examples into a subcrate
Fuchsia doesn't support yet mio, and there is unfortunately no
way to run the rustls on Fuchsia as the crate is currently setup.
Unfortunately there is no way to make dev-dependencies optional (see
https://github.com/rust-lang/cargo/issues/1596), so this patch
migrates the examples into a subcrate so we can compile the
rustls tests without mio.
2019-03-08 17:06:05 +00:00
ctz 919e4284e3
Merge branch 'master' into logger 2019-03-08 16:47:34 +00:00
Erick Tryzelaar 6c7a10767c sort the dependencies 2019-03-08 16:46:26 +00:00
Erick Tryzelaar 3dd033fdf6 env_logger 0.6.1 replaced `.parse` with `.parse_filters`
env_logger 0.6.1 deprecated `Builder::parse`, and replaced it with
`Builder::parse_filter`.
2019-03-07 20:41:55 -08:00
Erick Tryzelaar 399ed16e29 Embed test-ca files into the test binaries
When cross compiling to operating systems like Fuchsia,
it's a little complicated to build the test binaries,
copy them and the test-ca files to the target, and make
sure that everything is executed with the correct working
directory. This PR makes it much easier to test rustls
by embedding the test-ca files directly into the test
binaries, which now can recreate a temporary test-ca directory
as needed. This allows us to just copy the executable over,
which really simplifies testing.
2019-03-01 21:04:23 +00:00
Joseph Birr-Pixton 158a1619b6 0.15.1 2019-01-29 08:35:49 +00:00
Joseph Birr-Pixton a15ff1197c Set edition 2018 2019-01-20 17:24:40 +00:00
Joseph Birr-Pixton bb272d89d6 Prepare for 0.15 2019-01-11 22:08:05 +00:00
Brian Smith f3a131995c Use *ring* 0.14, sct 0.5, webpki 0.19, and webpki-roots 0.16. 2019-01-11 21:29:09 +00:00
dependabot[bot] a973f50903 Update env_logger requirement from 0.5 to 0.6
Updates the requirements on [env_logger](https://github.com/sebasmagri/env_logger) to permit the latest version.
- [Release notes](https://github.com/sebasmagri/env_logger/releases)
- [Commits](https://github.com/sebasmagri/env_logger/commits/v0.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-21 19:51:57 +00:00
Joseph Birr-Pixton 3695715b57 Update base64 dependency to 0.10
0.10 has zero unsafe
2018-10-31 20:26:38 +00:00
Joseph Birr-Pixton f25cd86742 Prepare for 0.14.0 2018-09-30 17:42:31 +01:00
Yiming Jing 66131c1846 Add a simple example to test against Cloudflare's 0-rtt server implementation 2018-07-31 20:23:17 +01:00
Joseph Birr-Pixton 276426461a 0.13.0 2018-07-15 12:13:10 +01:00
Joseph Birr-Pixton c525993e86 Require untrusted 0.6.2 2018-06-27 20:27:44 +01:00
Joseph Birr-Pixton 320707f25a Update dependencies 2018-06-09 15:31:30 +01:00
Joseph Birr-Pixton 09a7f4ef22 Move to ring 0.13 alpha4 2018-06-01 22:34:10 +01:00
Joseph Birr-Pixton ae70e4a9e1 Add support for vectored IO
This is abstract: behind a trivial rustls-specific trait so it
can be tested and doesn't rely on implementation details of vecio.
2018-05-30 21:31:56 +01:00
Brian Smith b2da0902c2 Update *ring* and webpki dependencies.
*ring* 0.13.0 will be released soon. There have been *many* changes
between *ring* 0.13.0-alpha and 0.13.0-alpha2 so there will be a
pre-release testing period.
2018-05-23 20:55:26 +01:00
Joseph Birr-Pixton 87ab639360 Enable quic tests in bogo
- bogo_shim needs quic feature
- provide/check quic transport params in bogo_shim
- reject servers that handshake at TLS1.2, but include a quic transport
  params extension.
- don't expose quic transport params extension for TLS1.2 clients.

These last two match BoringSSL.
2018-05-14 21:00:17 +01:00
Dirkjan Ochtman 9808983de7 Create QUIC extension traits for ClientSession/ServerSession 2018-05-14 21:00:17 +01:00
Joseph Birr-Pixton ec36f1c1e1 prepare 0.12.0: update dependencies 2017-12-28 09:48:43 +00:00
Alex Gaynor f81b6ab00a
bump base64 dependency to 0.9 2017-12-21 12:08:52 -05:00
Alex Gaynor c91afaff67
bump base64 dependency to 0.8 2017-11-18 18:06:03 -05:00
Alex Gaynor 885c0d49ea bump base64 to 0.7 2017-09-22 21:45:56 -04:00