Reject with a TypeError rather than DataError when crypto.subtle.importKey() is given wrong data type |
||
Issue descriptionAccording to 14.3.9.6.1 when there is a mismatch between "format" and keyData's type (i.e. expecting a JsonWebKey but got a BufferSource, and vice versa) a TypeError should be returned: https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-importKey Chrome however returns a DataError:
,
Jul 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c28c47588a5093e8383b497c6bc8732f088762b3 commit c28c47588a5093e8383b497c6bc8732f088762b3 Author: eroman <eroman@chromium.org> Date: Wed Jul 20 02:27:21 2016 Miscelaneous updates to WebCrypto to match latest spec. * Matches version 2ac0c945d78d8b66246ce47c5a366a1fd6464aa5 of https://github.com/w3c/webcrypto * Adds comments referencing the spec procedure text * Renames "algorithm" --> "normalizedAlgorithm" to match spec text * Re-orders an algorithm normalization step * Changes DataError --> TypeError for an importKey() case BUG= 628413 Review-Url: https://codereview.chromium.org/2159313002 Cr-Commit-Position: refs/heads/master@{#406467} [modify] https://crrev.com/c28c47588a5093e8383b497c6bc8732f088762b3/third_party/WebKit/LayoutTests/crypto/subtle/hkdf/importKey-failures-expected.txt [modify] https://crrev.com/c28c47588a5093e8383b497c6bc8732f088762b3/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters-expected.txt [modify] https://crrev.com/c28c47588a5093e8383b497c6bc8732f088762b3/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
,
Jul 20 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by eroman@chromium.org
, Jul 19 2016Status: Assigned (was: Available)