Commit graph

206 commits

Author SHA1 Message Date
Marten Seemann
872e1747f4 always use connection IDs longer than 8 bytes when sending a Retry
A server is allowed to perform multiple Retries. There's little to gain
from doing so, but it's something our API allows. If a server performs
multiple Retries, it must use a connection ID that's at least 8 bytes
long. Only if it doesn't perform any further Retries it is allowed to
use shorter IDs. Therefore, we're on the safe side by always using a
long connection ID.
This shouldn't have a performance impact, since the server changes the
connection ID to a short value with the first Handshake packet it sends.
2018-08-14 17:34:21 +07:00
Marten Seemann
f88b7bb175 implement the new Retry mechanism 2018-08-13 08:47:29 +07:00
Marten Seemann
c8d20e86d7 move listening from the multiplexer to the packet handler map 2018-08-08 10:03:20 +07:00
Marten Seemann
7e2adfe19d rename the clientMultiplexer to connMultiplexer 2018-08-08 09:49:49 +07:00
Marten Seemann
a654e7600a move cutting of packets at the payload length to the multiplexer 2018-08-08 09:49:12 +07:00
Marten Seemann
cfa55f91bc close connections created by DialAddr when the session is closed 2018-08-08 08:45:47 +07:00
Marten Seemann
8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 2018-07-06 15:51:35 +07:00
Marten Seemann
f806f9146b also use the multiplexer when dialing an address 2018-07-04 10:38:40 +07:00
Marten Seemann
f02dc92a32 make the connection ID length configurable 2018-07-03 18:34:31 +07:00
Marten Seemann
73f7636537 use a random length destination connection ID on the Initial packet
The destination connection ID on the Initial packet must be at least 8
bytes long. By using all valid values, we make sure that the everything
works correctly. The server chooses a new connection ID with the Retry
or Handshake packet it sends, so the overhead of this is negligible.
2018-07-03 18:01:41 +07:00
Marten Seemann
0bd7e744ff implement parsing of headers with different connection ID lengths 2018-07-03 18:01:41 +07:00
Marten Seemann
b682af20cf add some more tests for the client multiplexer 2018-07-03 17:30:51 +07:00
Marten Seemann
0928e91e4d remove closed clients from the multiplexer 2018-07-03 17:30:49 +07:00
Marten Seemann
4109c85c8a refactor header parsing in a version independent and dependent part 2018-07-01 09:01:30 +07:00
Marten Seemann
7b96d158d2 remove the OmitConnectionID field from the Header struct
Instead, just look at the length of the destination connection ID.
2018-06-24 17:21:41 +07:00
Marten Seemann
fc57bf6c35 only set the destination connection ID for the Public Header 2018-06-24 16:47:59 +07:00
Marten Seemann
97e734e973 refactor packet handling functions in the client 2018-06-23 08:20:27 +07:00
Marten Seemann
b3fd768a61 use a smaller packetHandler interface
The packetHandler interface just needs two methods: one for handling
packets, and one for closing.
2018-06-23 08:16:51 +07:00
Marten Seemann
b28615125d only accept authenticated Retry packets 2018-06-19 22:06:38 +07:00
Marten Seemann
3601f06aed only accept a single Retry packet for a connection 2018-06-19 21:49:59 +07:00
Marten Seemann
f26a68d45c implement dial functions that use a context 2018-06-14 16:15:32 +07:00
Marten Seemann
3e03055a7d use varint packet numbers in IETF QUIC headers 2018-06-06 16:07:47 +02:00
Marten Seemann
15da47cf98 use a GoMock mock session in the server and client tests 2018-05-30 21:10:44 +08:00
Marten Seemann
733e2e952b use callbacks for signaling the session status
Instead of exposing a session.handshakeStatus() <-chan error, it's
easier to pass a callback to the session which is called when the
handshake is done.
The removeConnectionID callback is in preparation for IETF QUIC, where a
connection can have multiple connection IDs over its lifetime.
2018-05-29 21:27:08 +08:00
Marten Seemann
c98afd6625 simplify version negotiation in the client 2018-05-15 11:02:21 +09:00
Marten Seemann
8f2fed1b10 parse IETF headers independent of the sender's perspective
The IETF header format allows parsing of the header without knowing
which peer sent the packet.
2018-05-09 13:28:30 +09:00
Marten Seemann
683b5823e4 handle gQUIC and IETF QUIC packets separately in the client 2018-05-08 15:17:16 +09:00
Marten Seemann
cc536fb895 cut packets at the payload length when receiving 2018-04-23 17:47:17 +09:00
Marten Seemann
fae32101a0 use different source and destination connection IDs 2018-04-23 15:23:01 +09:00
Marten Seemann
dd5d376d94 improve packet handling in the client 2018-04-23 11:40:25 +09:00
Marten Seemann
52d31dd7ef implement the new header format
Currently, we're only sending and accepting packets with matching source
and destination connection IDs.
2018-04-19 13:46:54 +09:00
Marten Seemann
1a035a265c change the type of Connection ID to byte slice 2018-04-18 22:41:24 +09:00
Marten Seemann
948eef3e42 create a logger interface and use it everywhere 2018-04-04 13:03:28 +07:00
Marten Seemann
624ac61412 reject unknown versions in the quic.Config 2018-02-26 11:07:06 +08:00
Marten Seemann
58b20c6009 make the number of incoming streams configurable, for IETF QUIC 2018-02-23 22:15:31 +08:00
Marten Seemann
99a2853e7d remove non forward-secure dialing
This was broken for a long time, and won't be available when using the
TLS 1.3 handshake.
2018-01-02 23:26:55 +07:00
Marten Seemann
c50b360fe8 disable flaky client test on AppVeyor 2017-12-20 15:55:08 +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
57c6f3ceb5 don't return the handshakeChan from the session constructor 2017-12-08 07:34:57 +07:00
Marten Seemann
1c802fcf8c improve client tests
This hopefully fixes the flaky tests on AppVeyor.
2017-12-07 18:21:59 +07:00
Marten Seemann
be29963637 send a reserved version number in version negotiation packets 2017-12-06 10:20:22 +07:00
Marten Seemann
095c29dc2c drop support for QUIC 37 and 38 2017-11-07 00:23:53 +07:00
Marten Seemann
09334f432e
Merge pull request #909 from lucas-clemente/handle-ietf-style-vnps
handle IETF draft style Version Negotiation Packets
2017-10-30 19:44:34 +07:00
Marten Seemann
b0f34e776e send IETF draft style version negotiation packets
Send a gQUIC Version Negotiation Packet, if the client packet has a
Public Header. If the client has an IETF draft style header, send an
IETF draft style Version Negotiation Packet.
2017-10-30 18:23:12 +07:00
Marten Seemann
fc3087fab3 handle IETF draft style Version Negotiation Packets 2017-10-29 16:47:15 +07:00
Marten Seemann
4556ad01e5 use the new packet header for connections using TLS 2017-10-27 16:54:47 +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
9cb7480050 rename connection ID truncation to connection ID omission 2017-09-29 22:52:54 +07:00
Marten Seemann
e729701a94 drop support for version 36 2017-09-25 20:07:34 +07:00
Marten Seemann
84f3ec5343 reject packets with the wrong connection ID in the client 2017-09-21 10:35:54 +07:00