Landing Recent QUIC changes until 3:01 PM, Feb 15, 2019 UTC-5
Update feature flags
Server session should start first.
The server session should be started by the time client session is
started.
Merge internal change: 234173322
https://chromium-review.googlesource.com/c/1476209/
Implement a QuartcDispatcher and use it for the server perspective.
Creates a QuartcDispatcher, which implements QuicDispatcher. QuartcDispatcher
has three differences from QuicDispatcher:
- It owns all configuration objects, so that the caller does not have to keep
track of them (in particular, QuicConfig, crypto config, and version manager)
- It has a delegate, which it calls whenever a new QuartcSession is created
- It connects to a QuartcPacketWriter and receives transport callbacks when the
writer becomes writable or the transport receives data
Since QuartcDispatcher owns the crypto config and packet writer, the
QuartcServerSession no longer owns either of these objects. In fact,
QuartcServerSession no longer interacts with the packet writer directly--it
receives calls from the dispatcher when it can write or when data is received.
The QuartcEndpoint now has two different implementations. The client
implementation remains the same, but the server implementation uses
QuartcDispatcher to wait for a CHLO before creating a session. Since the
perspective is not known until Connect is called, QuartcEndpoint has two
internal implementations and selects one when Connect is called. This might be
worth cleaning up in a future cl, as there's no particular reason the caller
can't select an appropriate subclass when creating QuartcEndpoint.
QuartcFactory is refactored slightly to move the meat of setup into static
helper functions. These are called by the factory itself when the endpoint uses
it for the client perspective, or by the dispatcher when it is used for the
server perspective. This is also ripe for future cleanup, as there's no
particular reason to have the QuartcFactory object any more. It's client-side
functionality should move into the client implementation of endpoint, while the
helpers can move to a new utility file.
However, delaying cleanup minimizes the delta for this change, as it avoids
changes at the application layer and significant portions of factory code can be
left in place.
Merge internal change: 234041835
https://chromium-review.googlesource.com/c/1476205/
Clean up QUIC endianness code.
Now that QUIC v35 has been removed, all QUIC versions use
NETWORK_BYTE_ORDER so QuicFramer no longer needs an endianess(). In
addition, all QuicDataReaders and QuicDataWriters can be
NETWORK_BYTE_ORDER, except those in QUIC Crypto code and the QUIC
NullEncrypter/Decrypter. So make a version of the constructor for the
Writer and Reader which does not tale the endianness and instead uses
NETWORK_BYTE_ORDER. Use this everywhere possible.
Merge internal change: 234030501
https://chromium-review.googlesource.com/c/1476200/
Add QpackDecodedHeadersAccumulator.
QpackDecodedHeadersAccumulator calls QpackDecoder's factory method to
create a QpackProgressiveDecoder that it owns, relays wire data for
decoding, and accumulates decoded header fields in a QuicHeaderList.
Merge internal change: 233973516
https://chromium-review.googlesource.com/c/1476199/
Remove QUIC version 35!
Also removes the TransportVersion argument to QuicEncrypter and
QuicDecrypter Also removes the SPSH connection option
Merge internal change: 233859145
https://chromium-review.googlesource.com/c/1476194/
Change QuartcSessionTest to use QuartcEndpoint instead of QuartcFactory.
QuartcFactory creates sessions synchronously, and this is not compatible
with the model used by QuicDispatcher. QuartcEndpoint creates sessions
asynchronously. Changing everything to use QuartcEndpoint will make
future changes to support QuicDispatcher invisible to callers.
Merge internal change: 233816298
https://chromium-review.googlesource.com/c/1476142/
Change QuartcSessionConfig::pre_shared_key from QuicStringPiece to QuicString.
Using a QuicStringPiece exposes QuartcEndpoint to use-after-free issues
when it stores the config and uses it later during async session
creation.
Merge internal change: 233769074
https://chromium-review.googlesource.com/c/1476141/
Add a flag count for FLAGS_quic_reloadable_flag_quic_fix_config_rotation
Merge internal change: 233741064
https://chromium-review.googlesource.com/c/1476139/
Refactor QuartcSession to inject crypto configs. Required for dispatcher.
Currently, the QuartcSession creates and owns its own client or server
crypto config. In the near future, the server-perspective session will
be created by a QuicDispatcher (which performs the server half of
version negotiation). The dispatcher holds the server crypto config
(and helpers), so these must be created outside the session.
QuartcFactory now creates crypto configs and passes them to the session.
The session is split into a QuartcServerSession and a
QuartcClientSession, which take different dependencies based on their
role in the crypto handshake. The client session only needs the client
crypto config, while the server session needs the server config, a cert
cache, and a crypto stream helper.
For now, the cert cache and crypto stream helper are owned by the
QuartcFactory (which also implements QuicConnectionHelperInterface, and
hence must be kept alive anyway). In the future, these helpers will be
owned by the dispatcher (and the factory will go away).
Merge internal change: 233653995
https://chromium-review.googlesource.com/c/1476138/
Move creation of crypto configs into helper functions and specify PSK at setup.
Since crypto configs will be owned by the dispatcher/endpoint in the
future, it does not make sense to create them in QuartcSession. This
change moves the code for creating crypto configs into separate helper
functions. A future change will inject the crypto configs into
QuartcSession instead of calling these helpers in the constructor.
The PSK is now specified in QuartcSessionConfig instead of the unused
unique_remote_server_id. Since the PSK is part of the crypto config,
which won't be owned by the session, it doesn't make sense to set it
through the session.
Merge internal change: 233650743
https://chromium-review.googlesource.com/c/1476137/
Move Quartc crypto helpers into their own file.
The proof verifier, proof source, and crypto server stream helper need
to be moved out of QuartcSession in order to support use of the
QuicDispatcher. The QuicDispatcher needs pointers to the server crypto
config and crypto server stream helper. The proof source and proof
verifier are owned by the server and client crypto configs,
respectively. Since the dispatcher creates sessions, none of these can
be owned by the session.
Moving these helpers into their own file is the first step of
refactoring required to remove them from the session. A follow-up cl
will change ownership.
Merge internal change: 233638226
https://chromium-review.googlesource.com/c/1476136/
In QUIC, consider receiving unencrypted data as QUIC_PEER_BUG.
Merge internal change: 233629199
https://chromium-review.googlesource.com/c/1476135/
Deprecate FLAGS_quic_reloadable_flag_quic_faster_detect_loss.
Merge internal change: 233605499
https://chromium-review.googlesource.com/c/1476131/
Add VersionUsesQpack() helper function and DCHECKs.
Add VersionUsesQpack() helper function to quic_versions.h as a shorthand
instead of comparing directly to QUIC_VERSION_99. Also add DCHECKs to
QuicSpdySession QPACK encoder and decoder accessors. (These members are
nullptr unless using QPACK.)
Merge internal change: 233467975
https://chromium-review.googlesource.com/c/1476106/
Add flag count for quic_no_client_conn_ver_negotiation.
Merge internal change: 233466695
https://chromium-review.googlesource.com/c/1476101/
Add default action for some mock methods in QuicSimpleServerSessionTest and QuicSimpleServerStreamTest to simplify expectations.
Also add some more specific argument matchers.
Merge internal change: 233167637
https://chromium-review.googlesource.com/c/1476100/
[email protected]
Change-Id: Id6de2635abf45435c0e40cbfc689d069597c7161
Reviewed-on: https://chromium-review.googlesource.com/c/1476232
Commit-Queue: Victor Vasiliev <[email protected]>
Reviewed-by: Ryan Hamilton <[email protected]>
Cr-Commit-Position: refs/heads/master@{#633397}
diff --git a/net/quic/mock_decrypter.h b/net/quic/mock_decrypter.h
index 0466a49..57642da 100644
--- a/net/quic/mock_decrypter.h
+++ b/net/quic/mock_decrypter.h
@@ -33,8 +33,7 @@
bool SetPreliminaryKey(quic::QuicStringPiece key) override;
bool SetDiversificationNonce(
const quic::DiversificationNonce& nonce) override;
- bool DecryptPacket(quic::QuicTransportVersion version,
- uint64_t packet_number,
+ bool DecryptPacket(uint64_t packet_number,
quic::QuicStringPiece associated_data,
quic::QuicStringPiece ciphertext,
char* output,