Commit Graph

856 Commits

Author SHA1 Message Date
Benjamin Saunders 0abbff72a9 Move SocketAddr normalization into Endpoint
This reduces the amount of conversion necessary.
2018-12-30 23:03:56 +01:00
Benjamin Saunders 6f5dd2dc4d Fix Linux IPv4 UDP socket setup 2018-12-30 23:03:56 +01:00
Dirkjan Ochtman af66816f06 Add CI for macOS 2018-12-30 22:26:20 +01:00
Benjamin Saunders 97301a93a4 Extract in-flight statistics struct
This makes it easier to manipulate while borrowing a space.
2018-12-30 21:56:15 +01:00
Benjamin Saunders cf5ec4aff4 Set ALPN ID in interop tool
ngtcp2 unconditionally pretends we negotiated hq-17, which confuses
rustls if we didn't.
2018-12-30 21:56:15 +01:00
Dirkjan Ochtman 535f8b2af3 Add test for quinn API layer 2018-12-30 12:43:17 -08:00
Dirkjan Ochtman ace2b168e8 Reorder code in example server to improve locality 2018-12-30 12:43:17 -08:00
Dirkjan Ochtman 3c17fcdfff Assorted clippy fixes 2018-12-30 09:47:21 +01:00
Benjamin Saunders 5333024917 Update draft version and tweak wording in README 2018-12-29 23:38:18 -08:00
Benjamin Saunders 85008856e0 Clients MUST discard packets from new addresses 2018-12-30 07:30:32 +01:00
Benjamin Saunders 93d9b97675 PATH_RESPONSE shouldn't be retransmitted 2018-12-30 07:30:32 +01:00
Benjamin Saunders abd0713076 Don't pad ACK-only client Initial packets
Only the first Initial packet, containing the CRYPTO frame(s), must be
padded.
2018-12-30 07:30:32 +01:00
Benjamin Saunders 296ef0c75c Tweak logging 2018-12-30 07:30:32 +01:00
Benjamin Saunders aeb58b2d81 Restore stateless retry support to the example server 2018-12-30 07:30:32 +01:00
Benjamin Saunders fe9c5fd157 Enable all features in CI 2018-12-30 07:30:32 +01:00
Benjamin Saunders ed98e9aa96 Test retries by default with interop tool 2018-12-30 07:30:32 +01:00
Benjamin Saunders 67b54b7419 Fix interop tool false negatives on D 2018-12-30 07:30:32 +01:00
Benjamin Saunders 7517f5e4f2 Fix interop helper build 2018-12-30 07:30:32 +01:00
Benjamin Saunders 3a82358423 Simplify and debug header protection sampling
The sample offset is now always exactly 4 bytes after the PN offset,
so much extra computation is now unnecessary, and some interfaces can
be simplified. As a bonus, a bug in the redundant computation was
eliminated in the process.
2018-12-30 07:30:32 +01:00
Benjamin Saunders 289a2a2835 Delete redundant check 2018-12-30 07:30:32 +01:00
Benjamin Saunders 3086295fb7 Fix premature handshake key discard
1-RTT packets may be sent before the handshake has genuinely
completed, making the prior logic wrong.

