1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-10 21:22:20 +03:00
Commit Graph

29 Commits

Author SHA1 Message Date
Sharad Jaiswal (Eng)
328c78d0e2 Add received packets timestamps to AckState
Summary:
Store timestamps/packet numbers of recently received packets in AckState.

 - The maximum number of packets stored is controlled by kMaxReceivedPktsTimestampsStored.
- The packet number of entries in the deque is guarenteed to increase
   monotonically because an entry is only added for a received packet
  if the packet number is greater than the packet number of the last
  element in the deque (e.g., entries are not added for packets that
  arrive out of order relative to previously received packets).

Reviewed By: bschlinker

Differential Revision: D37799023

fbshipit-source-id: 3b6bf2ba8ea15219a87bbdc2724fe23eebe66b70
2022-11-15 20:14:57 -08:00
Konstantin Tsoy
22a1e9fcc6 check cursor size in tryParseLongHeader()
Reviewed By: mjoras

Differential Revision: D35763458

fbshipit-source-id: 68747ed26cf896c4d3a3087dd30d4ab4c33be180
2022-04-22 12:05:51 -07:00
Konstantin Tsoy
3e6af08a0f Separate QuicReadCodec::parseLongHeaderPacket() into two functions
Summary: Separate QuicReadCodec::parseLongHeaderPacket() into two functions

Reviewed By: mjoras

Differential Revision: D33959155

fbshipit-source-id: 8f3f76ab6ef44ffa4ae6c7aecbe3c734aab97f0e
2022-02-07 22:14:09 -08:00
Konstantin Tsoy
7fe3976461 Make connIdToHex() const
Summary: Make connIdToHex() const

Reviewed By: hanidamlaj

Differential Revision: D33946464

fbshipit-source-id: 56f2f8e25119bf0833e29077101bb94b00cd59ab
2022-02-07 22:14:09 -08:00
Hani Damlaj
00e67c1bf9 mvfst License Header Update
Reviewed By: lnicco

Differential Revision: D33587012

fbshipit-source-id: 972eb440f0156c9c04aa6e8787561b18295c1a97
2022-01-18 13:56:12 -08:00
Hani Damlaj
2660a288b3 Update Company Name
Summary: - as title

Reviewed By: lnicco

Differential Revision: D33513410

fbshipit-source-id: 282b6f512cf83b9abb7990402661135b658f7bd1
2022-01-13 12:07:48 -08:00
Hani Damlaj
da36437098 Remove packetNum From CipherUnavailable
Summary:
- Removed packetNum field from CipherUnavailable struct.

- Removed all instances referring to the field and fixed tests accordingly.

Reviewed By: mjoras

Differential Revision: D29968168

fbshipit-source-id: 9802b8cd66f43f2a8d54340f2d00639ee4679aaf
2021-08-04 12:13:21 -07:00
Matt Joras
003f012cb7 TODO comment cleanup.
Summary:
These are either no longer relevant, are unlikely to be done, or are spculative enough that they don't deserve code space.

Hope here is to make our search for TODOs higher signal.

Reviewed By: lnicco

Differential Revision: D29769792

fbshipit-source-id: 7cfa62cdc15e72d8b7b0cd5dbb5913ea3ca3dc5a
2021-07-20 10:27:32 -07:00
Fei Wang
098b8108b5 Use constant-time memory comparison to avert side-channel crypto cracking
Summary: Replace memcmp by fizz::CryptoUtils::equal in QuicReadCodec.cpp

Reviewed By: mjoras

Differential Revision: D27739419

fbshipit-source-id: 13696480ccada7ad715d005a04ba8a020ad06299
2021-04-13 20:47:21 -07:00
Andres Suarez
05d07cbfd0 Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25849213

fbshipit-source-id: a2a538230e769b2c328ae3dd0a19dfbfd693fe3b
2021-01-09 15:39:52 -08:00
Matt Joras
42bba01005 Draft-29 support.
Summary:
This implements the connection ID validation via transport parameters. Note we don't do anything with the retry transport parameter yet.

