Commit Graph

96 Commits

Author SHA1 Message Date
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
Andrew Bennett 61704e0b81 Marking other Ed25519 related bogo tests accordingly. 2020-06-20 16:35:09 +01:00
Kim Altintop c86e16e704 Disable Basic-Server-Ed25519 bogo test case
Expected to succeed against TLS1.2, which it won't
2020-06-20 16:35:09 +01:00
Kim Altintop ffcb65a656 Tickle build
All azure build logs are gone
2020-06-20 14:42:39 +01:00
Andrew Bennett c6346e24de Add initial support for Ed25519 2020-06-20 14:40:31 +01:00
Joseph Birr-Pixton 339923fc53 Get new bogo version working 2020-04-12 11:34:22 +01:00
Joseph Birr-Pixton 278009aa58 Take newer bogo for go1.14
Another minor go version, another set of breakage.
2020-04-12 11:34:22 +01:00
Joseph Birr-Pixton 4da973d8c9 Patch bogo to fix golang 1.13 breakage
Taking upstream patches to fix this in a different way requires 1.13,
which isn't available on travis or azure.
2019-12-30 18:03:32 +00:00
Joseph Birr-Pixton 40bd3d1aa8 Fix bogo tests:
- disable SHA1 invalid signature tests
- test for golang sending an internal error alert when
  we don't offer its selected signature algorithm
- also look for 'no common signature algorithms' in SHA1 tests
2019-01-27 18:39:19 +00:00
Kyle Huey dc9fc45844 Change test failure to note handshake failure now that SHA-1 is unsupported. 2019-01-26 20:11:30 -08:00
Joseph Birr-Pixton 0124afea77 bogo: Entry in TestErrorMap denotes expected failure 2019-01-20 12:12:20 +00:00
Brian Smith 47486717b1 Adjust BoGo configuration to account for SHA-1 not being supported. 2019-01-19 19:12:44 +00:00
Joseph Birr-Pixton 261ce07131 Parallelise bogo runs 2019-01-13 19:15:46 +00:00
Joseph Birr-Pixton 181765111c Disable QUICTransportParams bogo tests
This isn't really compatible with how QUIC works now.
2019-01-13 19:12:54 +00:00
Benjamin Saunders d766c4d8b6 QUIC handshake I/O and crypto 2019-01-13 16:36:55 +00:00
Joseph Birr-Pixton b838ec0c4e Track bogo additional tests/changes 2018-09-16 23:57:39 +01:00
Joseph Birr-Pixton d32805d151 Move to a mainline bogo supporting TLS1.3 2018-09-16 23:57:39 +01:00
Joseph Birr-Pixton cca1f321b8 fiddle with bogo 2018-09-16 23:57:39 +01:00
Joseph Birr-Pixton 5563722f56 Correct bogo TLS1.3 variant selection 2018-08-11 09:04:25 +01:00
Yiming Jing 3ef32a23d2 Add bogo tests for TLS 1.3 0-RTT 2018-07-31 20:23:17 +01:00
Joseph Birr-Pixton 20f16668db Make bogo only test for draft 28 2018-07-29 18:59:05 +01:00
Joseph Birr-Pixton 012e841739 Update bogo config for new draft 2018-07-29 10:33:41 +01:00
Joseph Birr-Pixton 5fb0c6b5ee Update bogo for draft-28 support 2018-07-29 10:32:23 +01:00
Joseph Birr-Pixton 5a4d3d7827 Extend bogo testing of signature algorithms 2018-06-02 15:54:22 +01:00
Joseph Birr-Pixton 3912f0b701 Enable ECDSA bogo tests 2018-06-01 23:45:06 +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
Joseph Birr-Pixton 32eeec61d3 Update bogo config 2018-04-01 16:02:00 +01:00
Joseph Birr-Pixton e5a9e395ba Take new bogo 2018-03-31 18:12:36 +01:00