-
Notifications
You must be signed in to change notification settings - Fork 83
Optionally disable padding in StreamingDecryptingKey #869
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?
Conversation
I'm not familiar with this use-case. Why would padding need to be validated? |
With the padding schemes I need to support, the last byte |
Ahh. My links above only apply to Do you have reason to believe that this validation is not occurring currently? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #869 +/- ##
==========================================
- Coverage 95.80% 92.27% -3.53%
==========================================
Files 61 71 +10
Lines 8143 9279 +1136
Branches 0 9279 +9279
==========================================
+ Hits 7801 8562 +761
- Misses 342 437 +95
- Partials 0 280 +280 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The validation happens within While I'm typing this I thought of working around this problem by omitting the call to |
Calling decryptor.update(&[0u8; 16], &mut self.decrypted); instead of
works for my use case. In case these legacy padding schemes should be supported a bit better, this PR is a relatively simple fix, but it's not strictly needed. |
Issues:
Continuation of #847.
Some applications (e.g. EBICS) still require compatibility with padding schemes like ISO 10126 and ANSI X9.23.
Description of changes:
This PR adds the method
StreamDecryptingKey::disable_padding()
as a safe wrapper for the existingEVP_CIPHER_CTX_set_padding()
function. This allows applications to decrypt data padded with one of these padding schemes and validate the padding without adding complexity to aws-lc-rs.Testing:
Testing will be added. What kind of coverage is expected?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.