Commit Graph

1165 Commits

Author SHA1 Message Date
Marten Seemann
9ce5426da0 fix deadlock in crypto setup when it is closed while handling a message 2020-09-25 14:06:32 +07:00
Marten Seemann
a063500d73 use a package-level variable to set the key update frequency 2020-09-22 19:55:52 +07:00
Marten Seemann
e94db952b7 correctly handle key updates within the 3 PTO period
We need to:
* stop the timer to drop the previous generation
* correctly log that the N-1 keys are dropped immediately when keys are
updated to N+1
2020-09-22 19:28:46 +07:00
Marten Seemann
06e0db8ef4 Merge pull request #2781 from lucas-clemente/check-peer-key-update
check that the peer updated its keys when acknowledging a key update
2020-09-17 23:04:16 +07:00
Marten Seemann
6ecbc4186e Merge pull request #2786 from lucas-clemente/fix-flaky-packet-number-skipping-test
fix flaky packet number skipping test
2020-09-17 23:02:25 +07:00
Marten Seemann
9d4b4f6bf0 check that the peer updated its keys when acknowledging a key update 2020-09-15 13:37:48 +07:00
Marten Seemann
5eaab73043 fix flaky packet number skipping test 2020-09-15 10:58:12 +07:00
Marten Seemann
ea3d32394d read the ECN bits 2020-09-15 10:51:22 +07:00
Marten Seemann
876ab1d531 introduce a function to distinguish between IPv4 and IPv6 addresses 2020-09-14 17:01:34 +07:00
Marten Seemann
fa4f0a9e7a keep track of ECN counts on received packets 2020-09-14 17:01:34 +07:00
Marten Seemann
13fa0bcdd1 implement writing of ACK frames containing ECN counts 2020-09-14 17:01:34 +07:00
Marten Seemann
45246dad22 count number of failed decryptions, error when lifetime-limit is reached 2020-09-14 14:07:56 +07:00
Marten Seemann
3a4de205b0 add the AEAD_LIMIT_REACHED error code 2020-09-14 14:07:55 +07:00
Marten Seemann
ba9f98d83a Merge pull request #2770 from lucas-clemente/key-update-error
use the KEY_UPDATE_ERROR
2020-09-14 14:01:43 +07:00
Marten Seemann
891c129024 Merge pull request #2769 from lucas-clemente/fix-dropping-of-key-phase-0
fix dropping of key phase 0
2020-09-14 14:00:37 +07:00
Marten Seemann
654ec69f7c Merge pull request #2777 from lucas-clemente/fix-tls-handshake-message-handling
fix handling of multiple handshake messages in the case of errors
2020-09-14 13:59:22 +07:00
Marten Seemann
3ef77b0c1a add an assertion that bytes_in_flight never becomes negative 2020-09-14 10:32:32 +07:00
Marten Seemann
c9bfde9ac0 fix handling of multiple handshake messages in the case of errors
When receiving a handshake message after another handshake messages that
doesn't cause any action from the TLS stack (i.e. Certificate and
CertificateVerify), the handshake would run into a deadlock if the first
of these handshake messages caused an error in the TLS stack.

