fix: determine effective contentLength, account for tagLength on decrypt#463
Merged
fix: determine effective contentLength, account for tagLength on decrypt#463
Conversation
lucasmcdonald3
previously approved these changes
May 19, 2025
| // onComplete will be called before onNext is called once. | ||
| if (contentRead.get() + tagLength <= contentLength) { | ||
| // tagLength should only be added on Encrypt | ||
| if (contentRead.get() + (isEncrypt ? tagLength : 0) >= contentLength) { |
Contributor
There was a problem hiding this comment.
The equality was flipped here -- was that intentional?
It seems like it was, since it now aligns with the other checks, and (maybe?) makes more sense conceptually
Contributor
Author
There was a problem hiding this comment.
Actually, the most sensible thing to do is to just call finalBytes from here regardless. In the vast majority of cases it'll already have been called, and simply return immediately; in the rare case(s) when it hasn't been we'll always want to send the final bytes.
lucasmcdonald3
approved these changes
May 19, 2025
rishav-karanjit
pushed a commit
that referenced
this pull request
May 20, 2025
## [3.3.5](v3.3.4...v3.3.5) (2025-05-20) ### Fixes * determine effective contentLength, account for tagLength on decrypt ([#463](#463)) ([969d721](969d721)) * disable low-level Multipart Upload in Async client ([#461](#461)) ([599f941](599f941)) * support PutObjectResponse fields ([#462](#462)) ([dec503b](dec503b))
1 task
josecorella
pushed a commit
that referenced
this pull request
May 21, 2025
## [3.3.5](v3.3.4...v3.3.5) (2025-05-21) ### Fixes * determine effective contentLength, account for tagLength on decrypt ([#463](#463)) ([969d721](969d721)) * disable low-level Multipart Upload in Async client ([#461](#461)) ([599f941](599f941)) * support PutObjectResponse fields ([#462](#462)) ([dec503b](dec503b)) ### Maintenance * Revert "Amazon S3 Encryption Client 3.3.5 Release -- 2025-05-20" ([#465](#465)) ([3f9ac8e](3f9ac8e)) * update dependency needed for semantic-release ([#464](#464)) ([0fd3b58](0fd3b58))
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Check any applicable: