Repository navigation
[Async AE 2] Add async crypto utilities - #5079
cheenamalhotra wants to merge 4 commits into
Conversation
Split layer 2 from #4585: decrypt CEKs and verify CMK signatures asynchronously, preserving provider fallback and cancellation behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The signature-cache miss/publication path lacks tests proving canceled verification results stay out of the shared cache and uncanceled results are published and reused.
1 open issue
What changed in this PR
Adds the second foundation layer for async Always Encrypted support, building on the async key cache in #5077. Command integration remains deferred to later layers; no public APIs change.
Changes:
- Adds async column-encryption key decryption with provider selection and candidate fallback.
- Adds async column-master-key signature verification with cancellation handling and shared-cache publication.
- Adds unit tests for provider dispatch, fallback, error wrapping, cancellation, and cached signature results.
| File | Description |
|---|---|
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/SqlSecurityUtilityTests.cs |
Adds regression coverage for async cryptographic utilities. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlSecurityUtility.cs |
Adds async key-decryption and signature-verification helpers. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/cheena/async-ae-key-cache #5079 +/- ##
=================================================================
+ Coverage 70.07% 70.27% +0.19%
=================================================================
Files 314 314
Lines 69893 70018 +125
=================================================================
+ Hits 48981 49202 +221
+ Misses 20912 20816 -96
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add isolated global-provider coverage for canceled inline and suspended verification results, retry, and positive/negative result reuse. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Description
Layer 2/5 split from #4585; depends on #5077. Adds async CEK decryption and CMK signature verification in
SqlSecurityUtility, preserving provider selection, candidate fallback, error wrapping, cancellation precedence, and signature-cache publication. Production changes match the original source delta; newer-main changes remain intact. No call-site wiring or public API changes. Retains milestone8.1.0-preview1.Review follow-up adds six isolated global-provider cases covering canceled true/false results completing inline or asynchronously, retry after cancellation, and positive/negative cache publication and reuse. A non-parallel collection and reversible registration/cache scope prevent shared-state leakage. Includes layer 1's explanatory comments and post-wait cache-recheck race fix through prerequisite merges.
Issues
Relates to #3672. Split from #4585, which remains untouched. Depends on #5077.
Testing
Utility tests were relocated from the original source with focused scenarios, XML summaries, and stronger error assertions; cache-only coverage stays in layer 1. Current focused suite: 51 passed, 0 failed, 0 skipped in both Debug and Release (34 utility + 17 cache cases).
Each command passed at head
c75f65fc:Latest net462 compile check passed with 0 warnings/errors:
Cumulative CI: #5085, build 192590, tested
aa9fadbfincluding every lower layer. UnitTests passed: Linux net10 2668/0 failed, Windows net10 2692/0, net462 2588/0. Simulated-server tests ran; none of the stack's tests were skipped. AE manual tests: 246 passed, 0 failed; only enclave tests were skipped because CI has no enclave server.Local validation was on macOS, without SQL Server, AKV, or net462 runtime execution. Command/enclave integration belongs to later layers.
Guidelines
Please review the contribution guidelines before submitting a pull request: