Skip to content

[CP] Guard certificate completion after crypto cleanup (#6445) - #6486

Merged
Guillaume Hetier (guhetier) merged 1 commit into
release/2.6from
guhetier/cp_guard_cert_completion_2_6_copilot
Nov 11, 2026
Merged

Guillaume Hetier (guhetier) merged 1 commit into
release/2.6from
guhetier/cp_guard_cert_completion_2_6_copilot

Conversation

@guhetier

Copy link
Copy Markdown
Collaborator

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

## 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
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.54%. Comparing base (4504c53) to head (ee32f29).
⚠️ Report is 1 commits behind head on release/2.6.

Additional details and impacted files
@@               Coverage Diff               @@
##           release/2.6    #6486      +/-   ##
===============================================
- Coverage        85.80%   85.54%   -0.26%     
===============================================
  Files               60       60              
  Lines            19043    19044       +1     
===============================================
- Hits             16340    16292      -48     
- Misses            2703     2752      +49     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guhetier
Guillaume Hetier (guhetier) merged commit 7d2ef07 into release/2.6 Nov 11, 2026
492 of 496 checks passed
@guhetier
Guillaume Hetier (guhetier) deleted the guhetier/cp_guard_cert_completion_2_6_copilot branch November 11, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backport request: #6445 ("Guard certificate completion after crypto cleanup") is missing from release/2.5 and release/2.6

2 participants