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
Client-browser readme is missing fallback strategies and alternatives #128
The fallback section of the readme for the client-browser module lists the features of the SDK that are not supported by certain browsers. However, while it mentions msrcrypto as an example of a fallback library, it doesn't recommend any fallback strategies or alternatives.
Also, the fallback section points to @aws-crypto/web-crypto-backend, but that file has very little information, and just sends readers back to the readme. Loops like this are very frustrating to users.
Any further information on this is really helpful, we currently have requirement where we are using AWS encryption SDK for browser using javascript and we are facing compatibility issues with safari browser on MAC and iOS devices. If any information on this will be helpful, till readme documentation is updated.
@seebees - Thanks for your reply. As per below documentation client-browser module, I configured fallback and still seeing issue.
============================
WebCrypto availability
The WebCrypto API is not available on all browsers. A fallback can be configured. An example of a fallback library is: MSR Crypto
import { configureFallback } from '@aws-crypto/client-browser'
configureFallback(msrCrypto)
For details on configureFallback see: @aws-crypto/web-crypto-backend
============================
Mainly error is coming in configureFallback function. This is the error.
Unhandled Promise Rejection: Error: A Fallback is required for zero byte AES-GCM operations.
Do I need to do any spec \ additional changes in web-crypto-backend module? Thanks in advance.
Activity
khadir-syed commentedon Jan 6, 2020
Hi,
Any further information on this is really helpful, we currently have requirement where we are using AWS encryption SDK for browser using javascript and we are facing compatibility issues with safari browser on MAC and iOS devices. If any information on this will be helpful, till readme documentation is updated.
seebees commentedon Jan 6, 2020
@khadir-syed Safari does not support Zero-Byte AES-GCM operations. So a fallback (such as msrcrypto) is needed. Even though WebCrypto is supported.
khadir-syed commentedon Jan 6, 2020
@seebees - Thanks for your reply. As per below documentation client-browser module, I configured fallback and still seeing issue.
============================
WebCrypto availability
The WebCrypto API is not available on all browsers. A fallback can be configured. An example of a fallback library is: MSR Crypto
For details on configureFallback see: @aws-crypto/web-crypto-backend
============================
Mainly error is coming in configureFallback function. This is the error.
Unhandled Promise Rejection: Error: A Fallback is required for zero byte AES-GCM operations.
Do I need to do any spec \ additional changes in web-crypto-backend module? Thanks in advance.
seebees commentedon Jan 6, 2020
If you have a public repo I could take a look.
The error you are referencing should be throw here: https://github.com/aws/aws-encryption-sdk-javascript//blob/master/modules/web-crypto-backend/src/backend-factory.ts#L55
That error suggests that the code is running on safari and that a fallback has not been configured.
Are you sure that you are not getting an error on
configureFallback(msrCrypto)?khadir-syed commentedon Jan 7, 2020
@seebees - you can check this public code repo - https://github.com/khadir-syed/aws_sdk_encryption_js_poc
I have done changes in these files - https://github.com/khadir-syed/aws_sdk_encryption_js_poc/blob/master/node_modules/%40aws-crypto/example-browser/src/aes_simple.ts
where I added below code
msrCrypto is present in node_modules here - https://github.com/khadir-syed/aws_sdk_encryption_js_poc/tree/master/node_modules/%40aws-crypto/example-browser/node_modules
aes_simple_bundle.js - is created using
npm run example-aes, present in https://github.com/khadir-syed/aws_sdk_encryption_js_poc/tree/master/node_modules/%40aws-crypto/example-browser/build and it is referened in aes_simple.html file which is present in this locaiton https://github.com/khadir-syed/aws_sdk_encryption_js_poc/tree/master/node_modules/%40aws-crypto/example-browser/htmlmsrcrypto.js - This I referenced in above html file, below is for your reference.
Also, I am attaching screen shots from chrome and safari browers on MAC machine I am testing...


Any help here is much appreciated, as I am struck on this from sometime.
seebees commentedon May 1, 2020
The fallback conversation was resolved by #239,
There is now a example illustrating this.