Skip to content
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

Encryption fails on Safari #36

Closed
sils opened this issue Apr 14, 2022 · 5 comments
Closed

Encryption fails on Safari #36

sils opened this issue Apr 14, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@sils
Copy link

sils commented Apr 14, 2022

Hey,

we use this in our app and it works great in web and mobile - except on Safari (mobile and desktop).

Here's a screenshot of the respective error in the JS console:

image

In our code we're essentially doing this:

return await RSA.encryptPKCS1v15(message, publicKey);

@sils
Copy link
Author

sils commented Apr 15, 2022

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming it seems this is supported by safari 15 upwards which only got released half a year ago, checking with our testers. Seems safari users are just a little old fashioned... yet they are likely a not too insignificant portion of the mobile userbase.

I wonder if there's a way to make it backwards compatible...

@jerson
Copy link
Owner

jerson commented Apr 16, 2022

Hey @sils thanks for report the issue, I think i can replace instantiateStreaming using

fetch('simple.wasm').then(response =>
  response.arrayBuffer()
).then(bytes =>
  WebAssembly.instantiate(bytes, importObject)
)

let me run some tests here and then we will be supporting from Safari 11

@jerson
Copy link
Owner

jerson commented Apr 16, 2022

@jerson jerson added the enhancement New feature or request label Apr 23, 2022
@jerson
Copy link
Owner

jerson commented Apr 23, 2022

@sils any news on this, did you already tested ?

@sils
Copy link
Author

sils commented Apr 26, 2022

Yep, this works!

@sils sils closed this as completed Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants