Changeset 213489 in webkit


Ignore:
Timestamp:
Mar 6, 2017 6:56:58 PM (7 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebCrypto] Implement ECDH GenerateKey operation
https://bugs.webkit.org/show_bug.cgi?id=169093
<rdar://problem/23789585>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

  • web-platform-tests/WebCryptoAPI/generateKey/failures_ECDH.worker-expected.txt:
  • web-platform-tests/WebCryptoAPI/generateKey/successes_ECDH.worker-expected.txt:
  • web-platform-tests/WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt:
  • web-platform-tests/WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt:

Source/WebCore:

This patch implements GenerateKey operation of ECDH according to:
https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations.
Note: Sad that we are not able to support P-521 at this moment due
to lack of necessary support in the underlying crypto library.

Tests: crypto/subtle/ec-generate-key-malformed-parameters.html

crypto/subtle/ecdh-generate-key-extractable.html
crypto/subtle/ecdh-generate-key-p256.html
crypto/subtle/ecdh-generate-key-p384.html
crypto/subtle/ecdh-generate-key-single-usage.html
crypto/workers/subtle/ec-generate-key.html

  • CMakeLists.txt:
  • DerivedSources.make:
  • PlatformGTK.cmake:
  • PlatformMac.cmake:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSCryptoKeyCustom.cpp:

(WebCore::JSCryptoKey::algorithm):

  • bindings/js/JSSubtleCryptoCustom.cpp:

(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
Add support for ECDH.

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneSerializer::write):
Structured clonable will be added later on.

  • crypto/CommonCryptoUtilities.h:

Add SPI for EC.

  • crypto/CryptoAlgorithmParameters.h:
  • crypto/CryptoKey.h:
  • crypto/algorithms/CryptoAlgorithmECDH.cpp: Added.

(WebCore::CryptoAlgorithmECDH::create):
(WebCore::CryptoAlgorithmECDH::identifier):
(WebCore::CryptoAlgorithmECDH::generateKey):

  • crypto/algorithms/CryptoAlgorithmECDH.h: Added.
  • crypto/gnutls/CryptoKeyECGnuTLS.cpp: Added.

(WebCore::CryptoKeyEC::~CryptoKeyEC):
(WebCore::CryptoKeyEC::platformGeneratePair):

  • crypto/keys/CryptoKeyEC.cpp: Added.

(WebCore::CryptoKeyEC::CryptoKeyEC):
(WebCore::CryptoKeyEC::generatePair):
(WebCore::CryptoKeyEC::buildAlgorithm):
(WebCore::CryptoKeyEC::exportData):

  • crypto/keys/CryptoKeyEC.h: Added.

(WebCore::EcKeyAlgorithm::EcKeyAlgorithm):
(WebCore::EcKeyAlgorithm::namedCurve):

  • crypto/mac/CryptoAlgorithmRegistryMac.cpp:

