Skip to content

fix: browser-encrypt can encrypt 0 bytes #866

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 5 commits into from
Mar 14, 2022

Conversation

seebees
Copy link
Contributor

@seebees seebees commented Mar 10, 2022

Browser encryption now correctly encrypts 0 byte messages.
Added structural tests for both Node.js and browser encrypt.

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.

Browser encryption now correctly encrypts 0 byte messages.
Added structural tests for both Node.js and browser `encrypt`.
@seebees seebees requested a review from a team as a code owner March 10, 2022 20:26
alex-chew
alex-chew previously approved these changes Mar 10, 2022
@@ -370,6 +370,34 @@ describe('encrypt structural testing', () => {
// This will throw if it does not deserialize correctly
deserializeSignature(footerSection)
})

it('can encrypt empty message', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: any reason to check the encryption context and EDKs in the browser version of this test but not the Node version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a miss, inc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to elaborate more, when encrypting 0 bytes, the only part of the message that is relevant is the encryption context :)

alex-chew
alex-chew previously approved these changes Mar 10, 2022
Copy link
Contributor

@alex-chew alex-chew left a comment

Choose a reason for hiding this comment

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

LGTM

@seebees seebees merged commit 32f7fa2 into aws:master Mar 14, 2022
@seebees seebees deleted the zero-byte-message-encrypt-browser branch March 14, 2022 17:07
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