Commit Graph

205 Commits

Author SHA1 Message Date
Marten Seemann
ab613c3ab0 use a directed aeadChanged chan in the session 2017-05-09 18:42:49 +08:00
Marten Seemann
0a6a9551f8 close the aeadChanged chan when the handshake completes
This allows us to remove HandshakeComplete() from the CryptoSetup
interface. It also provides a signal to the session when the handshake
completes.
2017-05-09 18:40:23 +08:00
Marten Seemann
2e0f5473a0 Merge pull request #577 from lucas-clemente/fix-565
add a quic.Config option for QUIC versions
2017-05-09 18:30:04 +08:00
Marten Seemann
ab88e9472d fix infinite loop in session test
fixes #598
The mockReceivedPacketHandler returned the same ACK frame over and over
again, so that the loop in session.sendPacket() would send packets
containing this packet indefinitely.
2017-05-09 12:15:21 +08:00
Marten Seemann
b305cd674f make it possible to configure the QUIC versions for the server 2017-05-05 18:05:57 +08:00
Lucas Clemente
fa12f3664d Merge pull request #582 from lucas-clemente/improve-ackhandler-logs
Improve ackhandler logs
2017-05-05 10:48:35 +02:00
Marten Seemann
4f6e31a08b Merge pull request #572 from lucas-clemente/remove-closecallback
remove the closeCallback from the session
2017-05-05 16:31:16 +08:00
Marten Seemann
6263c07a49 fix several flaky session tests 2017-05-04 12:33:23 +08:00
Marten Seemann
96e49b0c31 remove the closeCallback from the session
The closeCallback was run when a session was closed, i.e. after the run
loop of the session stopped. Instead of explicitely calling this callback
from the session, the caller of session.run() can just execute the code
after session.run() returns.
2017-05-03 14:06:47 +08:00
Lucas Clemente
a2e079c052 Remove an unnecessary error return value 2017-04-30 15:32:01 +02:00
Marten Seemann
3c223b22a2 include peer perspective in nullAEAD
ref #375
2017-04-27 18:05:24 +07:00
Marten Seemann
81e06c1f02 don’t send a Public Reset if trial decryption succeeds
fixes #516
2017-04-11 10:45:08 +07:00
Marten Seemann
8565fdf722 fix limit of undecrytable packets queue length
fixes #517
Also fixes an off-by-one error, such that the queue now holds exactly
protocol.MaxUndecrytablePackets packets when enough undecryptable
packets are received.
2017-04-11 10:37:25 +07:00
Lucas Clemente
612fa16a43 Move SentPacketHandler.CheckForError into SentPacket 2017-04-02 10:29:09 +02:00
Lucas Clemente
1c5380c49b Implement loss recovery from the current WG draft
Fixes #498 and will hopefully go a long way towards fixing the many
flaky tests.
2017-04-02 10:29:09 +02:00
Lucas Clemente
22cdbf7b49 Fix flaky appveyor tests
We were relying on the number of goroutines in those tests. This commit
replaces that logic with grepping through the current callstack.

The 'doesn't return after version negotiation is established if no
ConnState is defined' test is disabled, since I can't figure out a way
to make it work without leaking sessions. I filed #506 to track that
work.

Fixes #484.
2017-03-30 21:13:24 +02:00
Marten Seemann
f4113b772a remove stray Print command in tests 2017-03-20 16:10:30 +07:00
Marten Seemann
6d5c9776e9 send a Public Reset when receiving a CHLO with the FHL2 tag
Fixes #411.

