Skip to content

feat: implement BufferedCipherSubscriber to enforce buffered decrypti… #99

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

Merged
merged 19 commits into from
Mar 8, 2023

Conversation

kessplas
Copy link
Contributor

@kessplas kessplas commented Mar 3, 2023

…on of GCM

Issue #, if available:

Description of changes:

To avoid release of unauthenticated plaintext, it must be buffered until doFinal is called, as this is when the GCM auth tag is verified. This is done by simply enqueuing the ByteBuffers passing through the decrypting subscriber, then forwarding them to the wrapped subscriber once doFinal has been called.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kessplas kessplas marked this pull request as ready for review March 4, 2023 01:41
Copy link
Contributor

@texastony texastony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 Blocking Question.

CipherPublisher plaintextPublisher = new CipherPublisher(cipher, ciphertextPublisher, getObjectResponse.contentLength(), desiredRange, contentMetadata.contentRange(), algorithmSuite.cipherTagLengthBits());
wrappedAsyncResponseTransformer.onStream(plaintextPublisher);
if (algorithmSuite.equals(AlgorithmSuite.ALG_AES_256_CBC_IV16_NO_KDF) || _enableDelayedAuthentication) {
// CBC and GCM with delayed auth enabled use a standard publisher
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise: I love clarifying comments.

…round legacy wrapping mode in GetEncryptedObjectPipeline
J Plasmeier added 3 commits March 8, 2023 11:20
@kessplas kessplas merged commit 87411c8 into main Mar 8, 2023
@kessplas kessplas deleted the delayed-auth-async-fix branch March 8, 2023 20:28
aws-crypto-tools-ci-bot pushed a commit that referenced this pull request Mar 13, 2023
## [2.3.0](v2.2.0...v2.3.0) (2023-03-13)

### Features

* implement BufferedCipherSubscriber to enforce buffered decrypti… ([#99](#99)) ([87411c8](87411c8))

### Maintenance

* add a new test class for ranged gets using the CRT client ([#104](#104)) ([9b244be](9b244be))

### Fixes

* handle contentLength in request object ([#106](#106)) ([58ee9bc](58ee9bc))
* regression in ranged gets when using buffered subscriber ([#107](#107)) ([ebcddbf](ebcddbf))
* remove duplicate call to appendTestPrefix in deleteObjects ([#97](#97)) ([62953a6](62953a6))
* Revert "feat: Add S3CrtAsyncClient as MultipartPutobject ([#90](#90))" ([#103](#103)) ([93011f2](93011f2))
* update README to reflect option split ([#105](#105)) ([5efabf8](5efabf8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants