Commit Graph

123 Commits

Author SHA1 Message Date
Joseph Birr-Pixton ce3d12a933 Replace manual feature computations with python script
Inspired by actix/actix-net's justfile.
2024-05-21 07:16:33 +00:00
Dirkjan Ochtman f214df9826 bogo: fix config rewriting when cpp is clang 2024-05-15 13:04:58 +00:00
Joe Birr-Pixton cf098b08d3 Cargo.toml: disentangle std/aws_lc_rs features 2024-02-28 20:27:34 +00:00
Joseph Birr-Pixton 432ceca9b8 Partially support -verify-prefs
This exits with BOGO_NACK if an unsupported verification algorithm is
requested.  That is enough to enable 78 more test cases.
2024-01-10 15:59:34 +00:00
Joseph Birr-Pixton 235008b8d5 Take newer bogo version
- implement -shim-id option
- ignore -ipv6 option
- track name change on ALPS test
2024-01-10 15:59:34 +00:00
Joseph Birr-Pixton da14317122 Test P521-SHA512 in bogo
This makes it possible for our bogo config.json to vary
between providers.  That is achieved by -- with my sincere apologies --
applying the C preprocessor.
2024-01-04 09:21:59 +00:00
Jacob Hoffman-Andrews db64448ddd Doc: replace "nb." with "Note:"
"nota bene" (mark well) is jargon that we don't need.
2023-11-22 14:14:37 +00:00
Joseph Birr-Pixton c8c46bea4d Run bogo against both ring and aws-lc-rs providers 2023-11-21 09:58:03 +00:00
Joseph Birr-Pixton 538cb78f83 Abolish quic crate feature
This reveals that bogo_shim fails to build for `--no-default-features --features tls12`.
Feature gate the entire program on `ring | aws-lc-rs`.
2023-11-17 19:27:21 +00:00
Joseph Birr-Pixton 1379f12657 Enable testing and benchmarking with aws-lc-rs 2023-11-09 16:18:11 +00:00
Daniel McCarney 5fd434f7bd proj: remove dangerous_configuration feature
In an effort to reduce our feature list, this commit replaces the
`dangerous_configuration` feature flag with separate `danger` modules.

Cargo features are additive, which means transitive dependencies could
enable them for you without explicit opt-in. Using obviously named
modules will maintain the property that it's easy to grep for imports,
but avoids feature flag bloat and the additive downsides.

