1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-24 04:01:07 +03:00
Commit Graph

57 Commits

Author SHA1 Message Date
Joseph Beshay
b45c82b884 ACK_EXTENDED frame support
Summary:
This introduces a new frame type for acks (ACK_EXTENDED) that can carry optional fields depending on the features supported by the peer. The currently supported features set will include ECN count fields, and Receive Timstamp fields. This enables a quic connection to report both ECN counts and receive timestamps, which is not possible otherwise because they use different frame types.

Support for the extended ack as well as the set of features that can be included in it is negotiated through a new transport parameter (extended_ack_supported = 0xff0a004). Its value indicates which features are supported by the local transport. The value is an integer which is evaluated against the following bitmasks:
```
  ECN_COUNTS = 0x01,
  RECEIVE_TIMESTAMPS = 0x02,
```

This diff introduces the transport parameter and negotiates the supported features between the peers of the connection. The parameter is cached in the psk cache so the client can remember the server config. It is also encoded inside the 0-rtt ticket so the server can reject it if its local config has changed.

The following diffs add reading and writing the frame itself.

The ACK_EXTENDED frame itself will have the following format
```
ACK_EXTENDED Frame {
  Type (i) = 0xB1
  // Fields of the existing ACK (type=0x02) frame:
  Largest Acknowledged (i),
  ACK Delay (i),
  ACK Range Count (i),
  First ACK Range (i),
  ACK Range (..) ...,
  Extended Ack Features (i),
  // Optional ECN counts (if bit 0 is set in Features)
  [ECN Counts (..)],
  // Optional Receive Timestamps (if bit 1 is set in Features)
  [Receive Timestamps (..)]
}

// Fields from the existing ACK_ECN frame
ECN Counts {
  ECT0 Count (i),
  ECT1 Count (i),
  ECN-CE Count (i),
}

// Fields from the existing ACK_RECEIVE_TIMESTAMPS frame
Receive Timestamps {
  Timestamp Range Count (i),
  Timestamp Ranges (..) ...,
}

Timestamp Range {
  Gap (i),
  Timestamp Delta Count (i),
  Timestamp Delta (i) ...,
}
```

Reviewed By: sharmafb

Differential Revision: D68931151

fbshipit-source-id: 44c8c83d2f434abca97c4e85f0fa7502736cddc1
2025-02-24 12:32:50 -08:00
Aman Sharma
ae011587d5 Add reliable_stream_reset transport parameter
Summary: This diff adds the reliable_stream_reset transport parameter to mvfst.

Reviewed By: hanidamlaj

Differential Revision: D65383676

fbshipit-source-id: cb2f6a1a90004ea489447b67ed3cfc12ca90b804
2024-12-17 11:53:15 -08:00
Ilango Purushothaman
17b8763bd0 Cache Ack Rx timestamps transport settings in PSK cache for 0-rtt
Summary:
Ack Rx timestamps are currently disabled on 0-rtt connections, which is enabled on mvfst for all non-video connections.

This is because the timestamp config is negotiated with transport settings during handshake which doesn't happen on a new 0-rtt connection (resumption).

Solution:
Store the peer's rx timestamp config in PSKCache on the client. On 0-rtt resumption of the connection, this peer config is restored and used to send Rx timestamps (if enabled).

Note that if the server had changed its timestamp config during this period (through configerator) then the server needs to reject this 0-rtt connection and start anew. Server code changes to support this will be in a followup diff. With this client diff though,  server will drop the Rx timestamps if its own config is suddenly disabled (this is a waste of network resource).

Reviewed By: jbeshay

Differential Revision: D58572572

fbshipit-source-id: d95720c177ac4bc8dcbe40362f19b279b3f8e708
2024-06-14 23:06:39 -07:00
Matt Joras
aefc9e369b Introduce quic::Optional
Summary:
The idea here is to make it so we can swap out the type we are using for optionality. In the near term we are going to try swapping towards one that more aggressively tries to save size.

