GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Update DecryptionMaterials code to support legacy custom CMMs by lucasmcdonald3 · Pull Request #2037 · aws/aws-encryption-sdk-java

Conversation

@lucasmcdonald3

@lucasmcdonald3 lucasmcdonald3 commented Jun 10, 2024

Copy link
Copy Markdown
Contributor

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:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lucasmcdonald3 added 12 commits June 10, 2024 11:59
@lucasmcdonald3
fix: DecryptionMaterials defaults to empty encryption context
aad31c5
@lucasmcdonald3
reset submodule
ae1902d
@lucasmcdonald3
unit tests
35fe060
@lucasmcdonald3
cleanup
bd2b2e2
@lucasmcdonald3
cleanup
16aa79b
@lucasmcdonald3
changes
23db7f9
@lucasmcdonald3
wip
5f491f5
@lucasmcdonald3
undo
68e954d
@lucasmcdonald3
tests, cleanup
bdcd293
@lucasmcdonald3
undo
1082dc0
@lucasmcdonald3
cleanup
43f92fb
@lucasmcdonald3
cleanup
24ee4f4
@lucasmcdonald3
lucasmcdonald3 marked this pull request as ready for review June 10, 2024 23:48
@lucasmcdonald3
lucasmcdonald3 requested a review from a team as a code owner June 10, 2024 23:48
texastony
texastony previously approved these changes Jun 11, 2024
View reviewed changes

@texastony texastony left a comment

Copy link
Copy Markdown
Contributor

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.

Lucas, you nailed it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/com/amazonaws/encryptionsdk/CMMHandlerTest.java

@texastony texastony Jun 10, 2024

Copy link
Copy Markdown
Contributor

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.

Praise: These are excellent unit tests with clear and concise docs strings to describe what they test and how.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

seebees and lucasmcdonald3 reacted with laugh emoji
All reactions
  • 😄 2 reactions
seebees
seebees previously approved these changes Jun 11, 2024
View reviewed changes

@seebees seebees left a comment

Copy link
Copy Markdown
Contributor

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.

I know you will need it again, but it looks good

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/main/java/com/amazonaws/encryptionsdk/model/DecryptionMaterials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/test/java/com/amazonaws/crypto/examples/v2/V2DefaultCryptoMaterialsManager.java Outdated
Comment on lines +30 to +44
/*
This is a copy-paste of the DefaultCryptoMaterialsManager implementation
from the final commit of the V2 ESDK: 1870a082358d59e32c60d74116d6f43c0efa466b
ESDK V3 implicitly changed the contract between CMMs and the ESDK.
After V3, DecryptMaterials has an `encryptionContext` attribute,
and CMMs are expected to set this attribute.
The V3 commit modified this DefaultCMM's `decryptMaterials` implementation
to set encryptionContext on returned DecryptionMaterials objects.
However, there are custom implementations of the legacy native CMM
that do not set encryptionContext.
This CMM is used to explicitly assert that the V2 implementation of
the DefaultCMM is compatible with V3 logic,
which implicitly asserts that custom implementations of V2-compatible CMMs
are also compatible with V3 logic.
*/

@seebees seebees Jun 11, 2024

Copy link
Copy Markdown
Contributor

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.

Nice comment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lucasmcdonald3
checkstyle?
abfc8d9
@lucasmcdonald3
lucasmcdonald3 dismissed stale reviews from seebees and texastony via abfc8d9 June 11, 2024 16:10
lucasmcdonald3 and others added 6 commits June 11, 2024 09:12
@lucasmcdonald3
?
98fbe39
@lucasmcdonald3 @seebees
Update src/main/java/com/amazonaws/encryptionsdk/model/DecryptionMate…
6c96166
…rials.java

Co-authored-by: seebees <[email protected]>
@lucasmcdonald3
?
51db28e
@lucasmcdonald3
fix
5008c0d
@lucasmcdonald3
??
dbbccfb
@lucasmcdonald3
fix
ff5bf3b
@lucasmcdonald3 lucasmcdonald3 changed the title fix: DecryptionMaterials defaults to empty encryption context fix: Update DecryptionMaterials code to support legacy custom CMMs Jun 11, 2024
seebees
seebees approved these changes Jun 11, 2024
View reviewed changes

@seebees seebees left a comment

Copy link
Copy Markdown
Contributor

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.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/com/amazonaws/encryptionsdk/CMMHandlerTest.java Outdated
Comment on lines +18 to +21

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Test;

@seebees seebees Jun 11, 2024

Copy link
Copy Markdown
Contributor

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.

TBH, I prefer that we keep these. But I don't know how to make that work, or want to block on it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lucasmcdonald3 lucasmcdonald3 Jun 11, 2024

Copy link
Copy Markdown
Contributor Author

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.

We are keeping these! They just got moved to the top of the file in checkstyle reformatting

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lucasmcdonald3
lucasmcdonald3 merged commit 8807d79 into master Jun 11, 2024
@lucasmcdonald3
lucasmcdonald3 deleted the fix-2x-cmm branch June 11, 2024 17:29
josecorella pushed a commit that referenced this pull request Jun 12, 2024
@semantic-release-bot
AWS Encryption SDK 3.0.1 Release -- 2024-06-12
a479aa8
## [3.0.1](v3.0.0...v3.0.1) (2024-06-12)

### Fixes

* Add Locale.ROOT to String uppercase conversions ([#1880](#1880)) ([9a9950e](9a9950e)), closes [#1879](#1879)
* Update DecryptionMaterials code to support legacy custom CMMs ([#2037](#2037)) ([8807d79](8807d79))

### Maintenance

* deprecate getMasterKeyIds() in CryptoResult ([#1976](#1976)) ([1890ebb](1890ebb))
* **deps:** bump bcprov-jdk18on from 1.77 to 1.78.1 ([#2032](#2032)) ([713ca11](713ca11))
* **deps:** udpate org.bouncycastle to bcprov-jdk18on ([#1891](#1891)) ([32a92a9](32a92a9))
* **deps:** update dependencies ([#1973](#1973)) ([800bd01](800bd01))
* **Examples:** Customize KMS Client ([#2001](#2001)) ([e94ee85](e94ee85))
* fix release script ([#1912](#1912)) ([57e8a0b](57e8a0b))
* **README:** update README.md ([#1940](#1940)) ([7a0899e](7a0899e))
* update node version in version step ([#1959](#1959)) ([905385d](905385d))
* Update SUPPORT_POLICY.rst ([#1924](#1924)) ([57e40b5](57e40b5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@seebees seebees seebees approved these changes
@texastony texastony texastony left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@lucasmcdonald3 @seebees @texastony
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.