This approach relies on the inference that if the server has sent any
Handshake ACK in the Established state, there is no need to retransmit
any outstanding CRYPTO data. This holds because the server cannot
enter Established until the client has fully completed the handshake,
so any outstanding CRYPTO data must be a spurious retransmit, and need
not be reliably delivered.
2018-12-30 07:30:32 +01:00
Benjamin Saunders 9b41a8acc5 Reject consecutive key updates 2018-12-29 14:27:06 -08:00
Benjamin Saunders 09468d5a7a Implement timer-based key discard 2018-12-29 14:27:06 -08:00
Benjamin Saunders 962a63d1d3 Style fix 2018-12-29 14:27:06 -08:00
Benjamin Saunders a83592bc47 Discard client's Initial space only on Handshake actually sent
No ultimate behavioral change here so long as handshake keys are
unavailable to clients until after all Initial CRYPTO data has been
transmitted, but less fragile: discarding the previous space in
write_tls is only correct if the write attempt generated no data.
2018-12-29 14:27:06 -08:00
Benjamin Saunders f1db8789bf Look up AEAD tag length from negotiated cipher
Futureproofs against new AEAD algorithms.
2018-12-29 14:27:06 -08:00
Benjamin Saunders 079b1752d8 Fix gratuitous padding
The AEAD tag is considered to be part of the protected payload.
2018-12-29 14:27:06 -08:00
Benjamin Saunders 865ff81ac3 Probe packets must be ack-eliciting
Previously, we might have sent an ACK-only packet in response to a
probe timeout, and were not correctly accounting for ack-eliciting
probes in loss detection.
2018-12-29 14:27:06 -08:00
Benjamin Saunders f6ead8a5a1 Remove trivial method 2018-12-29 14:27:06 -08:00
Benjamin Saunders f609624193 Remove quinn-proto connect example
This is not a recommended way to use Quinn, and cost unnecessary
maintenance effort.
2018-12-29 14:27:06 -08:00
Benjamin Saunders d0654ccd65 Simplify test harness timer handling 2018-12-29 14:27:06 -08:00
Benjamin Saunders de33dce500 Fix ECN verification false negatives
When two ACKs acknowledging new packets were received simultaneously
in different number spaces, the first ECN verification would update
the ECN feedback state, leading the second verification to erroneously
conclude that no ECN counter increase corresponding to the newly acked
packet occurred and hence ECN bleaching must be taking place.
2018-12-29 03:07:22 -08:00
Benjamin Saunders 02ea5309bd Rename SpaceId::OneRtt to Data for clarity 2018-12-29 03:07:22 -08:00
Benjamin Saunders 49e9b8eae8 Discard packets with inconsistent source CIDs
Required by the draft to avoid problems that might arise from
stateless processing of multiple Initial packets producing different
connection IDs
2018-12-29 03:07:22 -08:00
Benjamin Saunders b34ec757f1 Allow DCID to change after receiving Retry
This is specifically called out by the draft as legal.
2018-12-29 03:07:22 -08:00
Benjamin Saunders ee9c35d385 Fix unstable source CID 2018-12-29 03:07:22 -08:00
Benjamin Saunders b55615a42d Update interop ALPN ID 2018-12-29 03:07:22 -08:00
Benjamin Saunders d3c92e1231 Per-space CRYPTO streams 2018-12-29 03:07:22 -08:00
Benjamin Saunders 94ed615d55 Remove obsolete sample_offset adjustment
This is handled via padding in the current draft.
2018-12-29 03:07:22 -08:00
Benjamin Saunders f541730858 Fix PartialEncode computing wrong payload length
This could lead to an invalid sample_offset being computed.
2018-12-29 03:07:22 -08:00
Benjamin Saunders 9892b12493 More direct condition for setting payload field
This checks the value we actually care about, rather than an implied
value, avoiding potential confusion when 0-RTT is later introduced.
2018-12-29 03:07:22 -08:00
Benjamin Saunders 3b8f05daa9 Discard Initial keys even if client Handshake is retransmitted 2018-12-29 03:07:22 -08:00
Benjamin Saunders 05f9334206 Employ helper function in test 2018-12-29 03:07:22 -08:00
Benjamin Saunders f3efac1b22 Fix inconsistent in-flight packet accounting
This mostly arose from Connection::bytes_in_flight being incorrectly
overloaded to determine whether ack eliciting packets were in flight.
2018-12-29 03:07:22 -08:00
Benjamin Saunders 8f81fc1fe4 Don't pad server Initials 2018-12-29 03:07:22 -08:00
Benjamin Saunders 72bb33c05e Draft 17 Retry header encoding 2018-12-28 12:18:11 +01:00
Benjamin Saunders 75ecbf63b0 Remove unnecessary type variables
These were only ever instantiated to their default values, and hence
were unnecessary complexity.
2018-12-28 12:18:11 +01:00
Benjamin Saunders 175b033036 Test initial close by server 2018-12-28 12:18:11 +01:00
Benjamin Saunders 036a23f3ce Use correct header for pre-handshake closes 2018-12-28 12:18:11 +01:00
Benjamin Saunders 9a0cc83558 Remove some unnecessary visibility 2018-12-28 12:18:11 +01:00