For now there is no functional change and this is just a big aliasing diff.

Reviewed By: sharmafb

Differential Revision: D57633896

fbshipit-source-id: 6eae5953d47395b390016e59cf9d639f3b6c8cfe
2024-06-11 11:02:02 -07:00
Joseph Beshay
004ba6f75e Ensure psk is removed from the client cache when the early data paramters don't match the ones from the handshake
Summary:
If early data is rejected and the tls parameters that we used from the 0-rtt ticket do not match the ones in the current handshake, the connection cannot continue.

Previously, the connection would fail but the psk still stayed in the client cache. This meant that subsequent retries could still attempt zero rtt and hit the same error repeatedly.

This change moves the decision to close the connection to the QuicClientTransport instead of the FizzClientHandshake so it can remove the "bad" psk from the pskCache.

Reviewed By: kvtsoy

Differential Revision: D57398519

fbshipit-source-id: b1c076794b9b16954ec23474bffc5a0be7e11090
2024-05-17 11:03:04 -07:00
Lin Huang
8615a74572 Remove psk_cache dependency from quic/client:state_and_handshake
Reviewed By: JunqiWang

Differential Revision: D54432173

fbshipit-source-id: 3ef1d3958d148acbf4d732ea5026d0c897b7fc90
2024-03-04 15:10:09 -08:00
Joseph Beshay
c515c223e2 Key update support: Client response to key updates [2/x]
Summary: This implements the necessary functions for key update in the ClientHandshake, and adds the logic for updating the write cipher in the client transfer whenever a successful key update is detected by the  read codec.

Reviewed By: mjoras

Differential Revision: D53016558

fbshipit-source-id: 59123cddec97ee5eb204b8816e7c844b22055008
2024-02-01 15:41:27 -08:00
Hani Damlaj
a17a25d08a ::getServerTransportParams signature change
Summary:
change signature of both `ClientHandshake::getServerTransportParams` & `ClientTransportParametersExtension::getServerTransportParams`

from:
```
folly::Optional<ServerTransportParameters> getServerTransportParams()
```
to:
```
const folly::Optional<ServerTransportParameters>& getServerTransportParams()
```

previously this would `std::move(serverTransportParameters_)` after reading it, effectively making it possible to only read the value once.

Reviewed By: kvtsoy

Differential Revision: D48356933

fbshipit-source-id: deddd9101979c1ef30d540b67216dc9611ced713
2023-08-17 15:37:50 -07:00
Joseph Beshay
4097c5c4c3 Decide whether to send knob frames based upon the transport parameter only and cache it for 0-rtt connections
Summary:
This removes the older method of deciding whether knob frames should be sent using the QuicVersion. With this change, the client can only send knobs when the server has signaled support using the `knob_frames_supported` transport parameter.

To make sure that knobs can be sent in 0-rtt connections, the transport parameter is now included in the client's cache of server transport parameters.

Reviewed By: mjoras

Differential Revision: D43014893

fbshipit-source-id: 204dd43b4551cd1c943153a3716e882fc80e6136
2023-02-07 18:06:27 -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
Matt Joras
7402dbe6c9 Move zero RTT ciphers to client state.
Summary: As in title, this doesn't need to be in the base state.

Reviewed By: JunqiWang

Differential Revision: D29855140

fbshipit-source-id: 8d3a4b12fd6b93b2277020d56862915e084f1c05
2021-07-23 14:21:16 -07:00
Yang Chi
38c903ba2f Remove all QUIC_TRACEs
Summary: no longer used

Reviewed By: lnicco

Differential Revision: D28141008

fbshipit-source-id: 870d6574cc1657914a08f1ef5ee581cfef96aad1
2021-05-10 12:46:08 -07:00
Matt Joras
fc4e7a7405 Remove MVFST_D24 from client.
Summary: Keep on server for now but disallow it in code for the client.

Reviewed By: yangchi

Differential Revision: D27726584

