Commit Graph

47 Commits

Author SHA1 Message Date
Marten Seemann
40650d93f0 add an application-defined error type, for RST_STREAM and STOP_SENDING 2017-12-15 16:21:09 +07:00
Marten Seemann
2c83c9e3f0 don't send STOP_WAITING frames (for IETF QUIC) 2017-12-14 23:14:05 +07:00
Marten Seemann
69998c19cb add the offset field to the BLOCKED and STREAM_BLOCKED frames
The value is not yet set, but parsing and writing works.
2017-12-14 19:00:06 +07:00
Marten Seemann
a6e44f3bfc implement parsing and writing of the STOP_SENDING frame 2017-12-13 17:58:50 +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
7e627d38ea Merge pull request #999 from lucas-clemente/reject-version-0
reject packets with version 0 sent by the client
2017-12-08 22:54:08 +07:00
Marten Seemann
f8cbb0ae03 remove unused utils.GetByteOrder
This function was needed when we supported both Q039 (using big endian
encoding) and ealier versions (using little endian encoding).
2017-12-08 11:33:40 +07:00
Marten Seemann
d7ceebd644 implement parsing and writing of the new ACK frame 2017-12-08 09:35:55 +07:00
Marten Seemann
11f746a183 implement parsing and writing of the new STREAM frames 2017-12-08 09:20:47 +07:00
Marten Seemann
1a515d1371 implement the new variable integer length frame types 2017-12-08 09:18:54 +07:00
Marten Seemann
759b0d87b1 refactor packet unpacking
This replaces version.UsesMaxDataFrame by versoin.UsesIETFFrameFormat.
That way, we can have two separate code paths in the unpacker to unpack
either gQUIC frames or IETF frames.
2017-12-08 09:18:54 +07:00
Marten Seemann
62b0d99dcd reject packets with version 0 sent by the client
Version 0 is an invalid version. For packets sent by the server, it is
used to identify the Version Negotiation Packet.
2017-12-08 09:14:41 +07:00
Marten Seemann
a79e9ee35e parse and write STOP_WAITING frames for packet number 0 2017-12-07 21:33:34 +07:00
Marten Seemann
6ce3336be5 parse and write ACKs that for packet number 0 2017-12-07 21:33:34 +07:00
Marten Seemann
be29963637 send a reserved version number in version negotiation packets 2017-12-06 10:20:22 +07:00
Marten Seemann
45e43ada40 implement the recent changes to the version negotiation packet 2017-12-06 08:40:43 +07:00
Marten Seemann
f440a65ef1 move the version field in front of the packet number in the long header
This was recently changed in the IETF draft.
2017-11-30 11:34:34 +07:00
Marten Seemann
4076ab587e add a string representation for the Long Header packet types 2017-11-22 15:57:22 -08: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
7c3d6abb4b fix parsing of the Header type byte
In order to determine if a packet is a Version Negotiation Packet, it is
not sufficient to just look at bit 0x1. Other packet types also have
that bit set, e.g. the Retry packet (packet type 0x3). Instead, we have
to look at the last 3 bits. This fix will work as long as IETF QUIC
doesn't define more than 8 long header types.
2017-11-13 10:23:17 +08: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
Marten Seemann
bc1ef31531 accept Public Resets without the RSEQ tag
The RSEQ tag is mandatory according to the gQUIC spec, however, Google
doesn't include that tag in its Public Resets.
2017-11-08 11:07:53 +07:00
Marten Seemann
095c29dc2c drop support for QUIC 37 and 38 2017-11-07 00:23:53 +07:00
Marten Seemann
9f1eb62860 implement the IETF draft BLOCKED and STREAM_BLOCKED frames 2017-11-04 15:22:14 +07:00
Marten Seemann
0f1f1c8d41 implement the MAX_DATA and MAX_STREAM_DATA frames
For gQUIC WINDOW_UPDATEs are converted to MAX_DATA and MAX_STREAM_DATA,
respectively.
2017-11-04 15:22:14 +07:00
Marten Seemann
b40d249953 reject packets that use the wrong or unknown packet types 2017-11-02 20:47:02 +07:00
Marten Seemann
aba1dd13ba only use little endian byte order for gQUIC 37 and 38
That way, when adding new non-gQUIC versions, they will use big endian.
2017-11-02 16:46:22 +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
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
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
4556ad01e5 use the new packet header for connections using TLS 2017-10-27 16:54:47 +07:00
Marten Seemann
bbe9affa27 reject version negotiation packets with an empty version list 2017-10-27 16:51:59 +07:00
Marten Seemann
7cb8e87580 implement parsing of IETF Version Negotiation Packets 2017-10-27 16:51:57 +07:00
Marten Seemann
fad279cb75 implement parsing and writing of the IETF QUIC Header 2017-10-27 16:51:04 +07:00
Marten Seemann
ac82aeda8b treat the connection ID as a big endian value 2017-10-25 10:09:15 +07:00
Marten Seemann
5556edbcad fix parsing of long reason phrases in CONNECTION_CLOSE frames 2017-10-23 17:23:13 +07:00
Marten Seemann
2f1db1c23d fix data length check in STREAM frame parser
We should check if the rest of the STREAM frame contains enough bytes to
read the full data length, not if this overflows the MaxPacketSize
(which is the maximum packet size we use for sending, and has nothing to
do with receiving packets).
2017-10-18 13:54:28 +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
8dbd60a095 drop support for QUIC 35 2017-09-25 19:55:25 +07:00
Marten Seemann
19f1293fe2 shorten variable names in the AckRange struct 2017-09-22 19:34:53 +07:00
Marten Seemann
e603715949 make handshake and crypto internal packages 2017-09-21 11:52:21 +07:00
Marten Seemann
f1ada87dcf make the protocol package internal 2017-08-30 00:19:44 +07:00
Marten Seemann
524ecb5827 move the Public Reset to the wire package 2017-08-29 23:58:27 +07:00
Marten Seemann
ed522ebbce make wire an internal package 2017-08-29 23:51:56 +07:00