Handle missing interim header callbacks and enforce stream limits#145
Open
kedar49 wants to merge 2 commits into
Open
Handle missing interim header callbacks and enforce stream limits#145kedar49 wants to merge 2 commits into
kedar49 wants to merge 2 commits into
Conversation
Interim 1xx responses can arrive even when the simple client has not registered a handler yet. Guarding the session callback keeps those responses from crashing the client while preserving late callback registration for existing streams. Fixes google#103
…failures to use TRANSPORT_PARAMETER_ERROR
Author
|
@martinduke can you please review this ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RFC 9000 requires that receiving a$2^{60}$ must trigger a connection close with $2^{62}-1$ ), clamping them to
max_streamstransport parameter (initial_max_streams_bidiorinitial_max_streams_uni) with a value greater thanTRANSPORT_PARAMETER_ERROR. Previously, quiche parsed these as generic varint62 parameters (allowing values up touint32_t::max()insideQuicConfigwithout rejecting the invalid connection setup.This change enforces a maximum parameter limit of$2^{60}$ on stream limits during initialization. Any parsed value exceeding $2^{60}$ fails parameter validation and closes the handshake connection with
TRANSPORT_PARAMETER_ERROR.Changes
quiche/quic/core/crypto/transport_parameters.cc
kMaxInitialMaxStreamsLimit = 1ULL << 60.TransportParametersconstructor to constraininitial_max_streams_bidiandinitial_max_streams_uniparameters to a maximum limit ofkMaxInitialMaxStreamsLimit.quiche/quic/core/tls_client_handshaker.cc
PrepareZeroRttConfigandFinishHandshaketo explicitly close the connection withTRANSPORT_PARAMETER_ERRORinstead ofQUIC_HANDSHAKE_FAILEDwhen transport parameters processing/parsing fails.quiche/quic/core/tls_server_handshaker.cc
EarlySelectCertCallbackto close the connection withTRANSPORT_PARAMETER_ERRORwhen parsing client transport parameters fails.quiche/quic/core/crypto/transport_parameters_test.cc
InvalidMaxStreamsBidiOrUniParseClientParamsFailsWithInvalidInitialMaxStreamsBidiParseClientParamsFailsWithInvalidInitialMaxStreamsUniTesting
Run the following Bazel test command:
New tests added:
TransportParametersTest.InvalidMaxStreamsBidiOrUniTransportParametersTest.ParseClientParamsFailsWithInvalidInitialMaxStreamsBidiTransportParametersTest.ParseClientParamsFailsWithInvalidInitialMaxStreamsUniCloses #140