Conversation
In the closing path of ietf_full_conn_ci_tick(), PNS_HSK was selected whenever the client had not sent Handshake CRYPTO. A client that has not yet received the server's Initial flight has no Handshake keys, only Initial keys, so encrypting the CONNECTION_CLOSE packet failed and the peer never received it. Fall back to PNS_INIT when the Handshake encryption level is not ready, mirroring the selection in generate_ping_frame().
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.
Problem
In the closing path of
immediate_close()(called fromietf_full_conn_ci_tick()), PNS_HSK was selected whenever the client had not sent Handshake CRYPTO. A client that has not yet received the server's Initial flight has no Handshake keys at all, only Initial keys, so encrypting the CONNECTION_CLOSE packet failed and the peer never received it.Fix
Use the same three-way selection as
generate_ping_frame()(and nowgenerate_connection_close_packet(), see #687): fall back to PNS_INIT when the Handshake encryption level is not ready:Notes
This is the pre-existing gap noted by @dtikhonov in #687: the PNS selection logic in this closing path lacked the PNS_INIT fallback that
generate_ping_frame()already has. When pns is PNS_HSK and an application error is set, the existing code already strips the application error code and reason per RFC 9000 Section 10.2.3; the new PNS_INIT branch emits the same transport-level close frame, so the RFC requirement remains satisfied.