(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
Add support for ECDH.

  • crypto/mac/CryptoKeyECMac.cpp: Added.

(WebCore::CryptoKeyEC::~CryptoKeyEC):
(WebCore::CryptoKeyEC::platformGeneratePair):

  • crypto/parameters/CryptoAlgorithmEcKeyParams.h: Added.
  • crypto/parameters/EcKeyParams.idl: Added.

LayoutTests:

  • crypto/subtle/ec-generate-key-malformed-parameters-expected.txt: Added.
  • crypto/subtle/ec-generate-key-malformed-parameters.html: Added.
  • crypto/subtle/ecdh-generate-key-extractable-expected.txt: Added.
  • crypto/subtle/ecdh-generate-key-extractable.html: Added.
  • crypto/subtle/ecdh-generate-key-p256-expected.txt: Added.
  • crypto/subtle/ecdh-generate-key-p256.html: Added.
  • crypto/subtle/ecdh-generate-key-p384-expected.txt: Added.
  • crypto/subtle/ecdh-generate-key-p384.html: Added.
  • crypto/subtle/ecdh-generate-key-single-usage-expected.txt: Added.
  • crypto/subtle/ecdh-generate-key-single-usage.html: Added.
  • crypto/workers/subtle/ec-generate-key-expected.txt: Added.
  • crypto/workers/subtle/ec-generate-key.html: Added.
  • crypto/workers/subtle/resources/ec-generate-key.js: Added.
Location:
trunk
Files:
15 added
19 edited
6 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r213480 r213489  
     12017-03-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebCrypto] Implement ECDH GenerateKey operation
     4        https://bugs.webkit.org/show_bug.cgi?id=169093
     5        <rdar://problem/23789585>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * crypto/subtle/ec-generate-key-malformed-parameters-expected.txt: Added.
     10        * crypto/subtle/ec-generate-key-malformed-parameters.html: Added.
     11        * crypto/subtle/ecdh-generate-key-extractable-expected.txt: Added.
     12        * crypto/subtle/ecdh-generate-key-extractable.html: Added.
     13        * crypto/subtle/ecdh-generate-key-p256-expected.txt: Added.
     14        * crypto/subtle/ecdh-generate-key-p256.html: Added.
     15        * crypto/subtle/ecdh-generate-key-p384-expected.txt: Added.
     16        * crypto/subtle/ecdh-generate-key-p384.html: Added.
     17        * crypto/subtle/ecdh-generate-key-single-usage-expected.txt: Added.
     18        * crypto/subtle/ecdh-generate-key-single-usage.html: Added.
     19        * crypto/workers/subtle/ec-generate-key-expected.txt: Added.
     20        * crypto/workers/subtle/ec-generate-key.html: Added.
     21        * crypto/workers/subtle/resources/ec-generate-key.js: Added.
     22
    1232017-03-06  Dave Hyatt  <hyatt@apple.com>
    224
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r213469 r213489  
     12017-03-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebCrypto] Implement ECDH GenerateKey operation
     4        https://bugs.webkit.org/show_bug.cgi?id=169093
     5        <rdar://problem/23789585>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * web-platform-tests/WebCryptoAPI/generateKey/failures_ECDH.worker-expected.txt:
     10        * web-platform-tests/WebCryptoAPI/generateKey/successes_ECDH.worker-expected.txt:
     11        * web-platform-tests/WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt:
     12        * web-platform-tests/WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt:
     13
    1142017-03-06  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/failures_ECDH.worker-expected.txt

    r212124 r213489  
    324324PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits])
    325325PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits])
    326 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    327 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    328 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    329 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    330 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    331 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    332 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    333 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    334 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    335 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    336 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    337 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    338 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    339 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    340 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    341 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    342 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    343 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    344 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    345 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    346 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    347 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    348 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    349 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    350 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    351 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    352 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    353 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    354 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    355 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    356 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    357 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    358 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    359 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    360 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    361 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    362 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    363 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    364 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    365 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    366 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    367 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    368 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    369 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    370 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    371 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    372 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    373 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    374 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    375 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    376 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    377 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    378 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    379 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    380 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    381 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    382 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    383 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    384 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    385 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    386 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    387 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    388 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    389 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    390 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    391 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    392 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    393 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    394 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    395 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    396 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    397 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    398 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    399 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    400 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    401 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    402 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    403 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    404 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    405 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    406 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    407 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    408 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    409 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    410 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    411 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    412 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    413 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    414 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    415 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
     326PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [encrypt])
     327PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, encrypt])
     328PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, encrypt])
     329PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, encrypt])
     330PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
     331PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [decrypt])
     332PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, decrypt])
     333PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, decrypt])
     334PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, decrypt])
     335PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
     336PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [sign])
     337PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, sign])
     338PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, sign])
     339PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, sign])
     340PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign])
     341PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [verify])
     342PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, verify])
     343PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, verify])
     344PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, verify])
     345PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify])
     346PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [wrapKey])
     347PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, wrapKey])
     348PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, wrapKey])
     349PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, wrapKey])
     350PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
     351PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [unwrapKey])
     352PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, unwrapKey])
     353PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, unwrapKey])
     354PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, unwrapKey])
     355PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
     356PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [encrypt])
     357PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, encrypt])
     358PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, encrypt])
     359PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, encrypt])
     360PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
     361PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [decrypt])
     362PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, decrypt])
     363PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, decrypt])
     364PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, decrypt])
     365PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
     366PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [sign])
     367PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, sign])
     368PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, sign])
     369PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, sign])
     370PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign])
     371PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [verify])
     372PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, verify])
     373PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, verify])
     374PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, verify])
     375PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify])
     376PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [wrapKey])
     377PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, wrapKey])
     378PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, wrapKey])
     379PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, wrapKey])
     380PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
     381PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [unwrapKey])
     382PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, unwrapKey])
     383PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, unwrapKey])
     384PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, unwrapKey])
     385PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
     386PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [encrypt])
     387PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, encrypt])
     388PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, encrypt])
     389PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, encrypt])
     390PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
     391PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [decrypt])
     392PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, decrypt])
     393PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, decrypt])
     394PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, decrypt])
     395PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
     396PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [sign])
     397PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, sign])
     398PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, sign])
     399PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, sign])
     400PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign])
     401PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [verify])
     402PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, verify])
     403PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, verify])
     404PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, verify])
     405PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify])
     406PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [wrapKey])
     407PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, wrapKey])
     408PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, wrapKey])
     409PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, wrapKey])
     410PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
     411PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [unwrapKey])
     412PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, unwrapKey])
     413PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, unwrapKey])
     414PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, unwrapKey])
     415PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
    416416PASS Bad algorithm property: generateKey({name: ECDH, namedCurve: P-512}, false, [deriveKey])
    417417PASS Bad algorithm property: generateKey({name: ECDH, namedCurve: P-512}, true, [deriveKey])
     
    434434PASS Bad algorithm property: generateKey({name: ECDH, namedCurve: Curve25519}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
    435435PASS Bad algorithm property: generateKey({name: ECDH, namedCurve: Curve25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
    436 FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-256}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
    437 FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-256}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
    438 FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-384}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
    439 FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-384}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
     436PASS Empty usages: generateKey({name: ECDH, namedCurve: P-256}, false, [])
     437PASS Empty usages: generateKey({name: ECDH, namedCurve: P-256}, true, [])
     438PASS Empty usages: generateKey({name: ECDH, namedCurve: P-384}, false, [])
     439PASS Empty usages: generateKey({name: ECDH, namedCurve: P-384}, true, [])
    440440FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-521}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
    441441FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-521}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_ECDH.worker-expected.txt

    r212124 r213489  
    11
    2 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    3 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    4 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    5 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    6 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    7 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    8 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    9 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    10 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    11 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    12 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    13 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    14 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    15 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    16 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    17 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    18 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    19 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    20 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    21 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    22 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    23 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    24 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    25 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    26 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    27 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    28 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    29 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    30 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    31 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    32 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    33 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    34 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    35 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    36 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    37 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    38 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    39 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    40 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    41 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    42 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    43 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    44 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    45 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    46 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    47 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    48 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    49 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    50 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    51 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    52 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    53 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    54 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    55 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    56 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    57 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    58 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    59 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    60 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    61 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    62 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    63 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    64 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    65 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    66 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    67 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    68 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    69 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    70 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    71 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    72 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    73 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
     2PASS Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey])
     3PASS Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey])
     4PASS Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
     5PASS Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
     6PASS Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits])
     7PASS Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits])
     8PASS Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     9PASS Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     10PASS Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey])
     11PASS Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey])
     12PASS Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
     13PASS Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
     14PASS Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits])
     15PASS Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits])
     16PASS Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     17PASS Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     18FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     19FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     20FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     21FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     22FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     23FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     24FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     25FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     26PASS Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey])
     27PASS Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey])
     28PASS Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey])
     29PASS Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey])
     30PASS Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits])
     31PASS Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits])
     32PASS Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     33PASS Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     34PASS Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey])
     35PASS Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey])
     36PASS Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey])
     37PASS Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey])
     38PASS Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits])
     39PASS Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits])
     40PASS Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     41PASS Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     42FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     43FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     44FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     45FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     46FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     47FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     48FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     49FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     50PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey])
     51PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey])
     52PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey])
     53PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey])
     54PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits])
     55PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits])
     56PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     57PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     58PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey])
     59PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey])
     60PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey])
     61PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey])
     62PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits])
     63PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits])
     64PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     65PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     66FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     67FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     68FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     69FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     70FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     71FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     72FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     73FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
    7474
  • trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt

    r212124 r213489  
    326326PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits])
    327327PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits])
    328 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    329 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    330 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    331 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    332 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    333 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    334 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    335 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    336 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    337 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    338 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    339 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    340 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    341 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    342 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    343 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    344 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    345 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    346 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    347 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    348 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    349 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    350 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    351 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    352 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    353 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    354 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    355 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    356 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    357 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    358 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    359 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    360 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    361 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    362 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    363 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    364 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    365 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    366 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    367 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    368 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    369 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    370 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    371 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    372 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    373 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    374 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    375 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    376 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    377 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    378 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    379 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    380 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    381 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    382 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    383 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    384 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    385 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    386 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    387 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    388 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    389 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    390 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    391 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    392 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    393 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    394 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    395 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    396 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    397 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    398 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    399 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    400 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    401 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    402 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    403 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    404 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    405 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    406 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    407 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    408 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    409 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    410 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    411 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    412 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    413 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    414 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    415 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    416 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
    417 FAIL Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError"
     328PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [encrypt])
     329PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, encrypt])
     330PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, encrypt])
     331PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, encrypt])
     332PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
     333PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [decrypt])
     334PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, decrypt])
     335PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, decrypt])
     336PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, decrypt])
     337PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
     338PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [sign])
     339PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, sign])
     340PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, sign])
     341PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, sign])
     342PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign])
     343PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [verify])
     344PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, verify])
     345PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, verify])
     346PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, verify])
     347PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify])
     348PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [wrapKey])
     349PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, wrapKey])
     350PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, wrapKey])
     351PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, wrapKey])
     352PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
     353PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [unwrapKey])
     354PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, unwrapKey])
     355PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, unwrapKey])
     356PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, unwrapKey])
     357PASS Bad usages: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
     358PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [encrypt])
     359PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, encrypt])
     360PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, encrypt])
     361PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, encrypt])
     362PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
     363PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [decrypt])
     364PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, decrypt])
     365PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, decrypt])
     366PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, decrypt])
     367PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
     368PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [sign])
     369PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, sign])
     370PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, sign])
     371PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, sign])
     372PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign])
     373PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [verify])
     374PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, verify])
     375PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, verify])
     376PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, verify])
     377PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify])
     378PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [wrapKey])
     379PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, wrapKey])
     380PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, wrapKey])
     381PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, wrapKey])
     382PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
     383PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [unwrapKey])
     384PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, unwrapKey])
     385PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, unwrapKey])
     386PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, unwrapKey])
     387PASS Bad usages: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
     388PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [encrypt])
     389PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, encrypt])
     390PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, encrypt])
     391PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, encrypt])
     392PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
     393PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [decrypt])
     394PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, decrypt])
     395PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, decrypt])
     396PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, decrypt])
     397PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
     398PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [sign])
     399PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, sign])
     400PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, sign])
     401PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, sign])
     402PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign])
     403PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [verify])
     404PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, verify])
     405PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, verify])
     406PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, verify])
     407PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify])
     408PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [wrapKey])
     409PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, wrapKey])
     410PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, wrapKey])
     411PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, wrapKey])
     412PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
     413PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [unwrapKey])
     414PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, unwrapKey])
     415PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, unwrapKey])
     416PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, unwrapKey])
     417PASS Bad usages: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
    418418PASS Bad algorithm property: generateKey({name: ECDH, namedCurve: P-512}, false, [deriveKey])
    419419PASS Bad algorithm property: generateKey({name: ECDH, namedCurve: P-512}, true, [deriveKey])
     
    436436PASS Bad algorithm property: generateKey({name: ECDH, namedCurve: Curve25519}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
    437437PASS Bad algorithm property: generateKey({name: ECDH, namedCurve: Curve25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
    438 FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-256}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
    439 FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-256}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
    440 FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-384}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
    441 FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-384}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
     438PASS Empty usages: generateKey({name: ECDH, namedCurve: P-256}, false, [])
     439PASS Empty usages: generateKey({name: ECDH, namedCurve: P-256}, true, [])
     440PASS Empty usages: generateKey({name: ECDH, namedCurve: P-384}, false, [])
     441PASS Empty usages: generateKey({name: ECDH, namedCurve: P-384}, true, [])
    442442FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-521}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
    443443FAIL Empty usages: generateKey({name: ECDH, namedCurve: P-521}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt

    r212124 r213489  
    44
    55
    6 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    7 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    8 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    9 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    10 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    11 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    12 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    13 FAIL Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    14 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    15 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    16 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    17 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    18 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    19 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    20 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    21 FAIL Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    22 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    23 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    24 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    25 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    26 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    27 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    28 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    29 FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    30 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    31 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    32 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    33 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    34 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    35 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    36 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    37 FAIL Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    38 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    39 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    40 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    41 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    42 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    43 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    44 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    45 FAIL Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    46 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    47 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    48 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    49 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    50 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    51 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    52 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    53 FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    54 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    55 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    56 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    57 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    58 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    59 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    60 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    61 FAIL Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    62 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    63 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    64 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    65 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    66 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    67 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    68 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    69 FAIL Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    70 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    71 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    72 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    73 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    74 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    75 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    76 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
    77 FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The operation is not supported. Reached unreachable code
     6PASS Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey])
     7PASS Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey])
     8PASS Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
     9PASS Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
     10PASS Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits])
     11PASS Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits])
     12PASS Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     13PASS Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     14PASS Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey])
     15PASS Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey])
     16PASS Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
     17PASS Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
     18PASS Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits])
     19PASS Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits])
     20PASS Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     21PASS Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     22FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     23FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     24FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     25FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     26FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     27FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     28FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     29FAIL Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     30PASS Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey])
     31PASS Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey])
     32PASS Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey])
     33PASS Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey])
     34PASS Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits])
     35PASS Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits])
     36PASS Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     37PASS Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     38PASS Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey])
     39PASS Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey])
     40PASS Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey])
     41PASS Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey])
     42PASS Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits])
     43PASS Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits])
     44PASS Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     45PASS Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     46FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     47FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     48FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     49FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     50FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     51FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     52FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     53FAIL Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     54PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey])
     55PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey])
     56PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey])
     57PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey])
     58PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits])
     59PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits])
     60PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     61PASS Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     62PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey])
     63PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey])
     64PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey])
     65PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey])
     66PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits])
     67PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits])
     68PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     69PASS Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
     70FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     71FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     72FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     73FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     74FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     75FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     76FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
     77FAIL Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
    7878
  • trunk/Source/WebCore/CMakeLists.txt

    r213455 r213489  
    343343    crypto/parameters/AesGcmParams.idl
    344344    crypto/parameters/AesKeyGenParams.idl
     345    crypto/parameters/EcKeyParams.idl
    345346    crypto/parameters/HmacKeyParams.idl
    346347    crypto/parameters/RsaHashedImportParams.idl
  • trunk/Source/WebCore/ChangeLog

    r213486 r213489  
     12017-03-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebCrypto] Implement ECDH GenerateKey operation
     4        https://bugs.webkit.org/show_bug.cgi?id=169093
     5        <rdar://problem/23789585>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        This patch implements GenerateKey operation of ECDH according to:
     10        https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations.
     11        Note: Sad that we are not able to support P-521 at this moment due
     12        to lack of necessary support in the underlying crypto library.
     13
     14        Tests: crypto/subtle/ec-generate-key-malformed-parameters.html
     15               crypto/subtle/ecdh-generate-key-extractable.html
     16               crypto/subtle/ecdh-generate-key-p256.html
     17               crypto/subtle/ecdh-generate-key-p384.html
     18               crypto/subtle/ecdh-generate-key-single-usage.html
     19               crypto/workers/subtle/ec-generate-key.html
     20
     21        * CMakeLists.txt:
     22        * DerivedSources.make:
     23        * PlatformGTK.cmake:
     24        * PlatformMac.cmake:
     25        * WebCore.xcodeproj/project.pbxproj:
     26        * bindings/js/JSCryptoKeyCustom.cpp:
     27        (WebCore::JSCryptoKey::algorithm):
     28        * bindings/js/JSSubtleCryptoCustom.cpp:
     29        (WebCore::normalizeCryptoAlgorithmParameters):
     30        (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
     31        Add support for ECDH.
     32        * bindings/js/SerializedScriptValue.cpp:
     33        (WebCore::CloneSerializer::write):
     34        Structured clonable will be added later on.
     35        * crypto/CommonCryptoUtilities.h:
     36        Add SPI for EC.
     37        * crypto/CryptoAlgorithmParameters.h:
     38        * crypto/CryptoKey.h:
     39        * crypto/algorithms/CryptoAlgorithmECDH.cpp: Added.
     40        (WebCore::CryptoAlgorithmECDH::create):
     41        (WebCore::CryptoAlgorithmECDH::identifier):
     42        (WebCore::CryptoAlgorithmECDH::generateKey):
     43        * crypto/algorithms/CryptoAlgorithmECDH.h: Added.
     44        * crypto/gnutls/CryptoKeyECGnuTLS.cpp: Added.
     45        (WebCore::CryptoKeyEC::~CryptoKeyEC):
     46        (WebCore::CryptoKeyEC::platformGeneratePair):
     47        * crypto/keys/CryptoKeyEC.cpp: Added.
     48        (WebCore::CryptoKeyEC::CryptoKeyEC):
     49        (WebCore::CryptoKeyEC::generatePair):
     50        (WebCore::CryptoKeyEC::buildAlgorithm):
     51        (WebCore::CryptoKeyEC::exportData):
     52        * crypto/keys/CryptoKeyEC.h: Added.
     53        (WebCore::EcKeyAlgorithm::EcKeyAlgorithm):
     54        (WebCore::EcKeyAlgorithm::namedCurve):
     55        * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
     56        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
     57        Add support for ECDH.
     58        * crypto/mac/CryptoKeyECMac.cpp: Added.
     59        (WebCore::CryptoKeyEC::~CryptoKeyEC):
     60        (WebCore::CryptoKeyEC::platformGeneratePair):
     61        * crypto/parameters/CryptoAlgorithmEcKeyParams.h: Added.
     62        * crypto/parameters/EcKeyParams.idl: Added.
     63
    1642017-03-06  Michael Catanzaro  <mcatanzaro@igalia.com>
    265
  • trunk/Source/WebCore/DerivedSources.make

    r213412 r213489  
    275275    $(WebCore)/crypto/parameters/AesGcmParams.idl \
    276276    $(WebCore)/crypto/parameters/AesKeyGenParams.idl \
     277    $(WebCore)/crypto/parameters/EcKeyParams.idl \
    277278    $(WebCore)/crypto/parameters/HmacKeyParams.idl \
    278279    $(WebCore)/crypto/parameters/RsaHashedImportParams.idl \
  • trunk/Source/WebCore/PlatformGTK.cmake

    r213345 r213489  
    387387        crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
    388388        crypto/algorithms/CryptoAlgorithmAES_KW.cpp
     389        crypto/algorithms/CryptoAlgorithmECDH.cpp
    389390        crypto/algorithms/CryptoAlgorithmHMAC.cpp
    390391        crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
     
    407408        crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp
    408409        crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp
     410        crypto/gnutls/CryptoKeyECGnuTLS.cpp
    409411        crypto/gnutls/CryptoKeyRSAGnuTLS.cpp
    410412        crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp
     
    413415        crypto/keys/CryptoKeyDataOctetSequence.cpp
    414416        crypto/keys/CryptoKeyDataRSAComponents.cpp
     417        crypto/keys/CryptoKeyEC.cpp
    415418        crypto/keys/CryptoKeyHMAC.cpp
    416419        crypto/keys/CryptoKeyRSA.cpp
  • trunk/Source/WebCore/PlatformMac.cmake

    r213345 r213489  
    183183    crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
    184184    crypto/algorithms/CryptoAlgorithmAES_KW.cpp
     185    crypto/algorithms/CryptoAlgorithmECDH.cpp
    185186    crypto/algorithms/CryptoAlgorithmHMAC.cpp
    186187    crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
     
    196197    crypto/keys/CryptoKeyDataOctetSequence.cpp
    197198    crypto/keys/CryptoKeyDataRSAComponents.cpp
     199    crypto/keys/CryptoKeyEC.cpp
    198200    crypto/keys/CryptoKeyHMAC.cpp
    199201    crypto/keys/CryptoKeyRSA.cpp
     
    209211    crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp
    210212    crypto/mac/CryptoAlgorithmRegistryMac.cpp
     213    crypto/mac/CryptoKeyECDHMac.cpp
    211214    crypto/mac/CryptoKeyMac.cpp
    212215    crypto/mac/CryptoKeyRSAMac.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r213464 r213489  
    23612361                5739E12F1DAC7F7800E14383 /* JSCryptoAlgorithmParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 5739E12E1DAC7F7800E14383 /* JSCryptoAlgorithmParameters.h */; };
    23622362                5739E1311DAC7FD100E14383 /* JSCryptoAlgorithmParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5739E1301DAC7FD100E14383 /* JSCryptoAlgorithmParameters.cpp */; };
     2363                5750A9741E68D00000705C4A /* CryptoKeyEC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5750A9721E68D00000705C4A /* CryptoKeyEC.cpp */; };
     2364                5750A9751E68D00000705C4A /* CryptoKeyEC.h in Headers */ = {isa = PBXBuildFile; fileRef = 5750A9731E68D00000705C4A /* CryptoKeyEC.h */; };
     2365                5750A97B1E69161600705C4A /* CryptoKeyECMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5750A97A1E69161600705C4A /* CryptoKeyECMac.cpp */; };
     2366                5750A97E1E6A13EF00705C4A /* CryptoAlgorithmEcKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5750A97D1E6A13EF00705C4A /* CryptoAlgorithmEcKeyParams.h */; };
     2367                5750A9811E6A150800705C4A /* JSEcKeyParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5750A97F1E6A150800705C4A /* JSEcKeyParams.cpp */; };
     2368                5750A9821E6A150800705C4A /* JSEcKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5750A9801E6A150800705C4A /* JSEcKeyParams.h */; };
     2369                5750A9861E6A216800705C4A /* CryptoAlgorithmECDH.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5750A9841E6A216800705C4A /* CryptoAlgorithmECDH.cpp */; };
     2370                5750A9871E6A216800705C4A /* CryptoAlgorithmECDH.h in Headers */ = {isa = PBXBuildFile; fileRef = 5750A9851E6A216800705C4A /* CryptoAlgorithmECDH.h */; };
    23632371                5768E4341DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5768E4331DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h */; };
    23642372                5768E4361DB7527400D0A4F7 /* JSRsaHashedKeyGenParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5768E4351DB7527300D0A4F7 /* JSRsaHashedKeyGenParams.cpp */; };
     
    97699777                574AC7531DAC367D00E9744C /* CryptoAlgorithmParameters.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CryptoAlgorithmParameters.idl; sourceTree = "<group>"; };
    97709778                574D42791D594FF6002CF50E /* GlobalCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GlobalCrypto.idl; sourceTree = "<group>"; };
     9779                5750A9721E68D00000705C4A /* CryptoKeyEC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyEC.cpp; sourceTree = "<group>"; };
     9780                5750A9731E68D00000705C4A /* CryptoKeyEC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyEC.h; sourceTree = "<group>"; };
     9781                5750A97A1E69161600705C4A /* CryptoKeyECMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyECMac.cpp; sourceTree = "<group>"; };
     9782                5750A97C1E6A12B400705C4A /* EcKeyParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = EcKeyParams.idl; sourceTree = "<group>"; };
     9783                5750A97D1E6A13EF00705C4A /* CryptoAlgorithmEcKeyParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmEcKeyParams.h; sourceTree = "<group>"; };
     9784                5750A97F1E6A150800705C4A /* JSEcKeyParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEcKeyParams.cpp; sourceTree = "<group>"; };
     9785                5750A9801E6A150800705C4A /* JSEcKeyParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEcKeyParams.h; sourceTree = "<group>"; };
     9786                5750A9841E6A216800705C4A /* CryptoAlgorithmECDH.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmECDH.cpp; sourceTree = "<group>"; };
     9787                5750A9851E6A216800705C4A /* CryptoAlgorithmECDH.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmECDH.h; sourceTree = "<group>"; };
    97719788                5768E4331DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaHashedKeyGenParams.h; sourceTree = "<group>"; };
    97729789                5768E4351DB7527300D0A4F7 /* JSRsaHashedKeyGenParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRsaHashedKeyGenParams.cpp; sourceTree = "<group>"; };
     
    2355423571                                E1233F0E185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp */,
    2355523572                                E1C266D618317AB4003F8B33 /* CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp */,
     23573                                5750A97A1E69161600705C4A /* CryptoKeyECMac.cpp */,
    2355623574                                E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */,
    2355723575                                E164FAA418315E1A00DB4E61 /* CryptoKeyRSAMac.cpp */,
     
    2357223590                                E1FE1378184D21BB00892F13 /* CryptoAlgorithmAES_KW.cpp */,
    2357323591                                E1FE1379184D21BB00892F13 /* CryptoAlgorithmAES_KW.h */,
     23592                                5750A9841E6A216800705C4A /* CryptoAlgorithmECDH.cpp */,
     23593                                5750A9851E6A216800705C4A /* CryptoAlgorithmECDH.h */,
    2357423594                                E125F82F1822F11B00D84CD9 /* CryptoAlgorithmHMAC.cpp */,
    2357523595                                E125F8301822F11B00D84CD9 /* CryptoAlgorithmHMAC.h */,
     
    2360323623                                E1C266DC18319F31003F8B33 /* CryptoKeyDataRSAComponents.cpp */,
    2360423624                                E1C266DD18319F31003F8B33 /* CryptoKeyDataRSAComponents.h */,
     23625                                5750A9721E68D00000705C4A /* CryptoKeyEC.cpp */,
     23626                                5750A9731E68D00000705C4A /* CryptoKeyEC.h */,
    2360523627                                E125F8331822F18A00D84CD9 /* CryptoKeyHMAC.cpp */,
    2360623628                                E125F8341822F18A00D84CD9 /* CryptoKeyHMAC.h */,
     
    2362423646                                577483111DADC55D00716EF9 /* CryptoAlgorithmAesKeyGenParams.h */,
    2362523647                                E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h */,
     23648                                5750A97D1E6A13EF00705C4A /* CryptoAlgorithmEcKeyParams.h */,
    2362623649                                577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h */,
    2362723650                                E19DA29B18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h */,
     
    2363523658                                E1FE1376184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h */,
    2363623659                                E1BD331B182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h */,
     23660                                5750A97C1E6A12B400705C4A /* EcKeyParams.idl */,
    2363723661                                577483171DB1FE8900716EF9 /* HmacKeyParams.idl */,
    2363823662                                57E2336C1DCD437000F28D01 /* RsaHashedImportParams.idl */,
     
    2380923833                                57D0018E1DD5415300ED19D9 /* JSCryptoKeyUsage.cpp */,
    2381023834                                57D0018C1DD5413200ED19D9 /* JSCryptoKeyUsage.h */,
     23835                                5750A97F1E6A150800705C4A /* JSEcKeyParams.cpp */,
     23836                                5750A9801E6A150800705C4A /* JSEcKeyParams.h */,
    2381123837                                57E233681DCAB24300F28D01 /* JSHmacKeyParams.cpp */,
    2381223838                                57E233661DCAB21C00F28D01 /* JSHmacKeyParams.h */,
     
    2551525541                                FD31600512B0267600C1A359 /* AudioContext.h in Headers */,
    2551625542                                FD31607F12B026F700C1A359 /* AudioDestination.h in Headers */,
     25543                                5750A9871E6A216800705C4A /* CryptoAlgorithmECDH.h in Headers */,
    2551725544                                070F549E17F2402700169E04 /* AudioDestinationConsumer.h in Headers */,
    2551825545                                FD3160BD12B0272A00C1A359 /* AudioDestinationMac.h in Headers */,
     
    2683326860                                652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
    2683426861                                460CBF361D4BCD0E0092E88E /* JSDOMWindowProperties.h in Headers */,
     26862                                5750A97E1E6A13EF00705C4A /* CryptoAlgorithmEcKeyParams.h in Headers */,
    2683526863                                BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */,
    2683626864                                65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */,
     
    2807028098                                4998AEC613F9D0EA0090B1AA /* RequestAnimationFrameCallback.h in Headers */,
    2807128099                                F55B3DD01251F12D003EF269 /* ResetInputType.h in Headers */,
     28100                                5750A9821E6A150800705C4A /* JSEcKeyParams.h in Headers */,
    2807228101                                7EE6846A12D26E3800E79415 /* ResourceError.h in Headers */,
    2807328102                                934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
     
    2839028419                                BC2272870E82E70700E7F975 /* StyleReflection.h in Headers */,
    2839128420                                E461802D1C8DD2900026C02C /* StyleRelations.h in Headers */,
     28421                                5750A9751E68D00000705C4A /* CryptoKeyEC.h in Headers */,
    2839228422                                E4D58EB517B4DBDC00CBDCA8 /* StyleResolveForDocument.h in Headers */,
    2839328423                                E139866415478474001E3F65 /* StyleResolver.h in Headers */,
     
    3082530855                                A77979280D6B9E64003851B9 /* JSImageData.cpp in Sources */,
    3082630856                                A7D0318E0E93540300E24ACD /* JSImageDataCustom.cpp in Sources */,
     30857                                5750A9811E6A150800705C4A /* JSEcKeyParams.cpp in Sources */,
    3082730858                                A86629D409DA2B48009633A6 /* JSInputEvent.cpp in Sources */,
    3082830859                                7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */,
     
    3133831369                                0BCF83F61059C1EB00D999DD /* MathMLFractionElement.cpp in Sources */,
    3133931370                                FABE72F81059C1EB00D999DD /* MathMLMathElement.cpp in Sources */,
     31371                                5750A9741E68D00000705C4A /* CryptoKeyEC.cpp in Sources */,
    3134031372                                05D913CEEAB2A60534218ACF /* MathMLMencloseElement.cpp in Sources */,
    3134131373                                FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */,
     
    3233632368                                310D71951B335C9D009C7B73 /* ThemeCocoa.mm in Sources */,
    3233732369                                44C991A00F3D210E00586670 /* ThemeIOS.mm in Sources */,
     32370                                5750A9861E6A216800705C4A /* CryptoAlgorithmECDH.cpp in Sources */,
    3233832371                                BCE659E90EA92FFA007E4533 /* ThemeMac.mm in Sources */,
    3233932372                                976D6C94122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp in Sources */,
     
    3244732480                                FD7F299613D4C0CB00AD9535 /* WaveShaperProcessor.cpp in Sources */,
    3244832481                                29A8124A0FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.mm in Sources */,
     32482                                5750A97B1E69161600705C4A /* CryptoKeyECMac.cpp in Sources */,
    3244932483                                AAA728F816D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm in Sources */,
    3245032484                                AA478A8016CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.mm in Sources */,
  • trunk/Source/WebCore/bindings/js/JSCryptoKeyCustom.cpp

    r205941 r213489  
    3030
    3131#include "CryptoKeyAES.h"
     32#include "CryptoKeyEC.h"
    3233#include "CryptoKeyHMAC.h"
    3334#include "CryptoKeyRSA.h"
     
    5354        builder.add("name", aesAlgorithm.name());
    5455        builder.add("length", aesAlgorithm.length());
     56        break;
     57    }
     58    case KeyAlgorithmClass::EC: {
     59        auto& ecAlgorithm = downcast<EcKeyAlgorithm>(*algorithm);
     60        builder.add("name", ecAlgorithm.name());
     61        builder.add("namedCurve", ecAlgorithm.namedCurve());
    5562        break;
    5663    }
  • trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp

    r213345 r213489  
    3939#include "JSDOMPromise.h"
    4040#include "JSDOMWrapper.h"
     41#include "JSEcKeyParams.h"
    4142#include "JSHmacKeyParams.h"
    4243#include "JSJsonWebKey.h"
     
    198199                RETURN_IF_EXCEPTION(scope, nullptr);
    199200                result = std::make_unique<CryptoAlgorithmHmacKeyParams>(params);
     201                break;
     202            }
     203            case CryptoAlgorithmIdentifier::ECDSA:
     204            case CryptoAlgorithmIdentifier::ECDH: {
     205                auto params = convertDictionary<CryptoAlgorithmEcKeyParams>(state, value);
     206                RETURN_IF_EXCEPTION(scope, nullptr);
     207                result = std::make_unique<CryptoAlgorithmEcKeyParams>(params);
    200208                break;
    201209            }
     
    725733    };
    726734
    727     // The 11 December 2014 version of the specification suggests we should perform the following task asynchronously
     735    // The 26 January 2017 version of the specification suggests we should perform the following task asynchronously
    728736    // regardless what kind of keys it produces: https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey
    729     // That's simply not efficient for AES and HMAC keys. Therefore, we perform it as an async task conditionally.
     737    // That's simply not efficient for AES, HMAC and EC keys. Therefore, we perform it as an async task only for RSA keys.
    730738    algorithm->generateKey(*params, extractable, keyUsages, WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContextFromExecState(&state));
    731739}
  • trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp

    r212535 r213489  
    12091209            write(downcast<CryptoKeyAES>(*key).key());
    12101210            break;
     1211        case CryptoKeyClass::EC:
     1212            // A dummy implementation for now.
     1213            // FIXME: https://bugs.webkit.org/show_bug.cgi?id=169232
     1214            break;
    12111215        case CryptoKeyClass::RSA:
    12121216            write(CryptoKeyClassSubtag::RSA);
  • trunk/Source/WebCore/crypto/CommonCryptoUtilities.h

    r213345 r213489  
    3434#if USE(APPLE_INTERNAL_SDK)
    3535#include <CommonCrypto/CommonCryptorSPI.h>
     36#include <CommonCrypto/CommonECCryptor.h>
    3637#include <CommonCrypto/CommonRSACryptor.h>
    3738#include <CommonCrypto/CommonRandomSPI.h>
     
    8687extern "C" CCCryptorStatus CCRSACryptorExport(CCRSACryptorRef key, void *out, size_t *outLen);
    8788
     89typedef struct _CCECCryptor *CCECCryptorRef;
     90extern "C" CCCryptorStatus CCECCryptorGeneratePair(size_t keysize, CCECCryptorRef *publicKey, CCECCryptorRef *privateKey);
     91extern "C" void CCECCryptorRelease(CCECCryptorRef key);
     92
    8893#if !USE(APPLE_INTERNAL_SDK)
    8994extern "C" CCCryptorStatus CCCryptorGCM(CCOperation op, CCAlgorithm alg, const void* key, size_t keyLength, const void* iv, size_t ivLen, const void* aData, size_t aDataLen, const void* dataIn, size_t dataInLength, void* dataOut, void* tag, size_t* tagLength);
  • trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h

    r213345 r213489  
    4141        AesGcmParams,
    4242        AesKeyGenParams,
     43        EcKeyParams,
    4344        HmacKeyParams,
    4445        RsaHashedKeyGenParams,
  • trunk/Source/WebCore/crypto/CryptoKey.h

    r208891 r213489  
    4444enum class CryptoKeyClass {
    4545    AES,
     46    EC,
    4647    HMAC,
    4748    RSA
     
    5051enum class KeyAlgorithmClass {
    5152    AES,
     53    EC,
    5254    HMAC,
    5355    HRSA,
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp

    r213486 r213489  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
    27 
    28 #include "CryptoAlgorithmIdentifier.h"
    29 #include <wtf/TypeCasts.h>
    30 #include <wtf/text/WTFString.h>
     26#include "config.h"
     27#include "CryptoAlgorithmECDH.h"
    3128
    3229#if ENABLE(SUBTLE_CRYPTO)
    3330
     31#include "CryptoAlgorithmEcKeyParams.h"
     32#include "CryptoKeyEC.h"
     33#include "ExceptionCode.h"
     34
    3435namespace WebCore {
    3536
    36 class CryptoAlgorithmParameters {
    37 public:
    38     enum class Class {
    39         None,
    40         AesCbcCfbParams,
    41         AesGcmParams,
    42         AesKeyGenParams,
    43         HmacKeyParams,
    44         RsaHashedKeyGenParams,
    45         RsaHashedImportParams,
    46         RsaKeyGenParams,
    47         RsaOaepParams,
    48     };
     37Ref<CryptoAlgorithm> CryptoAlgorithmECDH::create()
     38{
     39    return adoptRef(*new CryptoAlgorithmECDH);
     40}
    4941
    50     // FIXME: Consider merging name and identifier.
    51     String name;
    52     CryptoAlgorithmIdentifier identifier;
     42CryptoAlgorithmIdentifier CryptoAlgorithmECDH::identifier() const
     43{
     44    return s_identifier;
     45}
    5346
    54     virtual ~CryptoAlgorithmParameters() { }
     47void CryptoAlgorithmECDH::generateKey(const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyOrKeyPairCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext&)
     48{
     49    const auto& ecParameters = downcast<CryptoAlgorithmEcKeyParams>(parameters);
    5550
    56     virtual Class parametersClass() const { return Class::None; }
    57 };
     51    if (usages & (CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt | CryptoKeyUsageSign | CryptoKeyUsageVerify | CryptoKeyUsageWrapKey | CryptoKeyUsageUnwrapKey)) {
     52        exceptionCallback(SYNTAX_ERR);
     53        return;
     54    }
     55
     56    auto result = CryptoKeyEC::generatePair(CryptoAlgorithmIdentifier::ECDH, ecParameters.namedCurve, extractable, usages);
     57    if (result.hasException()) {
     58        exceptionCallback(result.releaseException().code());
     59        return;
     60    }
     61
     62    auto pair = result.releaseReturnValue();
     63    pair.publicKey->setUsagesBitmap(0);
     64    pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & (CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits));
     65    callback(WTFMove(pair));
     66}
    5867
    5968} // namespace WebCore
    6069
    61 #define SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(ToClassName) \
    62 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
    63 static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
    64 SPECIALIZE_TYPE_TRAITS_END()
    65 
    6670#endif // ENABLE(SUBTLE_CRYPTO)
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.h

    r213486 r213489  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #include "CryptoAlgorithmIdentifier.h"
    29 #include <wtf/TypeCasts.h>
    30 #include <wtf/text/WTFString.h>
     28#include "CryptoAlgorithm.h"
    3129
    3230#if ENABLE(SUBTLE_CRYPTO)
     
    3432namespace WebCore {
    3533
    36 class CryptoAlgorithmParameters {
     34class CryptoAlgorithmECDH final : public CryptoAlgorithm {
    3735public:
    38     enum class Class {
    39         None,
    40         AesCbcCfbParams,
    41         AesGcmParams,
    42         AesKeyGenParams,
    43         HmacKeyParams,
    44         RsaHashedKeyGenParams,
    45         RsaHashedImportParams,
    46         RsaKeyGenParams,
    47         RsaOaepParams,
    48     };
     36    static constexpr const char* s_name = "ECDH";
     37    static constexpr CryptoAlgorithmIdentifier s_identifier = CryptoAlgorithmIdentifier::ECDH;
     38    static Ref<CryptoAlgorithm> create();
    4939
    50     // FIXME: Consider merging name and identifier.
    51     String name;
    52     CryptoAlgorithmIdentifier identifier;
     40private:
     41    CryptoAlgorithmECDH() = default;
     42    CryptoAlgorithmIdentifier identifier() const final;
    5343
    54     virtual ~CryptoAlgorithmParameters() { }
    55 
    56     virtual Class parametersClass() const { return Class::None; }
     44    void generateKey(const CryptoAlgorithmParameters&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
    5745};
    5846
    5947} // namespace WebCore
    6048
    61 #define SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(ToClassName) \
    62 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
    63 static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
    64 SPECIALIZE_TYPE_TRAITS_END()
    65 
    6649#endif // ENABLE(SUBTLE_CRYPTO)
  • trunk/Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp

    r213486 r213489  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
    27 
    28 #include "CryptoAlgorithmIdentifier.h"
    29 #include <wtf/TypeCasts.h>
    30 #include <wtf/text/WTFString.h>
     26#include "config.h"
     27#include "CryptoKeyEC.h"
    3128
    3229#if ENABLE(SUBTLE_CRYPTO)
    3330
     31#include "CryptoKeyPair.h"
     32#include "NotImplemented.h"
     33
    3434namespace WebCore {
    3535
    36 class CryptoAlgorithmParameters {
    37 public:
    38     enum class Class {
    39         None,
    40         AesCbcCfbParams,
    41         AesGcmParams,
    42         AesKeyGenParams,
    43         HmacKeyParams,
    44         RsaHashedKeyGenParams,
    45         RsaHashedImportParams,
    46         RsaKeyGenParams,
    47         RsaOaepParams,
    48     };
     36struct _PlatformECKeyGnuTLS {
     37};
    4938
    50     // FIXME: Consider merging name and identifier.
    51     String name;
    52     CryptoAlgorithmIdentifier identifier;
     39CryptoKeyEC::~CryptoKeyEC()
     40{
     41    notImplemented();
     42}
    5343
    54     virtual ~CryptoAlgorithmParameters() { }
     44std::optional<CryptoKeyPair> CryptoKeyEC::platformGeneratePair(CryptoAlgorithmIdentifier, NamedCurve, bool, CryptoKeyUsageBitmap)
     45{
     46    notImplemented();
    5547
    56     virtual Class parametersClass() const { return Class::None; }
    57 };
     48    return std::nullopt;
     49}
    5850
    5951} // namespace WebCore
    6052
    61 #define SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(ToClassName) \
    62 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
    63 static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
    64 SPECIALIZE_TYPE_TRAITS_END()
    65 
    6653#endif // ENABLE(SUBTLE_CRYPTO)
  • trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp

    r213345 r213489  
    3333#include "CryptoAlgorithmAES_GCM.h"
    3434#include "CryptoAlgorithmAES_KW.h"
     35#include "CryptoAlgorithmECDH.h"
    3536#include "CryptoAlgorithmHMAC.h"
    3637#include "CryptoAlgorithmRSAES_PKCS1_v1_5.h"
     
    5152    registerAlgorithm<CryptoAlgorithmAES_GCM>();
    5253    registerAlgorithm<CryptoAlgorithmAES_KW>();
     54    registerAlgorithm<CryptoAlgorithmECDH>();
    5355    registerAlgorithm<CryptoAlgorithmHMAC>();
    5456    registerAlgorithm<CryptoAlgorithmRSAES_PKCS1_v1_5>();
  • trunk/Source/WebCore/crypto/mac/CryptoKeyECMac.cpp

    r213486 r213489  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
    27 
    28 #include "CryptoAlgorithmIdentifier.h"
    29 #include <wtf/TypeCasts.h>
    30 #include <wtf/text/WTFString.h>
     26#include "config.h"
     27#include "CryptoKeyEC.h"
    3128
    3229#if ENABLE(SUBTLE_CRYPTO)
    3330
     31#include "CommonCryptoUtilities.h"
     32
    3433namespace WebCore {
    3534
    36 class CryptoAlgorithmParameters {
    37 public:
    38     enum class Class {
    39         None,
    40         AesCbcCfbParams,
    41         AesGcmParams,
    42         AesKeyGenParams,
    43         HmacKeyParams,
    44         RsaHashedKeyGenParams,
    45         RsaHashedImportParams,
    46         RsaKeyGenParams,
    47         RsaOaepParams,
    48     };
     35CryptoKeyEC::~CryptoKeyEC()
     36{
     37    CCECCryptorRelease(m_platformKey);
     38}
    4939
    50     // FIXME: Consider merging name and identifier.
    51     String name;
    52     CryptoAlgorithmIdentifier identifier;
     40std::optional<CryptoKeyPair> CryptoKeyEC::platformGeneratePair(CryptoAlgorithmIdentifier identifier, NamedCurve curve, bool extractable, CryptoKeyUsageBitmap usages)
     41{
     42    size_t size;
     43    switch (curve) {
     44    case NamedCurve::P256:
     45        size = 256;
     46        break;
     47    case NamedCurve::P384:
     48        size = 384;
     49        break;
     50    }
    5351
    54     virtual ~CryptoAlgorithmParameters() { }
     52    CCECCryptorRef ccPublicKey;
     53    CCECCryptorRef ccPrivateKey;
     54    CCCryptorStatus status = CCECCryptorGeneratePair(size, &ccPublicKey, &ccPrivateKey);
     55    if (status)
     56        return std::nullopt;
    5557
    56     virtual Class parametersClass() const { return Class::None; }
    57 };
     58    auto publicKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Public, ccPublicKey, true, usages);
     59    auto privateKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Private, ccPrivateKey, extractable, usages);
     60    return CryptoKeyPair { WTFMove(publicKey), WTFMove(privateKey) };
     61}
    5862
    5963} // namespace WebCore
    6064
    61 #define SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(ToClassName) \
    62 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
    63 static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
    64 SPECIALIZE_TYPE_TRAITS_END()
    65 
    6665#endif // ENABLE(SUBTLE_CRYPTO)
  • trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmEcKeyParams.h

    r213486 r213489  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #include "CryptoAlgorithmIdentifier.h"
    29 #include <wtf/TypeCasts.h>
    30 #include <wtf/text/WTFString.h>
     28#include "CryptoAlgorithmParameters.h"
    3129
    3230#if ENABLE(SUBTLE_CRYPTO)
     
    3432namespace WebCore {
    3533
    36 class CryptoAlgorithmParameters {
     34class CryptoAlgorithmEcKeyParams final : public CryptoAlgorithmParameters {
    3735public:
    38     enum class Class {
    39         None,
    40         AesCbcCfbParams,
    41         AesGcmParams,
    42         AesKeyGenParams,
    43         HmacKeyParams,
    44         RsaHashedKeyGenParams,
    45         RsaHashedImportParams,
    46         RsaKeyGenParams,
    47         RsaOaepParams,
    48     };
     36    String namedCurve;
    4937
    50     // FIXME: Consider merging name and identifier.
    51     String name;
    52     CryptoAlgorithmIdentifier identifier;
    53 
    54     virtual ~CryptoAlgorithmParameters() { }
    55 
    56     virtual Class parametersClass() const { return Class::None; }
     38    Class parametersClass() const final { return Class::EcKeyParams; }
    5739};
    5840
    5941} // namespace WebCore
    6042
    61 #define SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(ToClassName) \
    62 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
    63 static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
    64 SPECIALIZE_TYPE_TRAITS_END()
     43SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(EcKeyParams)
    6544
    6645#endif // ENABLE(SUBTLE_CRYPTO)
  • trunk/Source/WebCore/crypto/parameters/EcKeyParams.idl

    r213486 r213489  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
    27 
    28 #include "CryptoAlgorithmIdentifier.h"
    29 #include <wtf/TypeCasts.h>
    30 #include <wtf/text/WTFString.h>
    31 
    32 #if ENABLE(SUBTLE_CRYPTO)
    33 
    34 namespace WebCore {
    35 
    36 class CryptoAlgorithmParameters {
    37 public:
    38     enum class Class {
    39         None,
    40         AesCbcCfbParams,
    41         AesGcmParams,
    42         AesKeyGenParams,
    43         HmacKeyParams,
    44         RsaHashedKeyGenParams,
    45         RsaHashedImportParams,
    46         RsaKeyGenParams,
    47         RsaOaepParams,
    48     };
    49 
    50     // FIXME: Consider merging name and identifier.
    51     String name;
    52     CryptoAlgorithmIdentifier identifier;
    53 
    54     virtual ~CryptoAlgorithmParameters() { }
    55 
    56     virtual Class parametersClass() const { return Class::None; }
     26// This is a unified dictionary for EcKeyImportParams and EcKeyGenParams.
     27// https://www.w3.org/TR/WebCryptoAPI/#EcKeyImportParams-dictionary, and
     28// https://www.w3.org/TR/WebCryptoAPI/#EcKeyGenParams-dictionary
     29[
     30    Conditional=SUBTLE_CRYPTO,
     31    ImplementedAs=CryptoAlgorithmEcKeyParams
     32] dictionary EcKeyParams : CryptoAlgorithmParameters {
     33    required DOMString namedCurve;
    5734};
    58 
    59 } // namespace WebCore
    60 
    61 #define SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(ToClassName) \
    62 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
    63 static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
    64 SPECIALIZE_TYPE_TRAITS_END()
    65 
    66 #endif // ENABLE(SUBTLE_CRYPTO)
Note: See TracChangeset for help on using the changeset viewer.