Chrome sends the FHL2 when it wants to perform a head-of-line blocking
experiment, introduced in QUIC version 36 (see
https://codereview.chromium.org/2115033002). We don’t support this
experiment. By sending a Public Reset when receiving this tag we force
Chrome to use the TCP fallback.
2017-03-20 12:35:34 +07:00
Marten Seemann
ab90b3f4d0 add tests for session.LocalAddr and session.RemoteAddr 2017-03-10 00:13:20 +07:00
Marten Seemann
34b688b3b9 add a LocalAddr to the Session 2017-03-10 00:07:27 +07:00
Marten Seemann
eb7ed2624a only send Public Reset after a timeout
fixes #471
2017-03-08 18:15:52 +07:00
Marten Seemann
936a29ff35 retransmit packets with the encryption level they were sent with 2017-03-01 14:11:25 +07:00
Marten Seemann
7d2922d7ab save the encryption level of a sent packet in the SentPacketHandler 2017-03-01 14:09:50 +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
6cb19e42a5 explicitly pass encryption level in the aeadChanges channel 2017-02-25 21:38:08 +07:00
Marten Seemann
20b2069d78 Merge pull request #447 from lucas-clemente/fix-446
prevent sending of unencrypted stream data on data streams
2017-02-25 17:01:24 +07:00
Lucas Clemente
5a3823a5db Merge pull request #445 from lucas-clemente/close-remote
Remove stream.CloseRemote from public API
2017-02-25 10:42:58 +01:00
Marten Seemann
88561ff8c7 prevent sending of unencrypted stream data on data streams
fixes #446
2017-02-25 10:13:34 +07:00
Marten Seemann
a972c7a21e return the encryption level of a packet when decrypting it 2017-02-25 08:27:08 +07:00
Lucas Clemente
b2177c92d8 remove stream.CloseRemote from public API 2017-02-24 18:44:40 +01:00
Marten Seemann
820eb2e6ee call the ConnStateCallback in the server for encryption level changes
ref #439
2017-02-24 08:42:49 +07:00
Marten Seemann
cd465ae0b5 move utils.Stream to quic.Stream 2017-02-22 23:03:09 +07:00
Marten Seemann
592ef45fdf add OpenStreamSync() method to Session interface 2017-02-22 23:03:09 +07:00
Marten Seemann
af4b36b002 use a connection in the Client 2017-02-22 23:03:08 +07:00
Marten Seemann
d61c0eb85d add a Write and a Close method to the connection interface 2017-02-22 23:03:08 +07:00
Marten Seemann
824f122a79 remove unused StreamCallback 2017-02-22 23:03:08 +07:00
Marten Seemann
6dd163020a never return stream 1 from Session.AcceptStream() 2017-02-22 23:03:07 +07:00
Marten Seemann
a96211f724 create Session interface 2017-02-22 23:03:07 +07:00
Marten Seemann
5b42675da2 use a net.PacketConn instead of a net.UDPConn in Server and Session 2017-02-22 23:03:07 +07:00
Marten Seemann
c533a9adb8 implement an AcceptStream method in the Session 2017-02-22 23:03:06 +07:00
Marten Seemann
6d3e94bf21 open implicitly opened streams in streamsMap 2017-02-22 23:03:06 +07:00
Marten Seemann
c7b4ad6e80 return plain nil value for Session.GetOrOpenStream for closed streams
fixes #418
2017-02-15 22:29:08 +07:00
Marten Seemann
268841f0cc add a TLSClientConfig to the QUIC RoundTripper
fixes #407
2017-02-04 10:28:00 +07:00
Marten Seemann
db09de621c detect version downgrade attacks in the client crypto setup 2017-01-14 18:58:47 +07:00
Marten Seemann
a7afd72795 add a callback that is called when the crypto level changes 2017-01-14 18:54:18 +07:00
Marten Seemann
16da08a440 add client functionality to the streamsMap 2017-01-14 18:54:15 +07:00
Marten Seemann
1a830dbdb7 implement basic version negotiation 2017-01-14 18:52:24 +07:00
Marten Seemann
014315d3c7 parse hostname from address and pass it to the client cryptoSetup 2017-01-14 18:52:19 +07:00
Marten Seemann
6913f5ae75 add tests for certChain, simplify constructor 2017-01-14 18:52:18 +07:00
Marten Seemann
0535491f30 rename crypto.Signer to crypto.CertChain 2017-01-14 18:52:18 +07:00