-
Notifications
You must be signed in to change notification settings - Fork 63
Zero byte operations #239
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
Zero byte operations #239
Conversation
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
mattsb42-aws
requested changes
Jan 24, 2020
Regarding aws#237, the shape of the CryptoKey when dealing with a fallback may slightly differ. By changing all references to AwsEsdkJsCryptoKey I can control any type mismatch.
There are two sublte things going on here. First, in the case of a mixed backend, the non-zero backend should be the native implementation. I assert that it should be slightly harder to exfiltrate from the native implementation than a JS implementation. Second, if I force the import of the master key into only half of the mixed backend, then `getSubtleFunction` will complain about a mismatch. Because the crypto key and the backend are not both mixed. To resolve this the backend for the raw AES master key is issolated here.
See: aws#237 Since the WebCrypto decrypt API expects the AES-GCM tag with the encrypted data, zero bytes of encrypted data is not zero bytes of data. fix: Add tests Add tests to specificly cover the Mixed Backend conditions and logic.
The suite did not have a KDF, so this value was `undefined` which should never happen in practice. Tests should match expected situations.
Since MSRCrypto is a viable option for a falback, it must be usable. These differ from the WebCrypto API * The algorithm argument in importKey is passed through to the imported key. * The algorithm is normalize to lower case microsoft/MSR-JavaScript-Crypto#1
Adding an example of useing a fallback. This example uses MSRCrypto version 1.6.0.
80dfd38
to
6e23c2d
Compare
scottarc
approved these changes
Mar 26, 2020
mattsb42-aws
approved these changes
Mar 27, 2020
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.
Resolves #237
Several changes bundled together:
CryptoKey
toAwsEsdkJsCryptoKey
'algorithm'
algorithm
argument forimportKey
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Check any applicable: