-
Notifications
You must be signed in to change notification settings - Fork 314
Performance | Use lower-allocation AlwaysEncrypted primitives #3612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Performance | Use lower-allocation AlwaysEncrypted primitives #3612
Conversation
Also simplified exception handling in SqlColumnEncryptionCspProvider
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great. Some comments about [NotNull]
and usings.
...rosoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCngProvider.Windows.cs
Outdated
Show resolved
Hide resolved
...rosoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCngProvider.Windows.cs
Show resolved
Hide resolved
...rosoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCngProvider.Windows.cs
Show resolved
Hide resolved
...rosoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCspProvider.Windows.cs
Show resolved
Hide resolved
Simplify CreateRSACngProvider. Use static CngProvider instances for well-known providers where possible.
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3612 +/- ##
==========================================
- Coverage 65.48% 59.61% -5.88%
==========================================
Files 275 271 -4
Lines 61518 61253 -265
==========================================
- Hits 40288 36517 -3771
- Misses 21230 24736 +3506
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
This builds on #3554, using the lower-allocation AE primitives in
SqlColumnEncryptionCspProvider
andSqlColumnEncryptionCngProvider
. Benchmarks for this are located in the original PR.I'm separating these two changes from
SqlColumnEncryptionCertificateStoreProvider
due to the latter's size, but it'll be fairly similar once the use ofX509Certificate2
has been refactored into anRSA
instance. I'll incorporate the feedback from this PR into the second one.We make some minor code style changes, largely to remove a few Yoda conditions, replace
== null
withis null
comparisons and clean up the comments. Besides this though, almost all of theDecryptColumnEncryptionKey
andEncryptColumnEncryptionKey
methods are replaced with references to the new AE primitives.While not the main goal, I also noticed and fixed one case where we were opening a
CngKey
and never disposing it.Issues
Builds on #3554.
Testing
Automated tests pass.
I also created an AE-enabled table in SSMS which used a CNG-based master key, and confirmed that I was able to query values from it. This should confirm that data created outside of SqlClient can now be read successfully.
Could someone run CI please?