Commit Graph

733 Commits

Author SHA1 Message Date
Marten Seemann
a2a4a216de introduce an absolute key phase, use it for key updates 2019-06-30 17:36:09 +07:00
Marten Seemann
5a9c593463 rename the KeyPhase to KeyPhaseBit 2019-06-30 17:36:09 +07:00
Marten Seemann
7ba70cc8c2 Merge pull request #1973 from lucas-clemente/pto-rtt-stats
move calculation of the PTO to the RTTStats
2019-06-30 17:33:28 +07:00
Marten Seemann
7b9b711a77 fix timing side channel when reading headers with invalid reserved bits 2019-06-30 15:57:03 +07:00
Marten Seemann
66abcdfc5c move calculation of the PTO to the rttStats
The PTO value is needed at various places in the protocol. Calculating
it on the rttStats struct will allow us to pass around this struct.
2019-06-29 14:57:24 +07:00
Marten Seemann
4366eac105 don't include the exponential backoff in the PTO calculation
According to the spec, the PTO is defined without the backoff. The
backoff is applied when setting the PTO alarm.
2019-06-29 14:02:05 +07:00
Marten Seemann
b5764f22a2 save the max_ack_delay in the rttStats 2019-06-29 13:40:56 +07:00
Marten Seemann
4fe0f6752c fix typos in error messages when parsing Version Negotiation packets 2019-06-29 11:00:57 +07:00
Marten Seemann
0333f424bb Merge pull request #1959 from lucas-clemente/optimize-crypto-packet-sending
optimize sending of crypto packets
2019-06-29 00:03:12 +08:00
Marten Seemann
185082d5b0 Merge pull request #1962 from lucas-clemente/remove-hostname-from-addr
remove unused utils.HostnameFromAddr function
2019-06-29 00:02:08 +08:00
Marten Seemann
2f09e1774c remove unused utils.HostnameFromAddr function 2019-06-28 22:49:00 +07:00
Marten Seemann
0f16e08e14 introduce an environment variable to set the key update interval
QUIC_GO_KEY_UPDATE_INTERVAL determines the maximum number of packets
that are sent or received using a key. The default value should be safe
for use in production, but setting it to a lower value is useful for
integration and interop testing.
2019-06-27 10:54:58 +08:00
Marten Seemann
a09c045324 initiate a key update after sending / receiving 100000 packets 2019-06-27 10:54:54 +08:00
Marten Seemann
73d5d83a1d pass the largest acked 1-RTT packet number to the crypto setup 2019-06-27 07:42:19 +08:00
Marten Seemann
acba7d4e77 return ErrKeysDropped when sealer keys were already dropped 2019-06-25 13:38:11 +08:00
Marten Seemann
4e1f18e833 avoid unnecessary initializations of heaper protectors on key updates 2019-06-22 20:01:18 +08:00
Marten Seemann
ca8b7ddeef add logging to the updatable AEAD 2019-06-22 20:01:18 +08:00
Marten Seemann
55b88be009 check that the peer doesn't update keys too quickly 2019-06-22 20:01:18 +08:00
Marten Seemann
1ef54db63f check that the peer starts with key phase 0 after the handshake 2019-06-22 20:01:18 +08:00
Marten Seemann
c522bcc683 return a defined error when the AEAD cannot open a packet 2019-06-22 20:01:18 +08:00
Marten Seemann
1fb970cbac perform a key update when receiving a packet with a different key phase 2019-06-22 20:01:18 +08:00
Marten Seemann
e74ede678f move opening / sealing to the updatable AEAD 2019-06-22 20:01:18 +08:00
Marten Seemann
305e37cd15 move header encryption / decryption to the updatable AEAD 2019-06-22 20:01:18 +08:00
Marten Seemann
d3ca8db521 refactor initialization of AEADs 2019-06-22 20:01:18 +08:00
Marten Seemann
0dd5a0b91f introduce a separate AEAD for short header crypto 2019-06-22 20:01:18 +08:00
Marten Seemann
598628d05b use separate opener interfaces for long and short header packets 2019-06-22 20:01:18 +08:00
Marten Seemann
b2d3ef691e use separate sealer interfaces for long and short header packets 2019-06-22 20:01:18 +08:00
Marten Seemann
c503769bcd use separate functions per encryption level to get sealers 2019-06-22 20:01:18 +08:00
Marten Seemann
d4d3f09ee3 use separate functions per encryption level to get openers 2019-06-22 20:01:18 +08:00
Marten Seemann
14a31d49a0 add a type for the key phase and use it for header parsing and writing 2019-06-22 20:01:18 +08:00
Marten Seemann
2b8cece60a add a context to Session.Open{Uni}StreamSync 2019-06-22 19:37:21 +08:00
Marten Seemann
5550ba2c3b add a context to Session.Accept{Uni}Stream 2019-06-22 19:37:11 +08:00
Marten Seemann
d495b4bada remove unused function GetPacketNumberLength 2019-06-21 20:13:59 +08:00
Marten Seemann
fcb0d6cfdc record InSlowStart and InRecovery 2019-06-20 22:58:01 +08:00
Marten Seemann
7c7b1ba9c7 add tracing for lost packets 2019-06-20 22:58:01 +08:00
Marten Seemann
22cbb344af move the TransportState struct to the quictrace package
Prevents an import loop when passing the tracer to the ackhandler.
2019-06-20 22:58:01 +08:00
Marten Seemann
267d11ee66 add tracing for sent and received packets 2019-06-20 22:58:01 +08:00
Marten Seemann
147181786a use a varint for the error code in the RESET_STREAM frame 2019-06-14 17:38:27 +08:00
Marten Seemann
453aa23553 use a varint for the error code in the CONNECTION_CLOSE frame 2019-06-14 17:35:40 +08:00
Marten Seemann
857e4ae9a9 use stream numbers, not stream ids, in the stream maps 2019-06-05 20:01:51 +08:00
Marten Seemann
a8633a952c introduce a type for the stream number 2019-06-05 17:45:17 +08:00
Marten Seemann
0dd26f4a4c return the invalid stream ID if no streams are allowed 2019-06-05 15:17:30 +08:00
Marten Seemann
979ab75b3b require ALPN during the TLS handshake 2019-06-02 14:58:37 +08:00
Marten Seemann
74ddf326c1 Merge pull request #1943 from lucas-clemente/new-tokens
send NEW_TOKEN frames
2019-06-02 14:42:25 +08:00
Marten Seemann
314df9229c Merge pull request #1941 from lucas-clemente/post-handshake-errors
add error handling for post-handshake crypto messages
2019-06-02 14:26:05 +08:00
Marten Seemann
34543848f0 send a NEW_TOKEN from after completing the handshake (as a server) 2019-06-02 14:18:27 +08:00
Marten Seemann
784ed16d94 Merge pull request #1945 from lucas-clemente/fix-flaky-token-generator-test
fix flaky token generator test on CI
2019-06-02 14:14:25 +08:00
Marten Seemann
7c7bcede6c rename handshake.TokenGenerator.NewToken to NewRetryToken 2019-06-02 14:14:05 +08:00
Marten Seemann
17634d2fe5 error when receiving a post-handshake message with wrong encryption level 2019-06-02 14:10:51 +08:00
Marten Seemann
d4da26bdbd fix flaky token generator test on CI 2019-06-02 13:57:51 +08:00