We need to make sure that we wait until a message has been fully
processed before proceeding with the handshake.
2020-09-13 20:13:57 +07:00
Marten Seemann
8ea663d04a skip a packet number when sending a 1-RTT PTO packet 2020-09-11 11:16:48 +07:00
Marten Seemann
12c9427f43 save dummy packets in the packet history when skipping packet numbers 2020-09-11 11:01:30 +07:00
Marten Seemann
0044a69d73 also pass non-ack-eliciting packets to packet history (but don't save) 2020-09-11 11:01:29 +07:00
Marten Seemann
8f4257a883 delete unacknowledged packets from the packet history after 3 PTOs 2020-09-10 18:51:05 +07:00
Marten Seemann
8cb0570cb1 use the KEY_UPDATE_ERROR code when the peer updates keys too frequently 2020-09-10 18:14:33 +07:00
Marten Seemann
10797cfc79 add the KEY_UPDATE_ERROR error code 2020-09-10 18:14:33 +07:00
Marten Seemann
1dc629ad69 don't set a timer to drop keys for key phase 0 2020-09-10 15:18:05 +07:00
Marten Seemann
a87fdf1a7d fix debug log messages for key updates 2020-09-10 14:58:22 +07:00
Marten Seemann
854940cecc don't drop keys for key phase N before receiving a N+1-protected packet 2020-09-10 11:11:59 +07:00
Marten Seemann
67decc5df9 Merge pull request #2765 from lucas-clemente/log-key-retirements
log when an old 1-RTT key is retired
2020-09-10 10:23:02 +07:00
Marten Seemann
ca0f0a8ac2 Merge pull request #2757 from lucas-clemente/key-phase-error-on-successful-decryption
only return an invalid first key phase error for decryptable packets
2020-09-09 23:58:59 +07:00
Marten Seemann
074f5a202e log when old 1-RTT keys are dropped 2020-09-09 23:53:47 +07:00
Marten Seemann
dbaacd49bd add a logging event for dropping 1-RTT keys 2020-09-09 23:53:47 +07:00
Marten Seemann
9e1d65f4c9 Merge pull request #2764 from lucas-clemente/fix-local-key-update-logging
fix logging of locally initiated key updates
2020-09-09 23:52:52 +07:00
Marten Seemann
a44c4f517f Merge pull request #2747 from lucas-clemente/simplify-sent-packet-history
refactor RTT measurements to simplify the sentPacketHistory
2020-09-09 23:50:26 +07:00
Marten Seemann
ade2882ef4 fix logging of locally initiated key updates 2020-09-09 23:22:10 +07:00
Marten Seemann
d89a446243 Merge pull request #2752 from lucas-clemente/fix-0rtt-packets-dropping
fix dropping of 0-RTT packets
2020-09-09 23:20:03 +07:00
Marten Seemann
e0824e3163 move the logging mock implementations to a separate package 2020-09-09 15:15:49 +07:00
Marten Seemann
34c325919c only return an invalid first key phase error for decryptable packets 2020-09-07 21:12:54 +07:00
Marten Seemann
ad40c9cc83 fix dropping of 0-RTT packets 2020-09-07 16:00:16 +07:00
Marten Seemann
dc3d5618fc use a uint8 for the EncryptionLevel 2020-09-07 14:36:18 +07:00
Marten Seemann
c7af1dc045 refactor RTT measurements to simplify the sentPacketHistory 2020-09-06 14:16:11 +07:00
Marten Seemann
97b0b6d5c7 use GitHub Actions to run unit tests, disable AppVeyor 2020-08-28 20:14:44 +07:00
Marten Seemann
556bf18dbf inject a random source into the token protector 2020-08-23 17:06:17 +07:00
Marten Seemann
166d91ae0f fix typo in error message in sent packet handler 2020-08-21 13:31:02 +07:00
Marten Seemann
2c43716ee0 Merge pull request #2725 from lucas-clemente/fix-max-ack-delay-overflow
fix overflow of the max_ack_delay when parsing transport parameters
2020-08-20 22:50:38 +07:00
Marten Seemann
d476067f65 fix overflow of the max_ack_delay when parsing transport parameters 2020-08-20 13:49:33 +07:00
Marten Seemann
154f434be8 regenerate the testdata certificate with SAN instead of CommonName
As required by Go 1.15.
2020-08-20 13:48:48 +07:00
Marten Seemann
125318d9c9 add support for Go 1.15 2020-08-20 13:33:33 +07:00
Marten Seemann
977dbc828c move all dependencies on qtls to a separate package 2020-08-18 14:26:23 +07:00
Marten Seemann
524da2213c remove redundant qtls-related type conversions 2020-08-18 14:22:24 +07:00
Marten Seemann
2593b1af81 add fuzzing for transport parameters 2020-08-18 11:54:28 +07:00