Commit graph

311 commits

Author SHA1 Message Date
Marten Seemann
c481645276 send a gQUIC / IETF QUIC Version Negotiation Packet based on header type 2018-08-27 09:08:59 +07:00
Marten Seemann
6ec4c21c7e allow multiple Listener.Close calls
Every subsequent call to Listener.Close will be a noop.
2018-08-27 07:56:52 +07:00
Marten Seemann
acb45c0ef1 always allow sending of IETF QUIC Version Negotiation Packets
When receiving a packet with an IETF QUIC Header using an unsupported
version, we should send a IETF QUIC Version Negotiation Packet, even if
none of the supported versions is IETF QUIC.
2018-08-15 15:23:28 +07:00
Marten Seemann
f88b7bb175 implement the new Retry mechanism 2018-08-13 08:47:29 +07:00
Marten Seemann
04147d86da rename the cryptoStreamI interface to cryptoStream 2018-08-11 12:45:43 +07:00
Marten Seemann
b5d03d24a5 close the packet conn when a server created with ListenAddr is closed 2018-08-08 10:03:22 +07:00
Marten Seemann
ad5a3e2fa0 also use the multiplexer for the server 2018-08-08 10:03:22 +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
8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 2018-07-06 15:51:35 +07:00
Marten Seemann
f02dc92a32 make the connection ID length configurable 2018-07-03 18:34:31 +07:00
Marten Seemann
0bd7e744ff implement parsing of headers with different connection ID lengths 2018-07-03 18:01:41 +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
fc57bf6c35 only set the destination connection ID for the Public Header 2018-06-24 16:47:59 +07:00
Marten Seemann
2c05dbff07 multiplex multiple clients on one packet conn 2018-06-23 08:35:11 +07:00
Marten Seemann
dacc94ccba rename the sessionMap to packetHandlerMap 2018-06-23 08:20:29 +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
ef34d9e85f start running TLS server session directly when creating them 2018-06-23 08:16:51 +07:00
Marten Seemann
d7dee33bc7 change the source connection ID when creating a new IETF QUIC session 2018-05-30 21:37:05 +08:00
Marten Seemann
9c5986945e refactor the map of sessions into a separate struct 2018-05-30 21:10:44 +08: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
6b82e46e0c use the prefix logger for client, server and proxy 2018-05-29 20:52:54 +08: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
70f6e3651e
Merge pull request #1350 from lucas-clemente/split-packet-handling
split packet handling for gQUIC and IETF QUIC packets
2018-05-09 13:22:54 +09:00
Marten Seemann
518e212924 handle gQUIC and IETF QUIC packets separately in the server 2018-05-08 21:58:59 +09:00
Marten Seemann
f0b412aeb8 simplify handling of Public Resets in the server
The server shouldn't receive any Public Resets. There is no need to
attempt parsing them, since they are ignored anyway.
2018-05-08 21:56:02 +09:00
Marten Seemann
187b0141b0 remove incorrect documentation about the listeners
Listener.Serve() was removed a very long time ago.
2018-05-08 21:24:05 +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
d47124d14d add more methods to the protocol.ConnectionID
This will make it easier to change the underlying type of the connection
ID (potentially an array is faster than a byte slice).
2018-04-19 16:08:06 +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
d3297f0734 fix race condition when setting up TLS sessions in the server 2018-03-07 15:14:06 +07:00
Marten Seemann
0afba48de8 continue accepting sessions after encountering a connection ID collision 2018-03-07 10:54:40 +07:00
Marten Seemann
624ac61412 reject unknown versions in the quic.Config 2018-02-26 11:07:06 +08:00
Marten Seemann
548916e902 run gometalinter with go vet 2018-02-23 22:39:08 +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
07b8821ef7 use pointer to byte slices in the buffer pool
https://staticcheck.io/docs/staticcheck#SA6002 suggests to use pointers
to objects in the sync.Pool.
2018-02-23 18:57:12 +08:00
Marten Seemann
51b6ff0af5 only accept one TLS sessions for the same connection ID 2018-02-06 12:44:06 +08:00
Marten Seemann
2ca4796864 stop handling a packet after sending a Version Negotiation Packet 2018-02-02 13:57:10 +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
96571b56e5 wait for serve() to return before returning from server.Close() 2017-12-20 16:59:38 +07:00
Marten Seemann
cd5e7ae177 remove unneeded function from the crypto stream interface 2017-12-12 18:30:08 +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
57c6f3ceb5 don't return the handshakeChan from the session constructor 2017-12-08 07:34:57 +07:00
Marten Seemann
45e43ada40 implement the recent changes to the version negotiation packet 2017-12-06 08:40:43 +07:00
Marten Seemann
234d5aab36 echo the offered version in IETF Version Negotiation Packets 2017-11-12 14:37:43 +08:00
Marten Seemann
5d4174b2f0 parse the packet header before getting the session from the session map 2017-11-10 08:48:45 +07:00