This will probably require further surgery to tests when we want the MVFST version to do this, but for now I'm punting on that test plumbing.

This retains support for h3-27.

Reviewed By: yangchi

Differential Revision: D22045631

fbshipit-source-id: e93841e734c0683655c751d808fd90b3b391eb3e
2020-06-16 17:05:41 -07:00
Yang Chi
69a9e94252 StatelessReset parsing fix
Summary:
(1) Only read out the token if the parsing host is a client and the
token matches client's token
(2) More fallbacks to Stateless reset when parsing short header packet. The
only exception would be when we don't have 1-rtt cipher.

Reviewed By: mjoras

Differential Revision: D21868631

fbshipit-source-id: 159edf7ab21061ddd5a5ef17f6b18209c3de24e7
2020-06-03 17:44:58 -07:00
Matt Joras
50d5c29346 Cipher dropping take 2
Summary:
Now we won't have a zero PTO and we will properly clear out the outstanding packets.

Note that this cipher dropping is not what the draft prescribes, instead dropping both the initial and handshake ciphers when we know 1-rtt communication is functioning.

Reviewed By: yangchi

Differential Revision: D20388737

fbshipit-source-id: 0b89eb80c8faa796ab09eda3eaa10a00dcf7bae9
2020-05-06 11:14:20 -07:00
Aman Sharma
a84d2e5fcb Make client use new stateless retry
Summary: This makes the change for the client to use stateless retries

Reviewed By: mjoras

Differential Revision: D19657433

fbshipit-source-id: d4b34087d15e49153860a7833ed54e28c6cd6777
2020-04-08 20:58:41 -07:00
Aman Sharma
bf1cecdd40 Add a new "RetryPacket" type
Summary: This diff adds a new RetryPacket type, without changing any existing functionality.

Reviewed By: mjoras

Differential Revision: D19631435

fbshipit-source-id: 227864ee8f276fe4c593d5aa37209ca77267310d
2020-04-06 14:16:50 -07:00
Matt Joras
61cd1a7289 Back out "Implement handshake done and cipher dropping."
Summary: This caused an increase in client errors.

Reviewed By: yangchi, lnicco

Differential Revision: D20186386

fbshipit-source-id: 737122a94c97498efba61292a6c292cfe482925c
2020-03-01 18:31:40 -08:00
Matt Joras
472e40a902 Implement handshake done and cipher dropping.
Summary: This implements the handshake done signal and also cipher dropping.

Reviewed By: yangchi

Differential Revision: D19584922

fbshipit-source-id: a98bec8f1076393b051ff65a2d8aae7d572b42f5
2020-02-27 12:25:52 -08:00
Subodh Iyengar
e524c0c069 iobufqueue diediedie
Summary:
Don't use IOBufQueue for most operations in mvfst and use BufQueue instead. Since BufQueue did not support a splitAtMost, added it in instead.

The only place that we still use IOBufQueue is in crypto because fizz still requires it

Reviewed By: mjoras

Differential Revision: D18846960

fbshipit-source-id: 4320b7f8614f8d2c75f6de0e6b786d33650e9656
2019-12-06 12:06:44 -08:00
Subodh Iyengar
17ee9aade0 dont clone during decode
Summary:
Don't clone during decoding a stream frame.

This uses a BufQueue to manage the data instead of passing around cursors.

Reviewed By: yangchi

Differential Revision: D18827718

fbshipit-source-id: 7874d308bb5f43b983b9965b2862e733a2107039
2019-12-05 14:15:11 -08:00
Subodh Iyengar
7396fb3b46 make inplace decryption work
Summary:
Avoid using an iobufqueue for the read buffers so that the iobuf that we pass to fizz
will be unshared. This will allow for inplace decryption of data.

Reviewed By: yangchi

Differential Revision: D17769679

