Commit Graph
49 Commits
Author SHA1 Message Date
Daniel McCarney 18f42bba16 fuzz: fix unused Result clippy finding.
```
warning: unused `std::result::Result` that must be used
  --> fuzzers/persist.rs:14:5
   |
14 |     T::read(&mut rdr);
   |     ^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: this `Result` may be an `Err` variant, which should be handled
```
2023-03-20 16:08:55 +01:00
Daniel McCarney ca5725747a fuzz: cargo fmt updates 2023-03-20 16:08:55 +01:00
Daniel McCarney da19f2b069 docs: add small README for fuzz testing suite.
This commit adds a README to the `fuzz` subdirectory of the project
root. The README has a few small pointers to help a developer get
started running the fuzz tests locally, and a link to the upstream
cargo-fuzz docs for more information.
2023-03-03 19:08:13 +01:00
Joseph Birr-Pixton 4ad8b1f432 fuzzer client/server: process packets 2023-01-27 11:19:29 +00:00
Joseph Birr-Pixton eb191d0cc4 Remove opaque StoresClientSessions interface 2023-01-24 13:53:34 +00:00
Dirkjan Ochtman 1acd7a7139 deframer: join handshake messages in deframer buffer 2023-01-17 21:17:13 +01:00
Dirkjan Ochtman c3a84dedae deframer: derive Default implementation 2023-01-17 21:17:13 +01:00
Dirkjan Ochtman 6555b9f630 deframer: move decryption into deframer 2023-01-17 21:17:13 +01:00
Dirkjan Ochtman 6e6baa91e7 Upgrade to 2021 edition 2023-01-13 12:11:26 +01:00
Dirkjan Ochtman 9e657be6b9 hsjoiner: simplify awkward message type checking API 2023-01-05 08:41:51 +01:00
Dirkjan Ochtman 279f88fb26 hsjoiner: lazily parse messages from the handshake joiner 2023-01-05 08:41:51 +01:00
Dirkjan Ochtman 3356e3c705 hsjoiner: abstract over implementation details 2023-01-05 08:41:51 +01:00
Dirkjan Ochtman dbbb4eafc0 hsjoiner: clarify the return type for take_message() 2023-01-05 08:41:51 +01:00
Dirkjan Ochtman 54354c66ab deframer: abstract over internal state 2022-10-23 10:58:48 +02:00
Jacob Hoffman-Andrews a94a0055e1 MessageFragmenter: return an iterator (#1050)
This avoids a couple of unnecessary allocations: the individual Payloads of the
fragmented messages were allocating and filling a Vec, and the call sites were
allocating a VecDeque to be filled with messages.

Instead, always return an iterator of BorrowedPlainMessage, which the caller can
iterate over.
2022-06-13 10:30:45 +02:00
Jacob Hoffman-Andrews dde28baec1 Replace MessageFragmenter::new with impl Default
Previously there were two paths that would check that a max_fragment_size was in
the acceptable range. Now there's just one path: calling set_max_fragment_size.

This provides a way to construct a MessageFragmenter with the default fragment
size that is error-free.
2022-05-30 10:20:36 +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
Joseph Birr-Pixton de205650f7 Fix persistence fuzz targets 2021-11-14 10:24:06 +00:00
Dirkjan Ochtman 42e624bbe2 Keep Certificate Transparency support implicitly off by default 2021-09-20 22:39:23 +02:00
Dirkjan Ochtman 74d9c5641b fuzz: remove unused imports 2021-09-18 20:48:39 +02:00
Dirkjan Ochtman 8081a3462f Configure certificate transparency logs in a separate step 2021-09-18 20:48:39 +02:00
Dirkjan Ochtman 2f90c1bf73 client: split client session values to separate version-specific fields
This should make it more obvious what functionality is used by what
version, making it harder for sentinel/default values to get misused.
2021-09-18 13:56:12 +02:00
Dirkjan Ochtman 0b9f046c51 server: move most server-related items into public server module 2021-07-31 14:23:36 +02:00
Dirkjan Ochtman 14080c6d4f builder: use config types as entry points 2021-07-04 09:27:45 +01:00
Joseph Birr-Pixton 3a07576382 Bake client/server choice into config_builder_with_safe_defaults
Making this server_config_with_safe_defaults or
client_config_with_safe_defaults, and removing an unreachable
unwrap for callers of this.
2021-06-27 19:34:21 +01:00
Jacob Hoffman-Andrews dd63c376af Fix fuzzers. 2021-06-27 17:38:12 +01:00
Dirkjan Ochtman efb07e451e Conceptually split PlainMessage out of OpaqueMessage
Following feedback in #667, further clean up the semantic message
types by distinguishing messages with opaque (potentially encrypted)
payloads and messages with plaintext payloads.

This will also help with borrowing, because OpaqueMessages will
want to mutably borrow their payloads in order to be able to
decrypt them, we can borrow a PlainMessage's payloads immutably.
2021-06-02 20:06:08 +01:00
Joseph Birr-Pixton 3defb7e46d Have a type for the client's name for the server 2021-05-30 11:21:41 +01:00
RS 228eada031 Fix fuzzer typo. 2021-05-16 21:36:52 +01:00
Joseph Birr-Pixton fa580b469f Stop misusing "MTU" terminology
Instead, let the user configure the max TLS fragment size directly.

Report errors from ServerConnection::new like ClientConnection::new, so we
can report out of range fragment sizes.
2021-05-16 11:17:32 +01:00
Brian Smith e83159d68d Client: Avoid Arc::clone() on the configuration.
Avoid introducing any memory barrier through the cloning of the configuration
by avoiding the cloning.

Especially if the user doesn't need to use the config more more than one
connection, the internal clone is wasteful.
2021-05-14 20:54:43 +02:00
Brian Smith ad6d7acb61 Server: Avoid Arc::clone() on the configuration.
Avoid introducing any memory barrier through the cloning of the configuration
by avoiding the cloning.

Especially if the user doesn't need to use the config more more than one
connection, the internal clone is wasteful.
2021-05-14 20:54:43 +02:00
Joseph Birr-Pixton f87a8483c1 Unify builder interface for config items parts 2021-05-08 17:37:53 +01:00
Joseph Birr-Pixton a6909b578a Improved builder-type API for making ServerConfigs 2021-05-08 17:37:53 +01:00
Dirkjan Ochtman 3a2b0587f1 message: simplify error path for payload decoding
It looks like the error I'd previously observed from bogo was unrelated,
so we can make the error handling much simpler and robust.
2021-04-25 10:59:19 +01:00
Dirkjan Ochtman 569925db71 message: replace Codec impl for OpaqueMessage with encode() method 2021-04-25 10:59:19 +01:00
Dirkjan Ochtman 32a83ae242 message: replace into_opaque() with From impl 2021-04-25 10:59:19 +01:00
Dirkjan Ochtman c4ed05d033 message: split OpaqueMessage state out as a separate type 2021-04-25 10:59:19 +01:00
Robert Sayre 854c5c4a30 Invalid SessionID in ServerHelloPayload. 2021-04-15 10:12:54 +02:00
Joseph Birr-Pixton c1935e807b Also update fuzzer webpki version 2021-04-10 19:15:07 +01: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
Joseph Birr-Pixton 9ee16c4c59 Rename ServerSession -> ServerConnection
Similarly, Session and ClientSession.

Leave deprecated aliases.  Unfortunately "trait aliases" are unstable,
so we can't leave one of these.
2021-04-09 11:30:39 +01:00
Joseph Birr-Pixton 87caac07d4 Use cargo-fuzz to find un-roundtripable messages 2021-04-01 16:16:35 +01:00
Joseph Birr-Pixton b17192ed5d Fix fuzz/fuzzer/client.rs
This was broken by ClientSession::new() being fallible, and
also the ClientConfig::new() signature change.
2021-03-20 11:33:33 +00:00
Brian Smith 596c68d50a Require *ring* 0.16.19 and webpki 0.21.4.
*ring* 0.16.19 contains a workaround for an ARM CPU bug, sourced from
BoringSSL.
2020-12-05 09:37:09 +00:00
Joseph Birr-Pixton d6176ed6ac Update fuzz targets
Prepare to run them in CI
2020-06-14 11:14:40 +01:00
Joseph Birr-Pixton f07f8b135d Refactor deframer to hopefully improve clarity
There were some unwraps here that we can get rid of if we unduplicate
the work Message::read already does.  That goes in Message::read_with_detailed_error.

Delete a fuzz corpus file that was actually wrong, but allowed by Message::read's
previous lax semantics.
2020-05-16 18:26:02 +01:00
Brian Smith 8e3d87dc8d Take the DNS hostname as a webpki::DNSNameRef in ClientSession.
Make it clear that the name passed into ClientSession is a DNS name
and cannot be empty (""), an IP address, an internationalized domain
name, etc. It has to be a DNS hostname because it is put into the SNI
extension in the client hello.
2017-09-01 16:47:52 -10:00
Joseph Birr-Pixton ffba1587fa Add cargo-fuzz support
This has some captured starting points for TLS messages and
some traffic transcripts.
2017-05-09 00:12:42 +01:00