fbshipit-source-id: c567d9db82c36b6e60d438d839709f0330b8db50
2021-04-13 10:11:47 -07:00
Matt Joras
d9d2d29af6 Buffer packets on the client when we don't have ciphers.
Summary:
This can happen when we don't get the server handshake data in time, but it is especially bad with 0RTT when it is potentially a full flight of 1RTT data that is dropped while we wait for the handshake PTO.

Note this leverages the existing CipherUnavailable mechanism, but processes them in a much more simple way than the server side. Additionally, only 1-RTT packets need to be buffered.

Reviewed By: yangchi, lnicco

Differential Revision: D27634184

fbshipit-source-id: db5ba0b9f07176d106f709c7a11d83d0fc8281b7
2021-04-08 16:38:53 -07:00
Matt Joras
95d45b73a8 Fix warning log condition.
Summary: This was just totally wrong. It's expected that we'll get multiple confirmations for the client sometimes, since either a HandshakeDone or 1-rtt ACK can confirm.

Reviewed By: lnicco

Differential Revision: D26321808

fbshipit-source-id: c7477ce727392e71b78f046be4b49170098d04af
2021-02-10 13:20:13 -08:00
Aman Sharma
0b548c4140 Change client handshake to use FizzRetryIntegrityTagGenerator and PseudoRetryPacketBuilder
Summary: This switches the client to use the FizzRetryIntegrityTagGenerator and the PseudoRetryPacketBuilder, to avoid duplication of a lot of the work.

Reviewed By: mjoras

Differential Revision: D21489881

fbshipit-source-id: 8aa3af26f1090eeb9f2f04eb4defd785ad555df1
2020-11-05 21:24:44 -08:00
Yang Chi
9a58131713 Put WARNING log in handshakeConfirmed behind version check
Summary: in draft-24, we do not drop handshake key, which means we keep triggering this warning log over and over

Reviewed By: mjoras

Differential Revision: D24070227

