MobileChromeApps / mobile-chrome-apps

Chrome apps on Android and iOS
BSD 3-Clause "New" or "Revised" License
2.5k stars 347 forks source link

WebCrypto: The requested operation is unsupported #400

Open tanx opened 9 years ago

tanx commented 9 years ago

I'm trying to get native RSA key generation working on Android using the WebCrypto Api: https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#SubtleCrypto-method-generateKey

The key generation works fine in Chrome 38 on the desktop and Chrome 38 for Android, but in the crosswalk WebView it fails with the error message "The requested operation is unsupported". Here is my code:

https://github.com/openpgpjs/openpgpjs/blob/master/src/crypto/public_key/rsa.js#L147

I googled for this error message and it seems it appears in the chromium codebase for webcrypto:

https://github.com/scheib/chromium/blob/master/content/child/webcrypto/status.cc#L154

I hope this will help you to reproduce and fix the issue. Please let me know if I can be of further assistance. I also created this issue in the crosswalk jira here:

https://crosswalk-project.org/jira/browse/XWALK-2857

agrieve commented 9 years ago

Looks like the API was added in Chrome 37, so it should be there ( https://code.google.com/p/chromium/issues/detail?id=379976)

Might be related to https://code.google.com/p/chromium/issues/detail?id=373032 - but we serve from file://, so would think it to be considered secure.

Crosswalk bug?

On Thu, Oct 30, 2014 at 8:15 AM, Tankred Hase notifications@github.com wrote:

I'm trying to get native RSA key generation working on Android using the WebCrypto Api:

https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#SubtleCrypto-method-generateKey

The key generation works fine in Chrome 38 on the desktop and Chrome 38 for Android, but in the crosswalk WebView it fails with the error message "The requested operation is unsupported". Here is my code:

https://github.com/openpgpjs/openpgpjs/blob/master/src/crypto/public_key/rsa.js#L147

I googled for this error message and it seems it appears in the chromium codebase for webcrypto:

https://github.com/scheib/chromium/blob/master/content/child/webcrypto/status.cc#L154

I hope this will help you to reproduce and fix the issue. Please let me know if I can be of further assistance. I also created this issue in the crosswalk jira here:

https://crosswalk-project.org/jira/browse/XWALK-2857

— Reply to this email directly or view it on GitHub https://github.com/MobileChromeApps/mobile-chrome-apps/issues/400.

tanx commented 9 years ago

Crosswalk bug?

Looks like it. I created a ticket here in the crosswalk Jira: https://crosswalk-project.org/jira/browse/XWALK-2857