After discussion we've chosen to not include the webpki verifier and
helper functions as part of the dangerous API surface. Functionality for
setting a custom verifier, or implementing one to make assertions about
verification status, remain marked as dangerous via their module name.
2023-09-19 17:53:52 +00:00
Joseph Birr-Pixton 1d659a4689 Revert "Revert "Remove support for SCT stapling""
This reverts commit 777cc07a4b.
2023-07-07 15:20:54 +01:00
Joseph Birr-Pixton 777cc07a4b Revert "Remove support for SCT stapling"
This reverts commit 4f0a7e0426.
2023-07-05 15:47:52 +01:00
Joseph Birr-Pixton 4f0a7e0426 Remove support for SCT stapling 2023-06-29 15:50:02 +01:00
Daniel McCarney 1a149d8522
docs: add help for diagnosing BoGo failures. (#1316)
This commit adds some quick helpful diagnostic tips for the BoGo test
suite based on our experience updating the tests.
2023-06-13 10:51:56 -04:00
Joseph Birr-Pixton bf54fc6c77 bogo: set correct error expectation for RSA/MD5 tests 2023-06-13 11:56:15 +01:00
Joseph Birr-Pixton fd23467086 bogo: track naming changes for long sessionid tests 2023-06-13 11:56:15 +01:00
Joseph Birr-Pixton 794e61c8ed bogo: skip kyber-specific tests 2023-06-13 11:56:15 +01:00
Joseph Birr-Pixton 54c87bf096 bogo: track changing ECH test names 2023-06-13 11:56:15 +01:00
Joseph Birr-Pixton 994064e2e3 bogo: Fix TLS-ECH-Client-UnsolictedHRRExtension 2023-06-13 11:56:15 +01:00
Joseph Birr-Pixton 3c4cc211aa bogo: reject -allow-hint-mismatch
This is a BoringSSL-specific feature that micro-optimises private
key usage when the key is behind an RPC.
2023-06-13 11:56:15 +01:00
Joseph Birr-Pixton 30f95d53e8 Target updated boringssl test suite 2023-06-13 11:56:15 +01:00
zkonge 006d646e30 use HandshakeFailure by default in verification
Verification error is not always raised by bad certificate, especially
in user provided verifier. For example, they may raise HSM connection
error or dynamic certificate resolve error.

All of them is not about bad certificate. So send BadCertificateAlert is
not appropriate.
2023-03-11 09:23:46 +01:00
Daniel McCarney 1ee4a2ba92 chore: set initial branch name for bogo checkout.
Prior to this commit the `fetch-and-build` script with newer `git`
versions would spit out an ANSI coloured warning about choosing an
initial branch name for the bogo test-suite checkout.

This commit simply specifies the `--initial-branch` to be `main` to
silence the unnecessary output.
2023-03-02 10:28:10 +01:00
Daniel McCarney 44bac99c6e fix: avoid hardcoded (ba)sh path in helper scripts.
Prior to this commit some helper scripts used hardcoded paths to
`/bin/sh` and `/bin/bash` in script shebangs. This will error on systems
that don't place `bash` in `/bin/` (e.g. NixOS).

This commit updates the scripts to use `/usr/bin/env` to find `bash`
based on the user's `$PATH`. This has better portability and allows the
scripts to run without err (or specifying an interpreter explicitly) on
systems with atypical `bash` installs.
2023-03-02 10:28:10 +01:00
Joseph Birr-Pixton a1ee6d28ac Rework certificate errors
rustls now has its own `CertificateError` type that aims to cover
most common errors with certificate validation.
2023-01-25 12:24:25 +00:00
Dirkjan Ochtman 1acd7a7139 deframer: join handshake messages in deframer buffer 2023-01-17 21:17:13 +01:00
Jacob Rothstein cba4d0c0f6 add a README for BoGo 2023-01-12 10:22:37 +01:00
Joseph Birr-Pixton a80da9967b Test 0-RTT
This has some api tests, but mainly enables bogo tests.

In passing, ensure TLS1.3 NewSessionTicket checks for duplicated
extensions.
2022-01-15 12:12:16 +00:00
Joseph Birr-Pixton 6a15dd10bf Revert "Try running suggested commands"
This reverts commit 9407ada72f.
2021-09-19 18:38:29 +01:00
Gábor Lipták 71b232b99e Correct bogo checkout
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2021-09-19 18:38:15 +01:00
Joseph Birr-Pixton 9407ada72f Try running suggested commands 2021-09-18 13:16:36 +01:00
Dirkjan Ochtman 40be10365b bogo: deduplicate bogo configuration items 2021-09-12 17:45:15 +02:00
Brian Smith 53486225c5 TLS 1.2: Change expected result for InvalidECDHPoint-Server to match TLS 1.3 2021-04-17 10:35:31 +01:00
Brian Smith 5fc6a6c4e1 Change expected result for compressed points in TLS 1.2 to match TLS 1.3 2021-04-17 10:35:31 +01:00
Joseph Birr-Pixton b65b466f6c Fix coverage measurements
Bogo tests were being excluded, since 035178d3.
2021-04-09 11:02:24 +01:00
Joseph Birr-Pixton 035178d3a5 Always `cargo build` bogo shim 2021-04-06 12:55:21 +01:00
Dirkjan Ochtman 8eaabb652b bogo: pass on any extra arguments
In particular, passing `-test` can be used to only run particular test cases.
2021-04-01 19:59:33 +01:00
Joseph Birr-Pixton 76ea9f44a9 Add overall bogo timeout 2021-03-21 10:45:44 +00:00
Dirkjan Ochtman 0bbe35064f Make bogo setup scripts more robust 2021-03-16 18:48:04 +00:00
Joseph Birr-Pixton 88d3776511 Hook curve selection into bogo_shim 2021-02-21 19:12:41 +00:00
Joseph Birr-Pixton 34c440b5d2 Refactor key exchange code
Builds on the previous commit, and prepares for the ability to discard
unused key exchange algorithms at link-time.

This varies some server error handling -- the precise errors aren't
specified by the standard.
2021-02-21 19:12:41 +00:00
Brian Smith 8dffd2a7e2 Client: Always randomize session ID unless doing legacy resumption.
This fixes the TLS13SessionID-TLS13 Bogo test, so enable it.

Inline `random_sessionid_for_ticket` into its caller so all the
session ID calculation is in one spot.
2021-02-19 16:08:10 +01:00
Joseph Birr-Pixton 701abc8689 Accommodate bogo changes
This leaves TLS13SessionID-TLS13 unfixed; to be fixed separately.
2021-02-06 20:49:16 +00:00
Joseph Birr-Pixton 8b682364de Let's use git for managing changes to upstream boringssl
Instead of storing a bunch of patches and applying them
manually.  Now we can just do git rebase to take newer
upstream.
2021-02-06 20:49:16 +00:00
Brian Smith e35305b2c1 Get Bogo test working on M1 ("Apple Silicon") macOS Big Sur.
Fix the "build bogo_shim if it doesn't exist" logic; it was broken even
on Linux as newer versions of Rust don't allow `--features` to be used
at workspace level.

I had to bootstrap Go on a Linux machine using the procedure at
https://github.com/golang/go/issues/42684#issuecomment-731821237:
```
git clone https://go.googlesource.com/go
cd go
git fetch https://go.googlesource.com/go refs/changes/58/272258/1 && git checkout FETCH_HEAD
cd src
GOOS=darwin GOARCH=arm64 ./bootstrap.bash
```

This version of Go required me to have a go.mod file. Change the way Bogo is
downloaded from BoringSSL's repo to get this to work. The script now uses a
sparse checkout with depth 1, which seems pretty fast. In particular, avoid
`wget` since my Mac doesn't have `wget` available.

Remove two of the patches to Bogo that seem to not be necessary if using a
newer version of Go. Patch the remaining patch to work with the new directory
structure.

I verified that ./runme runs the tests and spits out "PASS" at the end on both macOS
and Linux.
2020-12-05 09:38:54 +00:00
Joseph Birr-Pixton e51bf92afc Fix DoS vulnerability in TLS1.3 middlebox CCS handling
This affects TLS1.3 client and server sessions.  It does not
affect TLS1.2 sessions.

Discussion
==========

RFC8446 says of the "Middlebox Compatibility Mode" feature:

  Either side can send change_cipher_spec at any time during
  the handshake, as they must be ignored by the peer

This unnecessary flexibility meant we can't weave an
optional receipt of a CCS into our state machine (like we did for TLS1.2),
so we just drop CCS messages received after negotiating TLS1.3.

That's a problem, though: CCS messages are 6 bytes long, and many
can be delivered in a single TCP segment.  Each one results in a
small but non-zero amount of processing.

However, this code path is fast: in benchmarks rustls can drop ~4 million
CCSs per second, per core.  In the PoC code graciously provided by the
reporter, ~168Mbps of traffic needs to pass over lo to saturate a single
CPU core (you'll note these measurements agree with each other, to an order
of magnitude).

It's really likely that a better overall DoS vector is *just sending ClientHellos*,
where each core can only process ~thousands per second, for the cost of ~200 bytes;
ie 250Kbps (as an order of magnitude) to saturate one core.  This is especially
powerful if TFO is supported by both hosts.  But it's also more noisy.

So while this vulnerability is not thought to be serious, we can fix it
at negligible cost: only allow a maximum of one CCS per TLS1.3 handshake.

Thanks to Lenny Wang of Tencent Security Xuanwu Lab for the report.
2020-08-16 17:24:26 +01:00
Joseph Birr-Pixton 5340325772 Enable ed25519 for TLS1.2
This is actually specified for use, in RFC8422
2020-06-21 11:06:56 +01:00
Joseph Birr-Pixton b6594914a8 Fix remaining bogo tests 2020-06-20 16:35:09 +01:00
Andrew Bennett 46561ffe1f Disable Ed25519DefaultDisable-NoAccept and Ed25519DefaultDisable-NoAdvertise bogo tests. 2020-06-20 16:35:09 +01:00