fbshipit-source-id: 25a3e5c479c3f3c958d59ccc9d8453fc35ca2d26
2020-10-01 20:24:01 -07:00
Amaury Séchet
1d4d67c075 Add belt and suspender for the client crypto implementation (#182)
Summary:
There is a pretty tight coupling between ClientHandshake and FizzClientHandshake . The later can mess up pretty bad with the former's state, especially since th code has quite a lot of temporal dependencies and is very stateful.

This constraint he API through which the subclass can interact with the parent class and prevent some obviously bad misuses. It also make it clear when something is to made available for testing exclusively.

Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/182

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

 ---
## Traffic Canary
https://our.intern.facebook.com/intern/traffic/canary?fbid=119893296332660
* elb.prod.hel3c01 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/q948xh5b
* flb.prod.fgdl1c03 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/1p582qcv
* olb.prod.rftw0c01.p2 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/h23ldteg
* slb.prod_regional.rash0c00 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/6cjn5fxn
* slb.regional.rash0c01.p2 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/kadbkkdf
 ---

Reviewed By: mjoras

Differential Revision: D23816801

Pulled By: bschlinker

fbshipit-source-id: 52c7fa3e3f436d3317f2a13bef8ae4d596f6a25b
2020-09-25 09:01:12 -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
Matt Joras
524bf84c44 Implement an explicit inplace encrypt in Aead.
Summary: This is useful when you want to ensure that the IOBuf you pass in is encrypted inplace, as opposed to potentially creating a new one.

Reviewed By: yangchi

Differential Revision: D21135253

fbshipit-source-id: 89b6e718fc8da1324685c390c721a564bb77d01d
2020-04-21 21:43:59 -07:00
Aman Sharma
918574c6eb Functionality to verify retry integrity token
Summary: This adds the ability to verify the integrity token present in a retry packet, as per section 5.8 of the QUIC-TLS draft (https://fburl.com/kw9l8dvu). This doesn't change any existing functionality.

Reviewed By: mjoras

Differential Revision: D19631864

fbshipit-source-id: 2ff8288986b3e27c85fe885b132ab6753fed3be8
2020-04-08 13:07:14 -07:00
Amaury Séchet
fb0b6b1cc4 Move fizz specific part of the client in quic/fizz/client (#120)
Summary:
This create a separate library for the fizz client. This allows complete separation of the fizz part of the client, and make it swapable for something else.

Depends on https://github.com/facebookincubator/mvfst/issues/118
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/120

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=528194164778784
* elb.prod.muc2c01 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/ywntlz9n
* flb.prod.fceb2c02 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/ns1vzm1j
* olb.prod.ratn0c01.p2 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/0vxebqop
* slb.prod_regional.rnao0c00 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/a8syav0w
* slb.regional.rvll0c01.p2 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/igneyshj
 ---

Reviewed By: mjoras

Differential Revision: D20769060

Pulled By: yangchi

fbshipit-source-id: ad5d66c23b3a9723ad3f8c8091981df99339761e
2020-04-06 11:43:31 -07:00
Amaury Séchet
dba77af4fd Move onNewCachedPsk down to FizzClientHandshake (#118)
Summary:
This is the last step toward separating fizz from the generic client code.

Depends on https://github.com/facebookincubator/mvfst/issues/114
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/118

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=653014055531081
* elb.prod.arn2c01 - binary - 2020-04-01 11:39 - https://fburl.com/dyndash/mn1jjuu2
* flb.prod.fcgh39c01 - binary - 2020-04-01 11:39 - https://fburl.com/dyndash/xqxjihp8
* olb.prod.rrva0c01.p2 - binary - 2020-04-01 11:39 - https://fburl.com/dyndash/tgvjvt8x
* slb.prod_regional.rlla0c00 - binary - 2020-04-01 11:39 - https://fburl.com/dyndash/3v0a34l3
* slb.regional.rprn0c01.p2 - binary - 2020-04-01 11:39 - https://fburl.com/dyndash/vhzk6mp2
 ---

Reviewed By: yangchi

Differential Revision: D20748840

Pulled By: mjoras

fbshipit-source-id: 02ef07d2561e09196b0cb5bb7d22ffe7cb807fcf
2020-04-01 12:43:32 -07:00
Amaury Séchet
8efe70e953 Move getPsk uses down to FizzClientHandshake (#114)
Summary:
This is fizz dependent so it belong there.

Depends on https://github.com/facebookincubator/mvfst/issues/109 , https://github.com/facebookincubator/mvfst/issues/111 and https://github.com/facebookincubator/mvfst/issues/117
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/114

Reviewed By: mjoras

Differential Revision: D20535928

Pulled By: yangchi

fbshipit-source-id: b2b99aed45e05014f24664f9e14b57241492da19
2020-03-25 08:48:50 -07:00
Amaury Séchet
6c115007ab Do post connect update of cached server params in the handshake rather than the transport (#113)
Summary:
The cache entry contains the key itself, which is fizz dependent and crypto agnostic infos. We are moving the crypto agnostic infos to the Handshake. Next step is to move the crypto specific infos to the proper handshake subclass.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/113

Reviewed By: mjoras

Differential Revision: D20469126

Pulled By: yangchi

fbshipit-source-id: 25db463ef8d0e982ef5e47ef147e7e9b6c859cb5
2020-03-24 15:13:31 -07:00
Amaury Séchet
9bb6772e69 Use a template method pattern for ClientHandshake::connect (#110)
Summary:
This ensures we have a place to plug things into the connect method that do not depend on the actual handshake implementation.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/110

Reviewed By: mjoras

Differential Revision: D20463305

Pulled By: yangchi

fbshipit-source-id: a46c23871ec1021712641fbef98399cd5036001a
2020-03-15 23:19:33 -07:00
Amaury Séchet
3a4a9fcdcb Reduce include surface using opque struct/class declarations (#108)
Summary:
As per title.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/108

Differential Revision: D20458098

Pulled By: mjoras

fbshipit-source-id: 503db8cbc617664ae27d230c9ce49b2fa8e8d1f3
2020-03-14 17:07:06 -07:00
Amaury Séchet
050a584a14 Move 1RTT write cipher to the handshake. (#102)
Summary:
This is a continuation of https://github.com/facebookincubator/mvfst/issues/101
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/102

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=3593373427403977
* elb.prod.bom1c01 - binary - 2020-03-14 13:18 - https://fburl.com/dyndash/yv327msu
* flb.prod.flhe3c01 - binary - 2020-03-14 13:18 - https://fburl.com/dyndash/h8l2uq4z
* slb.prod_regional.rash0c00 - binary - 2020-03-14 13:18 - https://fburl.com/dyndash/s44dmkr4
 ---

Differential Revision: D20398160

Pulled By: mjoras

fbshipit-source-id: d9e07fce83ba14c56f2dae217dea1b8f67bffa1f
2020-03-14 16:40:17 -07:00
Amaury Séchet
3c5a3a2420 Populate QuicReadCodec's cipher from the client's handshake directly (#101)
Summary:
This is a continuation of https://github.com/facebookincubator/mvfst/issues/98 and depends on it.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/101

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=1081862622194120
* elb.prod.eze1c01 - binary - 2020-03-12 08:37 - https://fburl.com/dyndash/7zk4wokz
* flb.prod.fgdl5c03 - binary - 2020-03-12 08:37 - https://fburl.com/dyndash/cp8fkdkc
* slb.prod_regional.rprn0c00 - binary - 2020-03-12 08:37 - https://fburl.com/dyndash/j1cfe45e
 ---

Differential Revision: D20398127

Pulled By: mjoras

fbshipit-source-id: 16a7f5fab193edb25c7d241ce34fa6e710cc014f
2020-03-12 16:05:35 -07:00
Amaury Séchet
ef5d39152f Move handshake write cipher to the handshake. (#98)
Summary:
This is similar to https://github.com/facebookincubator/mvfst/issues/97 and depends on it.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/98

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

 ---
## Proxygen Canary
* elb.prod.hkg3c01 - binary - 2020-03-09 20:15 - https://fburl.com/dyndash/in7s8dml
* flb.prod.fbsb8c02 - binary - 2020-03-09 20:15 - https://fburl.com/dyndash/cr6myln4
* slb.prod_regional.rvll0c00 - binary - 2020-03-09 20:15 - https://fburl.com/dyndash/jaj9flmq
* slb.regional.rcln0c01.p2 - binary - 2020-03-09 20:15 - https://fburl.com/dyndash/5ezx6w63
 ---

Reviewed By: mjoras

Differential Revision: D19873742

Pulled By: sharmafb

fbshipit-source-id: 1469e36781eb7d8a0b1bf74eca45864cf208dcbd
2020-03-11 11:34:42 -07:00
Amaury Séchet
63e9b70ce6 Move 0RTT cipher management to the handshake. (#97)
Summary:
Make sure that trigger on error is performed when running connect.

This avoids some bucket brigading around the connect function and helps to isolate QuicClientTransport pskCache management, reduce the memory footprint of the handhsake and reduce temporal coupling.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/97

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=212582886632633
* elb.prod.sof1c01 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/cu6glbvv
* flb.prod.fisb3c02 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/qaozda7o
* olb.prod.rlla0c01.p2 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/m7des08a
* slb.prod_regional.rfrc0c00 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/j2ftlr65
* slb.regional.rlla0c01.p2 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/98by8k4u
 ---

Reviewed By: mjoras

Differential Revision: D19873714

Pulled By: sharmafb

fbshipit-source-id: 7b0980e9d2590227bec5426560f5dd5d6a34ae85
2020-03-10 11:46:19 -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
Amaury Séchet
9fc727fb96 Pass QuicClientConnectionState down to ClientHandshake (#95)
Summary:
This is similar to https://github.com/facebookincubator/mvfst/issues/88 except that in this case, QuicClientConnectionState is actually needed to move forward.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/95

Reviewed By: yangchi

Differential Revision: D19816034

Pulled By: mjoras

fbshipit-source-id: a57b7a4732e3d7918369f8febbf63bce40d18a6c
2020-02-11 09:23:43 -08:00
Amaury Séchet
1cf32345ba Add throwOnError facility to ClientHandshake so sbclasses can check the error_ field. (#92)
Summary:
This is a first step in a series of refactoring moving the fizz specific parts of the psk cache management in FizzCientHandshake.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/92

Reviewed By: mjoras

Differential Revision: D19699174

Pulled By: yangchi

fbshipit-source-id: 99c11da4c97e2f19874c1cedb23751c2392296cb
2020-02-10 12:26:04 -08:00
Amaury Séchet
3c91a0ee24 Remove various unecessary inclusion of fizz headersin the client code. (#83)
Summary:
The reduce unnecessary exposure of common code to fizz and hopefully gets us one step closer to complete separation.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/83

Reviewed By: sharma95

Differential Revision: D19386615

Pulled By: udippant

fbshipit-source-id: fc00dfb06630be54a42bc51ea4ee2c1d64270229
2020-01-14 21:03:42 -08:00
Udip Pant
74f98d4604 Move the fizz code into its own package
Summary:
This moves the fizz specific part of the handshake into its own folder and library.

There is a bit of smurf naming going on as a result, not sure it is worth fixing or not at this stage. Maybe this code should be a in namespace named quic::fizz .

This should be doable with the client as well as soon as the key cache situation is figured out.
 ---
## Proxygen Canary

Reviewed By: yangchi

Differential Revision: D19290919

fbshipit-source-id: 48d7f7c70db42c65f7dffe3256805c268a481198
2020-01-09 20:59:54 -08:00
Yang Chi
5ff9e224bd De-boost::variant Fizz client and server Action type
Summary:
Replace them with home cooked union based variant type to remove boost
dependencies.

Reviewed By: siyengar

Differential Revision: D18445458

fbshipit-source-id: a1804bb2dc316128e36c90e7cb575b690c906409
2020-01-02 14:54:36 -08:00
Amaury Séchet
bef27f3dfa Move fizz::client::State down to FizzClientHandshake (#73)
Summary:
This is the anarchist patch of the day.

Depends on https://github.com/facebookincubator/mvfst/issues/72
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/73

Reviewed By: mjoras

Differential Revision: D18688624

Pulled By: yangchi

fbshipit-source-id: fd2eb81e6547076228ea4828cb192730916b7e68
2019-12-02 21:06:41 -08:00
Amaury Séchet
3fa06149bb Move getApplicationProtocol down (#72)
Summary:
Move things that depends on fizz down to FizzClientHandshake.

Depends on https://github.com/facebookincubator/mvfst/issues/71
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/72

Reviewed By: mjoras

Differential Revision: D18688622

Pulled By: yangchi

fbshipit-source-id: 54999355dfd907903d91bf9bc50239fb84ac2428
2019-11-27 23:51:41 -08:00
Amaury Séchet
ae4219774d Move cipher computation down to FizzClientHandshake (#69)
Summary:
This helps moving more fizz specific feature to FizzClientHandshake.

Depends on https://github.com/facebookincubator/mvfst/issues/65 .
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/69

Reviewed By: sharma95

Differential Revision: D18596584

Pulled By: mjoras

fbshipit-source-id: 9a4bc759177735f15d6813a2ad4826244d758fcd
2019-11-19 18:58:15 -08:00
Amaury Séchet
2d5fbf572b Move all use of fizz::client::ClientStateMachine into FizzClientHandshake (#65)
Summary:
Starting to migrate fizz specific features to the fizz specific handshake class.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/65

Reviewed By: siyengar

Differential Revision: D18575268

Pulled By: mjoras

fbshipit-source-id: dc1a2f1705e28e1a7f857d9b026c8f15d735c455
2019-11-19 10:03:47 -08:00
Amaury Séchet
74c43417f7 Move ClientHandshake::connect down to FizzClientHandhsake::connect (#60)
Summary:
Start moving fizz specific features of ClientHandshake down to FizzClientHandhsake

Depends on https://github.com/facebookincubator/mvfst/issues/59
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/60

Reviewed By: siyengar, lnicco

Differential Revision: D18303962

Pulled By: mjoras

fbshipit-source-id: 66c5c224b522f3d5f5054cd73792cafb48e285d3
2019-11-07 15:20:35 -08:00
Amaury Séchet
4c48981867 Add facilities to compute ciphers in ClientHandshake. (#58)
Summary:
This separate the cipher management - which is generic - from the cipher construction - that is fizz specific.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/58

Reviewed By: sharma95

Differential Revision: D18044353

Pulled By: mjoras

fbshipit-source-id: eb498fa3dac1b1cd1678edbb6e1d250bc875fd2c
2019-10-23 13:34:25 -07:00
Amaury Séchet
c869462e3e Refactor ClientHandshake to extract fizz specific code in their own methods (#54)
Summary:
This is done in order to keep make sure they can be refactored into some fizz specific code, and that fizz independent code can be shared.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/54

Reviewed By: mjoras

Differential Revision: D17898100

Pulled By: lnicco

fbshipit-source-id: e5ee1b0ae6d241bb04763aac3688338d70aaeb0b
2019-10-16 11:45:48 -07:00
Amaury Séchet
cf6b652978 Make ActionMoveVisitor an implementation detail rather than a part of the API (#47)
Summary:
This is one more step toward isolating fizz specific code from the API. The elements that cannot be moved away can then be extracted into a pluggable component, at least that's the goal.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/47

Reviewed By: mjoras

Differential Revision: D17592394

Pulled By: yangchi

fbshipit-source-id: 7998a6cebea81221942ee9ee1cf49d89da3ebce0
2019-10-09 13:41:57 -07:00
Amaury Séchet
a0ebc3995b Fusion QuicFizzFactory into FizzCryptoFactory (#44)
Summary:
They are strongly coupled, which indicate this is probably better to do it as one class.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/44

Reviewed By: mjoras

Differential Revision: D17590918

Pulled By: yangchi

fbshipit-source-id: 2eaca079fd760107eefd2b74fa612d7a0c8b3001
2019-10-08 22:17:02 -07:00
Amaury Séchet
31744e5353 Remove ClientHandshake::getState() (#48)
Summary:
It is part of the public API and rely on fizz. Moreover, it is not used and therefore can be removed.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/48

Reviewed By: mjoras

Differential Revision: D17668100

Pulled By: yangchi

fbshipit-source-id: 6dc170ea6de5c0e333ce1c627bc3a272f3fbc2bf
2019-10-02 11:44:26 -07:00
Amaury Séchet
cbd77a3603 Extend CryptoFactory with makePacketNumberCipher (#40)
Summary:
The CryptoFactory is extended with makePacketNumberCipher . In order to support that feature, FizzCryptoFactory now explicitly takes a QuicFizzFactory as argument instead of a generic fizz::Factory, which is the only type that is used in practice anyways.

The cypher argument was removed because:
1/ Only one cypher is used at all. Fizz also supports ChaCha20, but using it in mvfst will throw an exception.
2/ it seems like the factory should know what cypher it is dealing with.

If a choice of cypher needs to be supported going forward, it can be done by adding state to FizzCryptoFactory.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/40

Reviewed By: mjoras

Differential Revision: D16785274

Pulled By: yangchi

fbshipit-source-id: a1c490e34c5ddd107e8e068d8b127c1ed00a59ec
2019-08-16 08:52:43 -07:00