Repository navigation
[CP] Guard certificate completion after crypto cleanup (#6445) - #6485
Merged
Guillaume Hetier (guhetier) merged 1 commit intoNov 11, 2026
Merged
Guillaume Hetier (guhetier) merged 1 commit into
Guillaume Hetier (guhetier) merged 1 commit into
Conversation
## Description While application certificate validation is pending, MsQuic pauses TLS processing and may buffer additional CRYPTO data. When the application completes validation, `QuicCryptoCustomCertValidationComplete` synchronously resumes TLS processing. That nested processing can complete the handshake and uninitialize the crypto receive state before returning to the completion function. The certificate path now guards that `QuicRecvBufferHasUnreadData` query with Crypto->Initialized . Ticket-validation assertion A similar code is present here too, but ticket validation occurs earlier in handshake processing, before handshake completion is expected to discard crypto state. Therefore, crypto state should always remain initialized when QuicCryptoCustomTicketValidationComplete reaches its unread-data query. The debug assertion is added for this invariant. ICM 31000000772553 ## Testing BVT and CI ## Documentation N/A Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bd06d130-070d-44d0-a470-092953f341f3
Nithin Jose (nijosmsft)
approved these changes
Nov 11, 2026
Guillaume Hetier (guhetier)
marked this pull request as ready for review
November 11, 2026 19:20
Guillaume Hetier (guhetier)
merged commit Nov 11, 2026
def143d
into
release/2.5
279 of 283 checks passed
Guillaume Hetier (guhetier)
deleted the
guhetier/cp_guard_cert_completion_2_5_copilot
branch
November 11, 2026 21:18
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.
Description
While application certificate validation is pending, MsQuic pauses TLS processing and may buffer additional CRYPTO data.
When the application completes validation,
QuicCryptoCustomCertValidationCompletesynchronously resumes TLS processing. That nested processing can complete the handshake and uninitialize the crypto receive state before returning to the completion function.The certificate path now guards that
QuicRecvBufferHasUnreadDataquery with Crypto->Initialized .Ticket-validation assertion
A similar code is present here too, but ticket validation occurs earlier in handshake processing, before handshake completion is expected to discard crypto state. Therefore, crypto state should always remain initialized when QuicCryptoCustomTicketValidationComplete reaches its unread-data query. The debug assertion is added for this invariant.
ICM 31000000772553
Testing
BVT and CI
Documentation
N/A