-
-
Notifications
You must be signed in to change notification settings - Fork 758
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix output buffer check introduced in #1733
Sadly the condition used to relax output buffer checks that depended on the `num` parameter does not really hold so this change effectively reverts PR #1733. As clarified on the OpenSSL mailing list [0] and during integration tests the `num` parameter does not reflect the internal buffer cache size thus one needs to pessimistically assume that each call to `cipher_update` will need sufficient size to contain one additional block. Streaming ciphers are not affected by this revert. [0]: https://mta.openssl.org/pipermail/openssl-users/2022-December/015727.html
- Loading branch information
Showing
1 changed file
with
10 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71013f7
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.
This should be better documented in the API, as it was not obvious why this was needed when migrating from a different crypto library, and caused a lot of confusion.
71013f7
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.
Well, I was the one who introduced the check and then removed it since it didn't actually do anything good. So I definitely was caught by that.
I'm not sure what do you mean by "better documented in the API" though - do you mean this behavior (that is OpenSSL buffering stuff if not in streaming mode?). I think that's covered by the OpenSSL docs and this crate merely wraps it.
Maybe you can create an issue and if it gets "acked" follow-up with a PR? (Just trying to find some constructive ground here... 😅 )