Change uses of NewGCM to NewGCMWithRandomNonce#12599
Draft
michel-laterman wants to merge 1 commit intoelastic:mainfrom
Draft
Change uses of NewGCM to NewGCMWithRandomNonce#12599michel-laterman wants to merge 1 commit intoelastic:mainfrom
michel-laterman wants to merge 1 commit intoelastic:mainfrom
Conversation
Contributor
|
This pull request does not have a backport label. Could you fix it @michel-laterman? 🙏
|
1030f1b to
e6b5bf9
Compare
e6b5bf9 to
a34afd5
Compare
Contributor
Author
|
Blocked by #10156 |
Contributor
💔 Build Failed
Failed CI StepsHistory
|
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.
What does this PR do?
Replace uses of
cipher.NewGCMwithcipher.NewGCMWithRandomNoncein internal/pkg/crypto and internal/pkg/agent/vault/aesgcm, and remove allfipsutils.SkipIfFIPSOnlycalls in tests that would skip the test ifGODEBUG=fips140=onlywas set.The replacement in internal/pkg/agent/vault/aesgcm is basically a drop in replacement as the GCM created with
cipher.NewGCMWithRandomNonceprepends the nonce (iv) for us automatically.The replacement in internal/pkg/crypto was a little more involved as having the nonce prepended automatically breaks our implementation; specifically we assume our encrypted data block headers have
IV | UINT32 | ENCRYPTED-DATA. We have to manually recreate this type of header from the output ofSeal, and handle managing the input toOpenin order to ensure no breaking changes.Why is it important?
Using
cipher.NewGCMWithRandomNonceallows a path forward for using go's FIPS crypto module which is currently being certified.Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog toolDisruptive User Impact
N/A
How to test this PR locally
Enroll an agent in fleet, then upgrade/downgrade
Related issues