Commit Graph

106 Commits

Author SHA1 Message Date
Marten Seemann
a02a6197c2 fix race condition in the client crypto setup tests 2017-12-26 15:35:00 +07:00
Marten Seemann
14d4e5e9ec update mint
mint recently changed the signature of ExtensionList.Find.
2017-12-22 16:10:37 +07:00
Marten Seemann
23ce5a8554 drop packets for new gQUIC connections that are too small 2017-12-08 12:34:59 +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
7ba613c3b9 use the mint default cookie protector to encrypt and decrypt cookies 2017-12-07 18:20:22 +07:00
Marten Seemann
80a827f133 fix the crypto setup so that it works with the recent mint changes
mint now supports stateless retries, and requires that the cookie
protector is set in the mint.Config and returns a new alert when a
retry is performed.
2017-12-07 13:49:45 +07:00
Marten Seemann
8c2404edf5 send a reserved version number in the SHLO 2017-12-06 10:20:22 +07:00
Marten Seemann
1a3852aec6 send a reserved version number in the EncryptedExtensions message 2017-12-06 10:20:22 +07:00
Marten Seemann
7487dc22bf Merge pull request #977 from lucas-clemente/fix-971
update validation of version negotiation
2017-12-06 07:02:49 +07:00
Marten Seemann
7c8715616e update validation of version negotiation
The negotiated_version parameter was recently moved from the
client_hello TLS handshake message to the encrypted_extensions.
2017-12-05 10:35:04 +07:00
Marten Seemann
c30064bb51 parse TLS extensions containing the initial_max_stream_id_uni parameter
We're not sending the initial_max_stream_id_uni parameter, which
implicitely sets this value to 0, i.e. the peer is not allowed to open
unidirectional streams.
2017-12-05 09:17:43 +07:00
Marten Seemann
a72efca38d don't require the initial_max_stream_id in the transport parameters
The draft was recently changed to make this value optional.
2017-12-05 08:56:49 +07:00
Jan Rüth
281fec1b2d Make error chan not block for a single write, allowing ParseHandshakeMessage goroutine to gracefully exit 2017-11-22 09:54:03 +01:00
Marten Seemann
683f244054 rename the Cleartext Long Header type to Handshake
This was recently changed in the draft.
2017-11-13 10:55:33 +08:00
Marten Seemann
11364cbd81 fix encoding of the idle timeout for the TLS transport parameters 2017-11-11 19:48:41 +08:00
Marten Seemann
095c29dc2c drop support for QUIC 37 and 38 2017-11-07 00:23:53 +07:00
Marten Seemann
a1a4f35096 send initial version in the CHLO, not the current version
This commit fixes two bugs:
1. In the CHLO, we need to send the initial QUIC version. It will differ
from the current version if version negotiation was performed.
2. The session setup was using the wrong version (current version, and
not the initial version), such that we would have sent the wrong version
in the TLS handshake as well.
2017-11-02 21:51:51 +07:00
Marten Seemann
96f65f922f Merge pull request #927 from lucas-clemente/fix-925
fix client handshake failure when the server supports unknown versions
2017-11-02 21:34:04 +07:00
Marten Seemann
3e6f66da79 rename the packet types according to recent draft changes 2017-11-02 18:31:04 +07:00
Marten Seemann
43c23ff5fa fix client handshake failure when the server supports unknown versions 2017-11-02 17:41:06 +07:00
Marten Seemann
df13a0a970 implement the TLS Cookie extension 2017-11-02 16:45:43 +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
3e39991e1e use the non-blocking of mint to cycle through the handshake 2017-10-27 22:54:40 +07:00
Marten Seemann
fcc380187a Merge pull request #899 from lucas-clemente/fix-898
encrypt unprotected packets with a connection-dependent key
2017-10-27 22:52:04 +07:00
Marten Seemann
4f86995e48 encrypt unprotected packets with a connection-dependent key 2017-10-27 17:35:08 +07:00
Marten Seemann
ddea1d83ab use gomock to mock crypto.AEAD in the crypto setup tests 2017-10-27 17:35:08 +07:00
Marten Seemann
d98a11bb35 save version numbers such that can be written in big endian
This makes the version number representation consistent with the IETF
draft.
2017-10-27 17:24:24 +07:00
Marten Seemann
9825ddb43a simplify the interaction with mint 2017-10-25 09:13:47 +07:00
Marten Seemann
282b423f7d pass the crypto stream to the crypto setup constructor
The crypto stream is opened during the session setup. Passing it to the
crypto setup directly helps simplify the constructor.
2017-10-25 09:13:47 +07:00
jbenoist
12d4e031bf fix 0-RTT by moving cookie generation to server config 2017-10-24 13:27:50 +07:00
Marten Seemann
f3e9bf4332 remove the params negotiator 2017-10-20 18:08:21 +07:00
Marten Seemann
925a52f032 don't apply a limit to the number of outgoing streams 2017-10-20 17:35:30 +07:00
Marten Seemann
480db80da1 remove the receive flow control window from the params negotiator
The receive windows are not negotiated, they are just announced to the
peer.
2017-10-20 17:35:30 +07:00
Marten Seemann
f5acb690d3 simplify the maximum stream limit 2017-10-20 17:35:30 +07:00
Marten Seemann
daff6256b9 don't negotiate the maximum incoming streams value
The maximum number of incoming streams doesn't need to be negotiated. It
is a value that is only announced by the peer, and has to be respected.
Furthermore, Chrome doesn't seem to care about the MSPC value anymore
(since MIDS was introduced), so there's no need to send this in the
handshake any more.
2017-10-20 17:35:30 +07:00
Marten Seemann
0e1a8a5f8c move the max flow control increments out of the params negotiator
The params negotiator was just keeping track of the value set in the
quic.Config. The max flow control increments are not subject to
negotiation, but an independent implementation decision of every peer.
2017-10-04 07:16:16 -07:00
Marten Seemann
6874ff7b41 Merge pull request #866 from lucas-clemente/fix-856
handle version negotiation in the TLS handshake
2017-10-03 11:26:53 -07:00
Marten Seemann
4eec7433d9 enforce a minimum value of the remote idle timeout
This prevents a DoS where a peer could send us a really small remote
idle timeout, and we would continuously send it PING frames.
2017-10-03 11:06:31 -07:00
Marten Seemann
0ffb64b5d7 rename the IdleConnectionStateLifetime to RemoteIdleTimeout 2017-10-03 10:48:08 -07:00
Marten Seemann
a8b603b7bf don't negotiate the idle timeout
The idle timeout doesn't need to be negotiated, simply announcing it to
the peer is sufficient. We now close the session if there's no incoming
network activity for the duration of the local idle timeout, and we
send a PING frame after half the remote idle timeout (if keep alives are
enabled).
2017-10-02 18:16:27 -07:00
Marten Seemann
a136ceffeb implement the validation of the version negotiation for the client 2017-10-02 13:51:38 +07:00
Marten Seemann
e01eb322e4 implement the validation of the version negotiation for the server 2017-10-02 13:16:01 +07:00
Marten Seemann
a2988bce8d send versions in ClientHello and EncryptedExtensions TLS parameters
It only sends the right values now, but doesn't yet perform any
validation.
2017-10-02 12:50:17 +07:00
Marten Seemann
6f3d3919df use separate constructors for client and server for the TLS crypto setup 2017-10-02 11:11:42 +07:00
Marten Seemann
474b036474 Merge pull request #858 from lucas-clemente/omit-instead-of-truncate-connection-id
rename connection ID truncation to connection ID omission
2017-09-30 20:40:12 +07:00
Marten Seemann
9cb7480050 rename connection ID truncation to connection ID omission 2017-09-29 22:52:54 +07:00
Marten Seemann
dc6d1b6822 send the maximum packet size in the TLS transport parameters 2017-09-29 22:08:12 +07:00
Marten Seemann
4cbdced106 send the transport parameters in the TLS handshake 2017-09-29 17:35:22 +07:00
Marten Seemann
c95f2054a8 rename the ConnectionParametersManager to ParamsNegotiator 2017-09-28 18:15:33 +07:00
Marten Seemann
ebb4150e63 separate connection parameters negotiation and gQUIC handshake parsing 2017-09-28 18:15:32 +07:00