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
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.
The text was updated successfully, but these errors were encountered:
hunterabraham
changed the title
@aws-crypto/client-browser Buffer usage in raw2der
@aws-crypto/client-browser Buffer usage in raw2der causing ReferenceError when decrypting
Nov 7, 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 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.
Problem:
When using @aws-crypto/client-browser version 3.1.1, calling
decrypt()
will result in aReferenceError
.decrypt
callsraw2der
, which includes a reference to globalBuffer
type. Thebuffer
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 aUint8Array
instance instead ofBuffer
or add the buffer dependency to the package.The text was updated successfully, but these errors were encountered: