It's missing the required kty field. This caused the binding layer to reject the object  when importing the key, and |mDataIsJwk| to be used uninitialized later in ImportSymmetricKeyTask::BeforeCrypto. 1- http://dxr.mozilla.org/mozilla-central/source/dom/crypto/WebCryptoTask.cpp#1282
Created attachment 8510318 [details] [diff] [review] Fix JsonWebKey object in test_WebCrypto_JWK This patch properly initializes mDataIsJwk and fixes the JsonWebKey object. However, a proper solution to this probably involves propagating the error from the binding layer instead of swallowing it inside SetKeyData.
Created attachment 8510391 [details] [diff] [review] Fix JsonWebKey object in test_WebCrypto_JWK. This updated version will also abort early when SetKeyData fails in the constructors for Import*KeyTask. Since SetKeyData(const CryptoBuffer &) was already setting mEarlyRv implicitly through SetJwkFromKeyData, I made SetKeyData(JSContext*, JSHandle<JSObject*>) also set mEarlyRv and the ctors return early when it indicates failure.
Assignee: nobody → ggoncalves
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.