Commit Graph

138 Commits

Author SHA1 Message Date
Marten Seemann
88da8e2e0a retransmit Initial packets as Initial packets 2018-02-23 15:58:24 +08:00
Marten Seemann
80969de93f fix splitting of STREAM frames for IETF QUIC
Move splitting of STREAM frames from the quic package to the wire
package.
2018-02-05 12:02:58 +08:00
Marten Seemann
38c420a35b include the packet size in the error when packing a too large packet 2018-02-05 09:17:30 +08:00
Marten Seemann
3b82628dbe internalize ackhandler and congestion 2018-02-02 08:40:56 +08:00
Marten Seemann
fbeba1f73a make sure that at least every 20th ACK is retransmittable
This is important because we need to make sure that we can remove old
ACK ranges from the received packet history. The logic we implemented
before was not correct, since we only made sure that every 20th packet
would be retransmittable, but we didn't have any guarantee that this
packet would also contain an ACK frame.
2018-02-01 17:11:05 +08:00
Marten Seemann
d330fda94c also use the onHasStreamData callback for the crypto stream 2018-01-09 17:17:16 +07:00
Marten Seemann
092908d3e0 simplify sending of (connection-level) BLOCKED frames 2017-12-20 10:23:17 +07:00
Marten Seemann
2c83c9e3f0 don't send STOP_WAITING frames (for IETF QUIC) 2017-12-14 23:14:05 +07:00
Marten Seemann
8e0060c51b ignore STOP_WAITINGs, derive lower bound for packets to include in ACK 2017-12-14 19:23:06 +07:00
Marten Seemann
c1559be957 fix race condition when queueing RST_STREAM frames 2017-12-13 17:35:34 +07:00
Marten Seemann
8e1f62f749 when forcing a retransmittable packet, bundle the PING with other frames
We're sending a retransmittable packet every 20 packets (if there are no
other frames to send). To make a packet retransmittable, we add a PING
frame. We should bundle this PING with an ACK.
2017-12-12 23:10:43 +07:00
Marten Seemann
73ab97aa95 simplify the stream by directly popping STREAM frames from it 2017-12-12 18:48:08 +07:00
Marten Seemann
4b4e487486 remove the error return value from wire.Frame.MinLength
No functional change expected.
The error was only non-nil if some required values for the STOP_WAITING
frame were not set. It should be sufficient to throw an error when
attempting to write an invalid STOP_WAITING frame.
2017-12-12 17:33:04 +07:00
Marten Seemann
6019634286 pad Initial packets to the required minimum size (1200 bytes) 2017-12-08 11:50:43 +07:00
Marten Seemann
11f746a183 implement parsing and writing of the new STREAM frames 2017-12-08 09:20:47 +07:00
Marten Seemann
25a6dc9654 implement stateless handling of Initial packets for the TLS server 2017-12-08 08:45:54 +07:00
Marten Seemann
3f62ea8673 set the Long Header packet type based on the state of the handshake 2017-10-29 14:08:08 +07:00
Marten Seemann
a65929f6cf add logging for the packet header 2017-10-27 22:56:41 +07:00
Marten Seemann
4556ad01e5 use the new packet header for connections using TLS 2017-10-27 16:54:47 +07:00
Marten Seemann
6c394acde7 never use a 6 byte packet number
According to the IETF draft, the only packet number lengths are 1, 2 and
4 bytes. With the given formula for the packet number derivation, we
would have only sent a 6 byte packet number if the difference between
the largest unacked and the current packet number exceeded 2^31, so this
would never have happened anyway.
2017-10-27 16:51:59 +07:00
Marten Seemann
f3e9bf4332 remove the params negotiator 2017-10-20 18:08:21 +07:00
Marten Seemann
9cb7480050 rename connection ID truncation to connection ID omission 2017-09-29 22:52:54 +07:00
Marten Seemann
c95f2054a8 rename the ConnectionParametersManager to ParamsNegotiator 2017-09-28 18:15:33 +07:00
Marten Seemann
e603715949 make handshake and crypto internal packages 2017-09-21 11:52:21 +07:00
Marten Seemann
8bcabe0ba9 correctly pack packets with sealers with different overheads 2017-09-08 12:04:45 +03:00
Marten Seemann
f1ada87dcf make the protocol package internal 2017-08-30 00:19:44 +07:00
Marten Seemann
ed522ebbce make wire an internal package 2017-08-29 23:51:56 +07:00
Marten Seemann
1794636220 more the PublicHeader to the wire package 2017-08-29 23:45:38 +07:00
Marten Seemann
88afad8722 rename package frames to wire 2017-08-29 23:27:15 +07:00
Lucas Clemente
a0aba76df9 QueueControlFrameForNextPacket -> QueueControlFrame 2017-06-21 11:16:28 +02:00
Lucas Clemente
3300b6cef0 Store ackframe along with swf in the packet packer 2017-06-21 11:16:28 +02:00
Lucas Clemente
efc9ec5051 Add packer.SetLeastUnacked and remove the parameter from the Pack* functions 2017-06-21 11:16:28 +02:00
Lucas Clemente
ff8c75a22e Send ACKs and SWFs even if we are congestion limited
Fixes #576.
2017-06-20 23:41:36 +02:00
Lucas Clemente
6157eeffdb Factor crypto frame packing into a separate function 2017-06-20 10:38:55 +02:00
Lucas Clemente
8b56b6c169 Separate non-fw retransmissions from the main code path 2017-06-20 10:25:45 +02:00
Lucas Clemente
f1c2163f14 Remove non-retransmittable logic from packer, this is now in ackhandler 2017-06-20 10:25:45 +02:00
Lucas Clemente
e50a03148d Separate the CONN_CLOSE packing path from the normal one 2017-06-20 10:25:45 +02:00
Lucas Clemente
dc3126ba90 Move packet writing and sealing to a new function 2017-06-20 10:25:45 +02:00
Lucas Clemente
cbb640b093 Don't pass the stop waiting frame to the packer as a parameter 2017-06-20 10:25:45 +02:00
Lucas Clemente
495399ede6 Remove PackPacket's control frames parameter
With this change it would theoretically be possible for outdated control frames to be sent, but this is quite unlikely in practice.
2017-06-20 10:25:45 +02:00
Lucas Clemente
80f87e2fab Fix formatting 2017-06-10 15:33:07 +02:00
Lucas Clemente
e43b91f633 Fix encryption of stream data
This commit splits up handling of the crypto stream and the other streams in the framer, crypto setup, and the packer.

