-
Notifications
You must be signed in to change notification settings - Fork 293
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
Fix | Addressing failure on providing correct error message when symmetric key decryption fails using Always Encrypted. #1948
Fix | Addressing failure on providing correct error message when symmetric key decryption fails using Always Encrypted. #1948
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #1948 +/- ##
==========================================
- Coverage 71.53% 70.44% -1.09%
==========================================
Files 306 306
Lines 61841 61567 -274
==========================================
- Hits 44235 43371 -864
- Misses 17606 18196 +590
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 47 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
You removed the Also, I am just adding a note not to forget to include tests. |
Adding a test is bit complicated. It needs some modification to prevent the application from obtaining the key to decrypt column key. DrainData is reproducing the issue as there is no data at this point for the column. Basically at this point setting pending data to false will cause the driver to skip looking for the column value and exception will be thrown immediately. |
What would be the result of this change with MARS enabled, and/or parallel async calls? These are the questions that require more tests. |
So, the issue only happens on ISDBNull to get the column's info and if you dont use that no issue comes up at all. For async and MARS we do have tests to run and read values, I am not sure if ISDBNull has been called inside those tests, but no failure on the pipelines so far. I will try to come up with a solution for the test purposes. |
Thanks! I've tested this fix locally and it seems good to me. We'll have to add the test in a separate PR. |
…etric key decryption fails using Always Encrypted. (dotnet#1948)
…etric key decryption fails using Always Encrypted. (dotnet#1948)
The issue is happening when IsDBNull called on an encrypted column with backed keys in Azure key vault. If, for any reason, application fails to decrypt column keys, not the value the actual key for the column, the driver is waiting for the pending data to be received and throws unknown TDS token header, by setting the pending data to false, application will not process the rest to read the data.