You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@aws-crypto/client-browser Buffer usage in raw2der causing ReferenceError when decrypting #1050
When using @aws-crypto/client-browser version 3.1.1, calling decrypt() will result in a ReferenceError. decrypt calls raw2der, which includes a reference to global Buffer type. The buffer npm package is not listed as a dependency in the package.json.
Solution:
Either decouple the browser and node ecdsa_signature.ts helpers and use a Uint8Array instance instead of Buffer or add the buffer dependency to the package.
Thanks for getting back to me, @lavaleri. We are using yarn for package management in our React app. This error occurs when I'm building locally using yarn run start. I have the following version in my package.json "@aws-crypto/client-browser": "^3.1.1". Our implementation is very simple encryption mirroring the kms_simple.ts example in the example repo.
The AWS Encryption SDK for Java Script (ESDK-JS) is not built for nor tested in a React Native environment.
The issue you are bumping into maybe fixed by your proposed solution,
but I fear that it is the tip of the iceberg.
A challenge with React Native is supplying the Cryptographic Primitives.
Are you using msrCrypto for the primitives or another library?
Can you share a repository that uses the ESDK-JS in a React Native application?
(Ideally, something bare bones, and with this issue).
If you could share something for us to work from, we could move this issue forward faster.
Activity
[-]@aws-crypto/client-browser Buffer usage in raw2der [/-]lavaleri commentedon Nov 10, 2022
Hi @hunterabraham,
We have some examples of doing this in https://github.com/aws/aws-encryption-sdk-javascript/tree/master/modules/example-browser. Can you tell us how you are packaging your code for the browser so that we can repro and fix this?
hunterabraham commentedon Nov 17, 2022
Thanks for getting back to me, @lavaleri. We are using yarn for package management in our React app. This error occurs when I'm building locally using
yarn run start. I have the following version in my package.json"@aws-crypto/client-browser": "^3.1.1". Our implementation is very simple encryption mirroring thekms_simple.tsexample in the example repo.texastony commentedon Nov 21, 2022
@hunterabraham
The AWS Encryption SDK for Java Script (ESDK-JS) is not built for nor tested in a React Native environment.
The issue you are bumping into maybe fixed by your proposed solution,
but I fear that it is the tip of the iceberg.
A challenge with React Native is supplying the Cryptographic Primitives.
Are you using
msrCryptofor the primitives or another library?Can you share a repository that uses the ESDK-JS in a React Native application?
(Ideally, something bare bones, and with this issue).
If you could share something for us to work from, we could move this issue forward faster.