- Crypto stream data is handled separately and should never be sent unencrypted or FW-secure. Fixes #544.
- Non-crypto stream data is only sent with FW encryption on the server and only with non-FW or FW encryption on the client. Fixes #611.

The crypto stream is current excluded from flow control (#657), but that shouldn't be an issue in practice for now.
2017-06-09 19:12:10 +02:00
Lucas Clemente
4ea2ccd526 Improve STOP_WAITING detection in packet packer 2017-06-09 19:12:10 +02:00
Lucas Clemente
86b329d7da Factor public header creation into a new function 2017-06-09 19:12:09 +02:00
Marten Seemann
2903f9b238 return a lambda to for sealing a packet in the CryptoSetup 2017-03-22 16:52:00 +07:00
Marten Seemann
8c5e7818a0 retransmit the diversification nonce in the packet carrying the SHLO
The packet containing the SHLO is the only packet that is sent with
initial encryption. If it is lost, we need to make sure that the
diversification nonce is included in the PublicHeader, otherwise the
client will not be able to derive the keys for the forward-secure
encryption.
2017-03-01 15:11:01 +07:00
Marten Seemann
5e91f139ce add a method to pack a retransmission in the packetPacker 2017-03-01 14:11:21 +07:00
Marten Seemann
9e147714ac pack smaller packets as long as the encryption is not forward secure 2017-03-01 14:01:52 +07:00
Marten Seemann
d4b2b66273 change composeNextPacket function signature in packetPacker 2017-03-01 14:01:52 +07:00
Marten Seemann
88561ff8c7 prevent sending of unencrypted stream data on data streams
fixes #446
2017-02-25 10:13:34 +07:00