Commit Graph

726 Commits

Author SHA1 Message Date
Benjamin Saunders e9df8859ec Cosmetic cleanup 2018-12-15 11:29:58 -08:00
Benjamin Saunders 80a462eaa8 Constants for frame size minimum upper bounds
Only covers frames we've bothered to define a distinct type for, but can
be gracefully extended.
2018-12-15 11:29:58 -08:00
Benjamin Saunders a749b30b6c Correct CRYPTO frame fixed length upper bound
This wasn't accounting for the type byte.
2018-12-15 11:29:58 -08:00
Benjamin Saunders 308c156fc6 Test for reordering around key update 2018-12-15 10:48:13 -08:00
Benjamin Saunders 01c8669e73 Record and expose number of lost packets 2018-12-15 10:48:13 -08:00
Dirkjan Ochtman 3faca89e97 Hide Connection handshaking state behind API accessor 2018-12-13 09:51:24 +01:00
Dirkjan Ochtman e22daa3dd3 Remove Option wrapper for Connection::state 2018-12-13 09:51:24 +01:00
stammw 7bea88df94 Update keys before decoding packet number on KEY_PHASE toggle 2018-12-13 08:29:51 +01:00
stammw 43c973fd15 Use the correct label for updating traffic secrets 2018-12-13 08:29:51 +01:00
Dirkjan Ochtman 30bbeeb2e7 Privatize Connection fields where possible 2018-12-12 08:51:45 +01:00
Dirkjan Ochtman ce240b0d56 Move Connection getters into Connection type 2018-12-12 08:51:45 +01:00
Simon Werner f8ea9e74d9 Update example documentation in Readme
Make it clearer how to run the example across the network.  Supersedes PR #105.
2018-12-10 09:18:31 +01:00
Benjamin Saunders 6286698dd1 impl From<ConnectionError> for Event 2018-12-08 19:05:01 -08:00
Benjamin Saunders 62d78c6662 Reduce control flow indirection
This only served to perform deduplication, which can be done more simply
with future work in the Multiplexer implementation.
2018-12-08 19:05:01 -08:00
Benjamin Saunders 180538dac7 Abstract out Context
This decouples Connection from the implementation details of Endpoint.
2018-12-08 19:05:01 -08:00
Benjamin Saunders 3edef3a5e5 Store an Arc<Config> in Connection
This simplifies many Connection function signatures and reduces the size
of the interface between Endpoint and Connection, while opening the door
to per-connection tuning.
2018-12-08 19:05:01 -08:00
Benjamin Saunders 50d81da0b6 Fix travis nightly rustfmt 2018-12-08 18:18:21 -08:00
Benjamin Saunders 6a308bdbdd Style tweak 2018-12-08 02:41:08 -08:00
Benjamin Saunders 7ff1c37bd9 Don't move to Established on inauthentic packet 2018-12-08 02:41:08 -08:00
Benjamin Saunders d566b2fdb9 Deduplicate packets
A receiver MUST discard a newly unprotected packet unless it is certain
that it has not processed another packet with the same packet number
from the same packet number space. Duplicate suppression MUST happen
after removing packet protection for the reasons described in Section
9.3 of [QUIC-TLS].
2018-12-08 02:41:08 -08:00
Benjamin Saunders 8d72747b69 Factor out packet transmit operation 2018-12-08 02:41:08 -08:00
Benjamin Saunders 20d435fce5 Inline handshake_complete
Short function with only one caller.
2018-12-08 02:41:08 -08:00
Benjamin Saunders 43c187aaea Remove redundant argument 2018-12-08 02:41:08 -08:00
Benjamin Saunders 40770aaa46 Move flush_pending into Connection 2018-12-08 02:41:08 -08:00
Benjamin Saunders a4775b0761 Handle ACK_ECN frames 2018-12-08 02:41:08 -08:00
Benjamin Saunders f9134486f7 Handle RETIRE_CONNECTION_ID frames 2018-12-08 02:41:08 -08:00
Benjamin Saunders 020843282c Handle NEW_TOKEN frames 2018-12-08 02:41:08 -08:00
Dirkjan Ochtman 0daabd4d79 Take advantage of non-lexical lifetimes 2018-12-07 23:02:32 +01:00
Dirkjan Ochtman e555d11a43 Adopt 2018 idiom 2018-12-07 23:02:32 +01:00
Dirkjan Ochtman 4d6376c979 Convert to 2018 edition 2018-12-07 23:02:32 +01:00
Dirkjan Ochtman a45cf6db82 Upgrade to rustfmt 1.31.0 2018-12-07 23:02:32 +01:00
Cyril Plisko 7fc13ab0aa Fix incorrect assert!()
Fixes #108
2018-12-06 11:59:50 +01:00
Cyril Plisko c16c2136c0 clippy::range_plus_one 2018-12-05 11:04:59 +01:00
Cyril Plisko 208a1622bc clippy::collapsible_if 2018-12-05 11:04:59 +01:00
Cyril Plisko fa60d521be Introduce Side::is_client() and Side::is_server() 2018-12-05 11:04:59 +01:00
Cyril Plisko 7eeb53ecad Tiny style cleanup
Replace

::std::ops::...

with

use std::ops;
ops::...
2018-12-05 11:04:59 +01:00
Cyril Plisko 538154bc6d clippy::single_match 2018-12-05 11:04:59 +01:00
Cyril Plisko 80986de0a5 clippy::identical_conversion 2018-12-05 11:04:59 +01:00
Dirkjan Ochtman 0413e4d43a Fix code style as suggested by clippy 2018-12-05 11:04:59 +01:00
Benjamin Saunders a04d510563 Remove dead error cases
These should be left to rustls.
2018-11-30 11:07:14 -08:00
Benjamin Saunders 022dd4a0ca Update README section on test certificates 2018-11-30 11:07:14 -08:00
Benjamin Saunders ff7bc6e1bf High level API cosmetic/convenience improvements 2018-11-30 11:07:14 -08:00
Benjamin Saunders f4d55ed623 Move server-only configuration into its own struct 2018-11-30 11:07:14 -08:00
Benjamin Saunders dbd56cd387 Cleaner outgoing packet number accounting 2018-11-30 11:07:14 -08:00
Benjamin Saunders 37e08e293f Factor out common handshake transmit code 2018-11-30 11:07:14 -08:00
Benjamin Saunders d7478fde90 Implement stateless retry 2018-11-30 11:07:14 -08:00
Benjamin Saunders 53a7a25d24 Bypass TLS record layer 2018-11-30 11:07:14 -08:00
Benjamin Saunders 7a56fd5252 slog-friendly TransportError 2018-11-30 11:07:14 -08:00
Benjamin Saunders dc1e7884f4 Use CRYPTO frames for handshake 2018-11-30 11:07:14 -08:00
Benjamin Saunders 57edb5d82d Fix packet number encoding/decoding
These were incompletely updated from a previous draft.
2018-11-30 11:07:14 -08:00