fbshipit-source-id: eb7a54828fb82c9e77cfb65284d43a6d0794bab0
2019-10-05 09:23:03 -07:00
Subodh Iyengar
322eb2ebc4 remove codecresult variant
Summary: remove the variant for codec result and replace it with a custom variant type

Reviewed By: yangchi

Differential Revision: D17247099

fbshipit-source-id: 19e24c14732eb6e8496aee7064f20c48bdf254e0
2019-09-30 17:02:24 -07:00
Viktor Chynarov
7c578e2d98 zero-length client connection id support
Summary:
Allow the client to set zero-length id for itself.
If enabled, saves 8 bytes (if packet isn't padded to minimum).
However, will be disabled if connection migration is enabled.

Main changes include updating the short header parsing to pass
in the connection id length, since unlike long headers,
short header's dst conn id isn't preceeded by length.

Created a new `QuicClientTransportAfterStartTestBase` class
to move `testing::WithParamInterface<>` inheritance to subclasses.
(Only one parameter per test class).

Reviewed By: JunqiWang

Differential Revision: D17188777

fbshipit-source-id: f60a7f3c07da1a8c83cec5b518075d23daedbe44
2019-09-23 15:01:43 -07:00
Subodh Iyengar
6f6ed4d56e remove variant type for QuicPacket
Summary:
Remove the variant type for RegularQuicPacket and VersionNegotiationPacket.

This allows us to move version negotiation parsing to be only used on the client and only done explicitly
before a version is negotiated.

Reviewed By: yangchi

Differential Revision: D17242788

fbshipit-source-id: 502caf6849f0b7e6778f1470dc160d01f17a33af
2019-09-19 17:31:47 -07:00
Matt Joras
15fbe5106c Explicit stream frame types
Summary:
Prior to this we had an incorrect check for something being a stream frame. It technically should have worked for minimally encoded frame types, but would not work for a spec-incompliant frame type.

Instead of using a mask this makes it so each stream frame type is explicitly enumerated. This isn't as clean looking but is easier to validate as correct.

This also revealed some places where we were not correctly plumbing through the version for unit tests, so fixing those as a driveby.

Reviewed By: yangchi

Differential Revision: D16676631

fbshipit-source-id: 835dcc6e1f431bbe3fa4a5c6b8e616863c126155
2019-08-08 09:02:03 -07:00
Amaury Séchet
f26cd1f62d Add a bridge to fizz::Aead (#12)
Summary:
This introduce quic::Aead as a simple typedef to fizz::Aead and update the codebase to use quic::Aead . This should not impact the functionality of the code in any way.

This is a first step toward introducing an interface that is specific for mvfst so that mvfst can swap fizz for something else.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/12

Reviewed By: JunqiWang

Differential Revision: D15335324

Pulled By: mjoras

fbshipit-source-id: fef166a9a5c2cbae08ad9511d0abd749f330c221
2019-05-29 11:54:08 -07:00
Yang Chi
3b91611c76 No need to have override-include-guard in cpp file
Summary:
i think QuicReadCodec.cpp used to be a inline header file and that's
why this guard is there. No need to have it any more.

Reviewed By: siyengar

Differential Revision: D15261505

fbshipit-source-id: b634b2ab1ce62646cbf1f10ca5545778478d249f
2019-05-08 11:27:55 -07:00
Udip Pant
4a9537798e Add correct license headers on some missing files
Summary: ^

Reviewed By: sharma95

Differential Revision: D15172546

fbshipit-source-id: bacc832752a433b86962e77bb19aff4504640e60
2019-05-01 22:42:04 -07:00
Udip Pant
a9bfa9be21 wrap folly::none with 'CodecResult' in ReadCodec
Summary: Fix for issue https://github.com/facebookincubator/mvfst/issues/1

Reviewed By: siyengar

Differential Revision: D15172405

fbshipit-source-id: 3e935ae42e445ae605b8e55e080ff7502bafaa83
2019-05-01 22:42:03 -07:00
udippant
50d4939e9e Initial commit of mvfst 2019-04-22 23:42:46 -07:00