Commit Graph

247 Commits

Author SHA1 Message Date
Mark Spanbroek 1b5f5c8a25 check initial packet 2020-10-08 14:31:15 +02:00
Mark Spanbroek 0296d4a1c7 Set different IP addresses and ports for client and server 2020-10-08 14:31:15 +02:00
Mark Spanbroek d7c5628131 Signal handshake complete 2020-10-08 14:31:15 +02:00
Mark Spanbroek 8911311b2d Supply more crypto data 2020-10-08 14:31:15 +02:00
Mark Spanbroek 3f9d9050df Add AEAD overhead 2020-10-08 14:31:15 +02:00
Mark Spanbroek bd32d3ecd9 Correct connection id exchange 2020-10-08 14:31:15 +02:00
Mark Spanbroek a73536c10f Add monotonic clock for packet timestamps 2020-10-08 14:31:15 +02:00
Mark Spanbroek aae030c634 Use fake header protection mask 2020-10-08 14:31:15 +02:00
Mark Spanbroek cd8b40a47a Use matching client and server connection ids 2020-10-08 14:31:15 +02:00
Mark Spanbroek 75e9c53422 Fix: initialize server with ngtcp2_conn_server_new 2020-10-08 14:31:15 +02:00
Mark Spanbroek 79eca562f8 Remove faulty dummyPath() 2020-10-08 14:31:15 +02:00
Mark Spanbroek b0cd50b5df Add logging 2020-10-08 14:31:15 +02:00
Mark Spanbroek d1c665fedb Add test that sets up a client and a server connection
Inspiration mostly from:
dfe3771dbb/tests/ngtcp2_conn_test.c (L502)
2020-10-08 14:31:15 +02:00
Mark Spanbroek 6fc8545556 Fix: version negotiation packets contain a list of supported versions 2020-10-01 17:50:03 +02:00
Mark Spanbroek aa36dbba42 Fix: packet length includes both packet number and payload 2020-10-01 14:02:00 +02:00
Mark Spanbroek 015ebf54f3 Setup reading tests using write proc 2020-10-01 14:02:00 +02:00
Mark Spanbroek d8305fee37 Use new packet initialization procs 2020-10-01 14:02:00 +02:00
Mark Spanbroek c9b22da04b Introduce procs that create packet types with default version 2020-10-01 14:02:00 +02:00
Mark Spanbroek 9684e81776 Read multiple packets from a packet stream 2020-09-30 09:30:39 +02:00
Mark Spanbroek 4896ba6ed9 Return the number of bytes that were written 2020-09-30 09:30:39 +02:00
Mark Spanbroek 842db30753 Write multiple consecutive packets into a datagram 2020-09-30 09:30:39 +02:00
Mark Spanbroek a85eff895d Split large test file 2020-09-30 09:30:39 +02:00
Mark Spanbroek 49d9fb6013 Remove 'version' getter and setter from public api 2020-09-30 09:20:32 +02:00
Mark Spanbroek eeac07b11b Determine the length of a short packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 03afb8f5a4 Read payload from short packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 8422282203 Read packet number from short packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek b8832cc6d8 Read destination id from short packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 6e56d16c0d Read spin bit and key phase from short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 10b69064ee Write payload of short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek c9534fcd61 Write destination and packet number for short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek acfe147dea Introduce PacketShort for short packet specific fields 2020-09-30 09:20:32 +02:00
Mark Spanbroek 21589b99d6 Write key phase for short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 1d250c9715 Write reserved bits for short header 2020-09-30 09:20:32 +02:00
Mark Spanbroek 77e3a39e2f Write spin bit for short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 2cb6762c98 Determines length of an initial packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 349588c9ac Read packet number and payload for initial packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 0f6488b457 Read token from initial packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 23b99d1256 Write packet number and payload for initial packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek bd41269179 Write token for initial packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 2039a8d66e Determines length of 0-RTT packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek df51a50181 Read packet number and payload for 0-RTT packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek ae5646ffb2 Write packet number and payload for 0-RTT packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 62422a610e Determines length of a handshake packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek ccb590032c Write handshake payload 2020-09-30 09:20:32 +02:00
Mark Spanbroek 0ebb0dad4d Extract proc that converts packet numbers to bytes 2020-09-30 09:20:32 +02:00
Mark Spanbroek 356b8fd8a9 Write packet number for handshake packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek e8c3d2083e Fix typo 2020-09-30 09:20:32 +02:00
Mark Spanbroek 81a904b5f0 Read payload from handshake packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek fa70844b51 Read packet number for handshake packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek ac3e79f24b Read token and integrity tag from retry packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 81fe228e69 Writes retry integrity tag 2020-09-30 09:20:32 +02:00
Mark Spanbroek 0ca1440bd8 Writes retry token 2020-09-30 09:20:32 +02:00
Mark Spanbroek 37d2e0364b Determines length of a retry packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 1e748a4719 Decoding of variable length integers 2020-09-30 09:20:32 +02:00
Mark Spanbroek 5f94cf733b Variable length encoding of integers 2020-09-30 09:20:32 +02:00
Mark Spanbroek 60af5afb2e Rename: packetLength -> len 2020-09-30 09:20:32 +02:00
Mark Spanbroek 0f7d8e1a26 Writes supported version 2020-09-30 09:20:32 +02:00
Mark Spanbroek a2d0be717f Write source and destination id 2020-09-30 09:20:32 +02:00
Mark Spanbroek 1c20c08f55 Restructure tests to fit the restructured implementation 2020-09-23 15:04:49 +02:00
Mark Spanbroek afcf424e47 Rename: header -> packet 2020-09-23 15:04:49 +02:00
Mark Spanbroek df754f0ee3 Replace byte indexing by stews/endians2 2020-09-23 15:04:49 +02:00
Mark Spanbroek 1c4c8528ca Remove newShortPacket() 2020-09-23 15:04:49 +02:00
Mark Spanbroek 5158cd8bd3 Rename newPacket -> readPacket 2020-09-23 15:04:49 +02:00
Mark Spanbroek ffa84467ca Use auto-generated conversion to string 2020-09-23 15:04:49 +02:00
Mark Spanbroek 84e5e999ad Rename: PacketHeader -> Packet 2020-09-23 15:04:49 +02:00
Mark Spanbroek 56cf34176a Move version to only those header kinds that have it 2020-09-23 15:04:49 +02:00
Mark Spanbroek c9df11db01 Introduce separate objects for each kind of long packet 2020-09-23 15:04:49 +02:00
Mark Spanbroek d1b461dca1 Convert 'supportedVersion' to a field in PacketHeader object 2020-09-23 15:04:49 +02:00
Mark Spanbroek 7476645b51 Convert 'destination' to a field of PacketHeader object 2020-09-23 15:04:49 +02:00
Mark Spanbroek cefaf7da15 Re-introduce PacketHeader.form
Rationale: we need to introduce destination and source addresses,
and these are only valid in the long form.
2020-09-23 15:04:49 +02:00
Mark Spanbroek 35c1ba1ab4 Write correct fixed bit 2020-09-23 15:04:49 +02:00
Mark Spanbroek 46a561fb95 Convert 'kind' to a field of the PacketHeader object 2020-09-23 15:04:49 +02:00
Mark Spanbroek 9d8faab582 Replace .bytes getter by proc that writes to datagram 2020-09-23 15:04:49 +02:00
Mark Spanbroek 5c1a4b2cef Setup datagram for testing 2020-09-23 15:04:49 +02:00
Mark Spanbroek 66f2a44545 Combine HeaderForm and PacketKind enums into a single enum 2020-09-23 15:04:49 +02:00
Mark Spanbroek 9ebba09f91 QUIC version is only present in long packets 2020-09-23 15:04:49 +02:00
Mark Spanbroek 4afd62bcb8 Conversion of version negotiation packet to string 2020-09-23 15:04:49 +02:00
Mark Spanbroek 329513fdde Supported version field for version negotation packets 2020-09-23 15:04:49 +02:00
Mark Spanbroek f54f7a4f3b Length of version negotiation packet 2020-09-23 15:04:49 +02:00
Mark Spanbroek f9de4befa9 Represent connection ids as hex strings 2020-09-17 20:35:01 +02:00
Mark Spanbroek f812007a25 Convert packet header to string 2020-09-17 20:35:01 +02:00
Mark Spanbroek 2e239864c7 Source connection id 2020-09-17 20:35:01 +02:00
Mark Spanbroek 64ec610906 Remove duplication in tests 2020-09-17 20:35:01 +02:00
Mark Spanbroek 117c5ca57d Destination connection id 2020-09-17 20:35:01 +02:00
Mark Spanbroek fe391af848 Packet types `Initial`, `0-RTT`, `Handshake` and `Retry` 2020-09-17 20:35:01 +02:00
Mark Spanbroek c8f1205116 Recognize version negotiation packets 2020-09-17 20:35:01 +02:00
Mark Spanbroek 9ea715662b Add QUIC version to packet header 2020-09-17 20:35:01 +02:00
Mark Spanbroek 84ab75184c Set individual bytes in a uint32 using MSB 0 indexing 2020-09-17 20:35:01 +02:00
Mark Spanbroek d2d590ada3 Rename: kind -> form
"Header Form" is the term from the QUIC spec
2020-09-17 20:35:01 +02:00
Mark Spanbroek 29d7b5cb7c Ensure that second bit of the header is always 1 2020-09-17 20:35:01 +02:00
Mark Spanbroek db9febbb19 Store its kind in the first bit of the header 2020-09-17 20:35:01 +02:00
Mark Spanbroek 0ca8fd9f27 Put all tests in suites 2020-09-17 20:35:01 +02:00
Mark Spanbroek 63f61b2c72 Add operations for setting bits using MSB 0 indexing
The QUIC spec (and all other RFC's) use MSB 0 indexing.
2020-09-17 20:35:01 +02:00
Mark Spanbroek ce52086d4e Add PacketNumber 2020-09-17 20:35:01 +02:00
Mark Spanbroek 24cc943dfb Add PacketHeader 2020-09-17 20:35:01 +02:00
Mark Spanbroek 6f7d29fc65 Add dependency on ngtcp2 2020-09-07 16:32:28 +02:00
Mark Spanbroek 5936c89813 Project setup 2020-09-03 10:05:46 +02:00