Changeset 208891 in webkit


Ignore:
Timestamp:
Nov 18, 2016 1:31:42 PM (7 years ago)
Author:
jiewen_tan@apple.com
Message:

Update SubtleCrypto::encrypt to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164738
<rdar://problem/29257812>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

  • WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt:
  • WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt:
  • WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt:
  • WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt:
  • WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:

  1. It updates the SubtleCrypto::encrypt method to match the latest spec: https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt. It also refers to the latest Editor's Draft to a certain degree: https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-encrypt.
  2. It implements encrypt operations of the following algorithms: AES-CBC, RSAES-PKCS1-V1_5, and RSA-OAEP.
  3. It addes ASSERT(parameters) for every method that accepts a std::unique_ptr<CryptoAlgorithmParameters>&& type parameter.
  4. It changes RefPtr<CryptoKey>&& to Ref<CryptoKey>&& for every method that accepts a CryptoKey.

Tests: crypto/subtle/aes-cbc-encrypt-malformed-parameters.html

crypto/subtle/aes-cbc-import-key-encrypt.html
crypto/subtle/encrypt-malformed-parameters.html
crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html
crypto/subtle/rsa-oaep-import-key-encrypt-label.html
crypto/subtle/rsa-oaep-import-key-encrypt.html
crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html
crypto/workers/subtle/aes-cbc-import-key-encrypt.html
crypto/workers/subtle/rsa-oaep-import-key-encrypt.html
crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html

  • CMakeLists.txt:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/BufferSource.h:

(WebCore::BufferSource::BufferSource):
Add a default constructor for initializing an empty BufferSource object.

  • bindings/js/JSSubtleCryptoCustom.cpp:

(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::JSSubtleCrypto::encrypt):

  • crypto/CryptoAlgorithm.cpp:

(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::exportKey):

  • crypto/CryptoAlgorithm.h:
  • crypto/CryptoAlgorithmParameters.h:
  • crypto/CryptoKey.h:
  • crypto/SubtleCrypto.cpp:

(WebCore::SubtleCrypto::SubtleCrypto):

  • crypto/SubtleCrypto.h:

(WebCore::SubtleCrypto::workQueue):

  • crypto/SubtleCrypto.idl:
  • crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:

(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):

  • crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:

(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):

  • crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:

(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):

  • crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:

(WebCore::CryptoKeyRSA::generatePair):

  • crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:

(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
(WebCore::CryptoAlgorithmAES_CBC::exportKey):

  • crypto/algorithms/CryptoAlgorithmAES_CBC.h:
  • crypto/algorithms/CryptoAlgorithmAES_KW.cpp:

(WebCore::CryptoAlgorithmAES_KW::generateKey):
(WebCore::CryptoAlgorithmAES_KW::importKey):
(WebCore::CryptoAlgorithmAES_KW::exportKey):

  • crypto/algorithms/CryptoAlgorithmAES_KW.h:
  • crypto/algorithms/CryptoAlgorithmHMAC.cpp:

(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
(WebCore::CryptoAlgorithmHMAC::exportKey):

  • crypto/algorithms/CryptoAlgorithmHMAC.h:
  • crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:

(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):

  • crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
  • crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:

(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):

  • crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
  • crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:

(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
(WebCore::CryptoAlgorithmRSA_OAEP::exportKey):

  • crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
  • crypto/keys/CryptoKeyRSA.h:
  • crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:

(WebCore::transformAES_CBC):
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):

  • crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:

(WebCore::encryptRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):

  • crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:

(WebCore::encryptRSA_OAEP):
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):

  • crypto/mac/CryptoKeyRSAMac.cpp:

(WebCore::CryptoKeyRSA::generatePair):

  • crypto/parameters/AesCbcParams.idl: Added.
  • crypto/parameters/CryptoAlgorithmAesCbcParams.h: Added.
  • crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
  • crypto/parameters/CryptoAlgorithmRsaOaepParams.h: Added.
  • crypto/parameters/RsaOaepParams.idl: Added.

LayoutTests:

  • TestExpectations:
  • crypto/subtle/aes-cbc-encrypt-malformed-parameters-expected.txt: Added.
  • crypto/subtle/aes-cbc-encrypt-malformed-parameters.html: Added.
  • crypto/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
  • crypto/subtle/aes-cbc-import-key-encrypt.html: Added.
  • crypto/subtle/encrypt-malformed-parameters-expected.txt: Added.
  • crypto/subtle/encrypt-malformed-parameters.html: Added.
  • crypto/subtle/rsa-oaep-encrypt-malformed-parameters-expected.txt: Added.
  • crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html: Added.
  • crypto/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
  • crypto/subtle/rsa-oaep-import-key-encrypt-label-expected.txt: Added.
  • crypto/subtle/rsa-oaep-import-key-encrypt-label.html: Added.
  • crypto/subtle/rsa-oaep-import-key-encrypt.html: Added.
  • crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
  • crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.
  • crypto/workers/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
  • crypto/workers/subtle/aes-cbc-import-key-encrypt.html: Added.
  • crypto/workers/subtle/resources/aes-cbc-import-key-encrypt.js: Added.
  • crypto/workers/subtle/resources/rsa-oaep-import-key-encrypt.js: Added.
  • crypto/workers/subtle/resources/rsaes-pkcs1-v1_5-import-key-encrypt.js: Added.
  • crypto/workers/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
  • crypto/workers/subtle/rsa-oaep-import-key-encrypt.html: Added.
  • crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
  • crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.
Location:
trunk
Files:
24 added
43 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r208889 r208891  
     12016-11-17  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        Update SubtleCrypto::encrypt to match the latest spec
     4        https://bugs.webkit.org/show_bug.cgi?id=164738
     5        <rdar://problem/29257812>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * TestExpectations:
     10        * crypto/subtle/aes-cbc-encrypt-malformed-parameters-expected.txt: Added.
     11        * crypto/subtle/aes-cbc-encrypt-malformed-parameters.html: Added.
     12        * crypto/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
     13        * crypto/subtle/aes-cbc-import-key-encrypt.html: Added.
     14        * crypto/subtle/encrypt-malformed-parameters-expected.txt: Added.
     15        * crypto/subtle/encrypt-malformed-parameters.html: Added.
     16        * crypto/subtle/rsa-oaep-encrypt-malformed-parameters-expected.txt: Added.
     17        * crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html: Added.
     18        * crypto/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
     19        * crypto/subtle/rsa-oaep-import-key-encrypt-label-expected.txt: Added.
     20        * crypto/subtle/rsa-oaep-import-key-encrypt-label.html: Added.
     21        * crypto/subtle/rsa-oaep-import-key-encrypt.html: Added.
     22        * crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
     23        * crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.
     24        * crypto/workers/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
     25        * crypto/workers/subtle/aes-cbc-import-key-encrypt.html: Added.
     26        * crypto/workers/subtle/resources/aes-cbc-import-key-encrypt.js: Added.
     27        * crypto/workers/subtle/resources/rsa-oaep-import-key-encrypt.js: Added.
     28        * crypto/workers/subtle/resources/rsaes-pkcs1-v1_5-import-key-encrypt.js: Added.
     29        * crypto/workers/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
     30        * crypto/workers/subtle/rsa-oaep-import-key-encrypt.html: Added.
     31        * crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
     32        * crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.
     33
    1342016-11-18  Myles C. Maxfield  <mmaxfield@apple.com>
    235
  • trunk/LayoutTests/TestExpectations

    r208859 r208891  
    920920workers/bomb-with-v8.html [ Skip ]
    921921
    922 # WebCryptoAPI tests, skip for unimplemented features. webkit.org/b/159638
    923 imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html [ Skip ]
    924 imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html [ Skip ]
    925 imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html [ Skip ]
    926 imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html [ Skip ]
    927 # Take too long to complete, need to scale down.
     922# WebCryptoAPI tests that take too long to complete, need to scale down. webkit.org/b/159638
    928923imported/w3c/WebCryptoAPI/generateKey/test_failures.html [ Slow ]
    929924imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html [ Skip ]
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r208872 r208891  
     12016-11-17  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        Update SubtleCrypto::encrypt to match the latest spec
     4        https://bugs.webkit.org/show_bug.cgi?id=164738
     5        <rdar://problem/29257812>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt:
     10        * WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt:
     11        * WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt:
     12        * WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt:
     13        * WebCryptoAPI/idlharness-expected.txt:
     14
    1152016-11-17  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt

    r203201 r208891  
    1 CONSOLE MESSAGE: line 285: TypeError: undefined is not an object (evaluating 'subtle.importKey')
    2 FAIL: Timed out waiting for notifyDone to be called
     1encrypt Tests for AES-CBC
    32
     3
     4PASS AES-CBC 128-bit key
     5PASS AES-CBC 192-bit key
     6PASS AES-CBC 256-bit key
     7PASS AES-CBC 128-bit key with altered plaintext
     8PASS AES-CBC 192-bit key with altered plaintext
     9PASS AES-CBC 256-bit key with altered plaintext
     10FAIL AES-CBC 128-bit key decryption subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     11FAIL AES-CBC 192-bit key decryption subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     12FAIL AES-CBC 256-bit key decryption subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     13FAIL AES-CBC 128-bit key decryption with altered ciphertext subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, ciphertext)', 'subtle.decrypt' is undefined)
     14FAIL AES-CBC 192-bit key decryption with altered ciphertext subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, ciphertext)', 'subtle.decrypt' is undefined)
     15FAIL AES-CBC 256-bit key decryption with altered ciphertext subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, ciphertext)', 'subtle.decrypt' is undefined)
     16PASS AES-CBC 128-bit key without encrypt usage
     17PASS AES-CBC 192-bit key without encrypt usage
     18PASS AES-CBC 256-bit key without encrypt usage
     19FAIL AES-CBC 128-bit key with mismatched key and algorithm assert_equals: Mismatch should cause InvalidAccessError instead of The operation is not supported. expected "InvalidAccessError" but got "NotSupportedError"
     20FAIL AES-CBC 192-bit key with mismatched key and algorithm assert_equals: Mismatch should cause InvalidAccessError instead of The operation is not supported. expected "InvalidAccessError" but got "NotSupportedError"
     21FAIL AES-CBC 256-bit key with mismatched key and algorithm assert_equals: Mismatch should cause InvalidAccessError instead of The operation is not supported. expected "InvalidAccessError" but got "NotSupportedError"
     22FAIL AES-CBC 128-bit key without decrypt usage subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     23FAIL AES-CBC 192-bit key without decrypt usage subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     24FAIL AES-CBC 256-bit key without decrypt usage subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     25PASS AES-CBC 128-bit key, 64-bit IV
     26PASS AES-CBC 128-bit key, 192-bit IV
     27PASS AES-CBC 192-bit key, 64-bit IV
     28PASS AES-CBC 192-bit key, 192-bit IV
     29PASS AES-CBC 256-bit key, 64-bit IV
     30PASS AES-CBC 256-bit key, 192-bit IV
     31FAIL AES-CBC 128-bit key, 64-bit IV decryption subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     32FAIL AES-CBC 128-bit key, 192-bit IV decryption subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     33FAIL AES-CBC 192-bit key, 64-bit IV decryption subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     34FAIL AES-CBC 192-bit key, 192-bit IV decryption subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     35FAIL AES-CBC 256-bit key, 64-bit IV decryption subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     36FAIL AES-CBC 256-bit key, 192-bit IV decryption subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     37FAIL AES-CBC 128-bit key, zeroPadChar subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     38FAIL AES-CBC 128-bit key, bigPadChar subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     39FAIL AES-CBC 128-bit key, inconsistentPadChars subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     40FAIL AES-CBC 192-bit key, zeroPadChar subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     41FAIL AES-CBC 192-bit key, bigPadChar subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     42FAIL AES-CBC 192-bit key, inconsistentPadChars subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     43FAIL AES-CBC 256-bit key, zeroPadChar subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     44FAIL AES-CBC 256-bit key, bigPadChar subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     45FAIL AES-CBC 256-bit key, inconsistentPadChars subtle.decrypt is not a function. (In 'subtle.decrypt(vector.algorithm, vector.key, vector.result)', 'subtle.decrypt' is undefined)
     46
  • trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt

    r203201 r208891  
    1 CONSOLE MESSAGE: line 285: TypeError: undefined is not an object (evaluating 'subtle.importKey')
    2 FAIL: Timed out waiting for notifyDone to be called
     1encrypt Tests for AES-CTR
    32
     3
     4FAIL importKey step: AES-CTR 128-bit key assert_unreached: importKey failed for AES-CTR 128-bit key Reached unreachable code
     5FAIL importKey step: AES-CTR 192-bit key assert_unreached: importKey failed for AES-CTR 192-bit key Reached unreachable code
     6FAIL importKey step: AES-CTR 256-bit key assert_unreached: importKey failed for AES-CTR 256-bit key Reached unreachable code
     7FAIL importKey step: AES-CTR 128-bit key with altered plaintext assert_unreached: importKey failed for AES-CTR 128-bit key Reached unreachable code
     8FAIL importKey step: AES-CTR 192-bit key with altered plaintext assert_unreached: importKey failed for AES-CTR 192-bit key Reached unreachable code
     9FAIL importKey step: AES-CTR 256-bit key with altered plaintext assert_unreached: importKey failed for AES-CTR 256-bit key Reached unreachable code
     10FAIL importKey step for decryption: AES-CTR 128-bit key assert_unreached: importKey failed for AES-CTR 128-bit key Reached unreachable code
     11FAIL importKey step for decryption: AES-CTR 192-bit key assert_unreached: importKey failed for AES-CTR 192-bit key Reached unreachable code
     12FAIL importKey step for decryption: AES-CTR 256-bit key assert_unreached: importKey failed for AES-CTR 256-bit key Reached unreachable code
     13FAIL importKey step for decryption: AES-CTR 128-bit key with altered ciphertext assert_unreached: importKey failed for AES-CTR 128-bit key Reached unreachable code
     14FAIL importKey step for decryption: AES-CTR 192-bit key with altered ciphertext assert_unreached: importKey failed for AES-CTR 192-bit key Reached unreachable code
     15FAIL importKey step for decryption: AES-CTR 256-bit key with altered ciphertext assert_unreached: importKey failed for AES-CTR 256-bit key Reached unreachable code
     16FAIL importKey step: AES-CTR 128-bit key without encrypt usage assert_unreached: importKey failed for AES-CTR 128-bit key Reached unreachable code
     17FAIL importKey step: AES-CTR 192-bit key without encrypt usage assert_unreached: importKey failed for AES-CTR 192-bit key Reached unreachable code
     18FAIL importKey step: AES-CTR 256-bit key without encrypt usage assert_unreached: importKey failed for AES-CTR 256-bit key Reached unreachable code
     19FAIL importKey step: AES-CTR 128-bit key with mismatched key and algorithm assert_unreached: importKey failed for AES-CTR 128-bit key Reached unreachable code
     20FAIL importKey step: AES-CTR 192-bit key with mismatched key and algorithm assert_unreached: importKey failed for AES-CTR 192-bit key Reached unreachable code
     21FAIL importKey step: AES-CTR 256-bit key with mismatched key and algorithm assert_unreached: importKey failed for AES-CTR 256-bit key Reached unreachable code
     22FAIL importKey step: AES-CTR 128-bit key without decrypt usage assert_unreached: importKey failed for AES-CTR 128-bit key Reached unreachable code
     23FAIL importKey step: AES-CTR 192-bit key without decrypt usage assert_unreached: importKey failed for AES-CTR 192-bit key Reached unreachable code
     24FAIL importKey step: AES-CTR 256-bit key without decrypt usage assert_unreached: importKey failed for AES-CTR 256-bit key Reached unreachable code
     25FAIL importKey step: AES-CTR 128-bit key, 0-bit counter assert_unreached: importKey failed for AES-CTR 128-bit key, 0-bit counter Reached unreachable code
     26FAIL importKey step: AES-CTR 128-bit key, 129-bit counter assert_unreached: importKey failed for AES-CTR 128-bit key, 129-bit counter Reached unreachable code
     27FAIL importKey step: AES-CTR 192-bit key, 0-bit counter assert_unreached: importKey failed for AES-CTR 192-bit key, 0-bit counter Reached unreachable code
     28FAIL importKey step: AES-CTR 192-bit key, 129-bit counter assert_unreached: importKey failed for AES-CTR 192-bit key, 129-bit counter Reached unreachable code
     29FAIL importKey step: AES-CTR 256-bit key, 0-bit counter assert_unreached: importKey failed for AES-CTR 256-bit key, 0-bit counter Reached unreachable code
     30FAIL importKey step: AES-CTR 256-bit key, 129-bit counter assert_unreached: importKey failed for AES-CTR 256-bit key, 129-bit counter Reached unreachable code
     31FAIL importKey step: decryption AES-CTR 128-bit key, 0-bit counter assert_unreached: importKey failed for AES-CTR 128-bit key, 0-bit counter Reached unreachable code
     32FAIL importKey step: decryption AES-CTR 128-bit key, 129-bit counter assert_unreached: importKey failed for AES-CTR 128-bit key, 129-bit counter Reached unreachable code
     33FAIL importKey step: decryption AES-CTR 192-bit key, 0-bit counter assert_unreached: importKey failed for AES-CTR 192-bit key, 0-bit counter Reached unreachable code
     34FAIL importKey step: decryption AES-CTR 192-bit key, 129-bit counter assert_unreached: importKey failed for AES-CTR 192-bit key, 129-bit counter Reached unreachable code
     35FAIL importKey step: decryption AES-CTR 256-bit key, 0-bit counter assert_unreached: importKey failed for AES-CTR 256-bit key, 0-bit counter Reached unreachable code
     36FAIL importKey step: decryption AES-CTR 256-bit key, 129-bit counter assert_unreached: importKey failed for AES-CTR 256-bit key, 129-bit counter Reached unreachable code
     37
  • trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt

    r203201 r208891  
    1 CONSOLE MESSAGE: line 285: TypeError: undefined is not an object (evaluating 'subtle.importKey')
    2 FAIL: Timed out waiting for notifyDone to be called
     1encrypt Tests for AES-GCM
    32
     3
     4FAIL importKey step: AES-GCM 128-bit key, 32-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 32-bit tag Reached unreachable code
     5FAIL importKey step: AES-GCM 128-bit key, no additional data, 32-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 32-bit tag Reached unreachable code
     6FAIL importKey step: AES-GCM 128-bit key, 64-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 64-bit tag Reached unreachable code
     7FAIL importKey step: AES-GCM 128-bit key, no additional data, 64-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 64-bit tag Reached unreachable code
     8FAIL importKey step: AES-GCM 128-bit key, 96-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 96-bit tag Reached unreachable code
     9FAIL importKey step: AES-GCM 128-bit key, no additional data, 96-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 96-bit tag Reached unreachable code
     10FAIL importKey step: AES-GCM 128-bit key, 104-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 104-bit tag Reached unreachable code
     11FAIL importKey step: AES-GCM 128-bit key, no additional data, 104-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 104-bit tag Reached unreachable code
     12FAIL importKey step: AES-GCM 128-bit key, 112-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 112-bit tag Reached unreachable code
     13FAIL importKey step: AES-GCM 128-bit key, no additional data, 112-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 112-bit tag Reached unreachable code
     14FAIL importKey step: AES-GCM 128-bit key, 120-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 120-bit tag Reached unreachable code
     15FAIL importKey step: AES-GCM 128-bit key, no additional data, 120-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 120-bit tag Reached unreachable code
     16FAIL importKey step: AES-GCM 128-bit key, 128-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 128-bit tag Reached unreachable code
     17FAIL importKey step: AES-GCM 128-bit key, no additional data, 128-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 128-bit tag Reached unreachable code
     18FAIL importKey step: AES-GCM 192-bit key, 32-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 32-bit tag Reached unreachable code
     19FAIL importKey step: AES-GCM 192-bit key, no additional data, 32-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 32-bit tag Reached unreachable code
     20FAIL importKey step: AES-GCM 192-bit key, 64-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 64-bit tag Reached unreachable code
     21FAIL importKey step: AES-GCM 192-bit key, no additional data, 64-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 64-bit tag Reached unreachable code
     22FAIL importKey step: AES-GCM 192-bit key, 96-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 96-bit tag Reached unreachable code
     23FAIL importKey step: AES-GCM 192-bit key, no additional data, 96-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 96-bit tag Reached unreachable code
     24FAIL importKey step: AES-GCM 192-bit key, 104-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 104-bit tag Reached unreachable code
     25FAIL importKey step: AES-GCM 192-bit key, no additional data, 104-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 104-bit tag Reached unreachable code
     26FAIL importKey step: AES-GCM 192-bit key, 112-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 112-bit tag Reached unreachable code
     27FAIL importKey step: AES-GCM 192-bit key, no additional data, 112-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 112-bit tag Reached unreachable code
     28FAIL importKey step: AES-GCM 192-bit key, 120-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 120-bit tag Reached unreachable code
     29FAIL importKey step: AES-GCM 192-bit key, no additional data, 120-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 120-bit tag Reached unreachable code
     30FAIL importKey step: AES-GCM 192-bit key, 128-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 128-bit tag Reached unreachable code
     31FAIL importKey step: AES-GCM 192-bit key, no additional data, 128-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 128-bit tag Reached unreachable code
     32FAIL importKey step: AES-GCM 256-bit key, 32-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 32-bit tag Reached unreachable code
     33FAIL importKey step: AES-GCM 256-bit key, no additional data, 32-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 32-bit tag Reached unreachable code
     34FAIL importKey step: AES-GCM 256-bit key, 64-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 64-bit tag Reached unreachable code
     35FAIL importKey step: AES-GCM 256-bit key, no additional data, 64-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 64-bit tag Reached unreachable code
     36FAIL importKey step: AES-GCM 256-bit key, 96-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 96-bit tag Reached unreachable code
     37FAIL importKey step: AES-GCM 256-bit key, no additional data, 96-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 96-bit tag Reached unreachable code
     38FAIL importKey step: AES-GCM 256-bit key, 104-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 104-bit tag Reached unreachable code
     39FAIL importKey step: AES-GCM 256-bit key, no additional data, 104-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 104-bit tag Reached unreachable code
     40FAIL importKey step: AES-GCM 256-bit key, 112-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 112-bit tag Reached unreachable code
     41FAIL importKey step: AES-GCM 256-bit key, no additional data, 112-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 112-bit tag Reached unreachable code
     42FAIL importKey step: AES-GCM 256-bit key, 120-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 120-bit tag Reached unreachable code
     43FAIL importKey step: AES-GCM 256-bit key, no additional data, 120-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 120-bit tag Reached unreachable code
     44FAIL importKey step: AES-GCM 256-bit key, 128-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 128-bit tag Reached unreachable code
     45FAIL importKey step: AES-GCM 256-bit key, no additional data, 128-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 128-bit tag Reached unreachable code
     46FAIL importKey step: AES-GCM 128-bit key, 32-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, 32-bit tag Reached unreachable code
     47FAIL importKey step: AES-GCM 128-bit key, no additional data, 32-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 32-bit tag Reached unreachable code
     48FAIL importKey step: AES-GCM 128-bit key, 64-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, 64-bit tag Reached unreachable code
     49FAIL importKey step: AES-GCM 128-bit key, no additional data, 64-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 64-bit tag Reached unreachable code
     50FAIL importKey step: AES-GCM 128-bit key, 96-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, 96-bit tag Reached unreachable code
     51FAIL importKey step: AES-GCM 128-bit key, no additional data, 96-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 96-bit tag Reached unreachable code
     52FAIL importKey step: AES-GCM 128-bit key, 104-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, 104-bit tag Reached unreachable code
     53FAIL importKey step: AES-GCM 128-bit key, no additional data, 104-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 104-bit tag Reached unreachable code
     54FAIL importKey step: AES-GCM 128-bit key, 112-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, 112-bit tag Reached unreachable code
     55FAIL importKey step: AES-GCM 128-bit key, no additional data, 112-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 112-bit tag Reached unreachable code
     56FAIL importKey step: AES-GCM 128-bit key, 120-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, 120-bit tag Reached unreachable code
     57FAIL importKey step: AES-GCM 128-bit key, no additional data, 120-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 120-bit tag Reached unreachable code
     58FAIL importKey step: AES-GCM 128-bit key, 128-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, 128-bit tag Reached unreachable code
     59FAIL importKey step: AES-GCM 128-bit key, no additional data, 128-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 128-bit tag Reached unreachable code
     60FAIL importKey step: AES-GCM 192-bit key, 32-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, 32-bit tag Reached unreachable code
     61FAIL importKey step: AES-GCM 192-bit key, no additional data, 32-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 32-bit tag Reached unreachable code
     62FAIL importKey step: AES-GCM 192-bit key, 64-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, 64-bit tag Reached unreachable code
     63FAIL importKey step: AES-GCM 192-bit key, no additional data, 64-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 64-bit tag Reached unreachable code
     64FAIL importKey step: AES-GCM 192-bit key, 96-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, 96-bit tag Reached unreachable code
     65FAIL importKey step: AES-GCM 192-bit key, no additional data, 96-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 96-bit tag Reached unreachable code
     66FAIL importKey step: AES-GCM 192-bit key, 104-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, 104-bit tag Reached unreachable code
     67FAIL importKey step: AES-GCM 192-bit key, no additional data, 104-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 104-bit tag Reached unreachable code
     68FAIL importKey step: AES-GCM 192-bit key, 112-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, 112-bit tag Reached unreachable code
     69FAIL importKey step: AES-GCM 192-bit key, no additional data, 112-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 112-bit tag Reached unreachable code
     70FAIL importKey step: AES-GCM 192-bit key, 120-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, 120-bit tag Reached unreachable code
     71FAIL importKey step: AES-GCM 192-bit key, no additional data, 120-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 120-bit tag Reached unreachable code
     72FAIL importKey step: AES-GCM 192-bit key, 128-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, 128-bit tag Reached unreachable code
     73FAIL importKey step: AES-GCM 192-bit key, no additional data, 128-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 128-bit tag Reached unreachable code
     74FAIL importKey step: AES-GCM 256-bit key, 32-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, 32-bit tag Reached unreachable code
     75FAIL importKey step: AES-GCM 256-bit key, no additional data, 32-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 32-bit tag Reached unreachable code
     76FAIL importKey step: AES-GCM 256-bit key, 64-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, 64-bit tag Reached unreachable code
     77FAIL importKey step: AES-GCM 256-bit key, no additional data, 64-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 64-bit tag Reached unreachable code
     78FAIL importKey step: AES-GCM 256-bit key, 96-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, 96-bit tag Reached unreachable code
     79FAIL importKey step: AES-GCM 256-bit key, no additional data, 96-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 96-bit tag Reached unreachable code
     80FAIL importKey step: AES-GCM 256-bit key, 104-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, 104-bit tag Reached unreachable code
     81FAIL importKey step: AES-GCM 256-bit key, no additional data, 104-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 104-bit tag Reached unreachable code
     82FAIL importKey step: AES-GCM 256-bit key, 112-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, 112-bit tag Reached unreachable code
     83FAIL importKey step: AES-GCM 256-bit key, no additional data, 112-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 112-bit tag Reached unreachable code
     84FAIL importKey step: AES-GCM 256-bit key, 120-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, 120-bit tag Reached unreachable code
     85FAIL importKey step: AES-GCM 256-bit key, no additional data, 120-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 120-bit tag Reached unreachable code
     86FAIL importKey step: AES-GCM 256-bit key, 128-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, 128-bit tag Reached unreachable code
     87FAIL importKey step: AES-GCM 256-bit key, no additional data, 128-bit tag with altered plaintext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 128-bit tag Reached unreachable code
     88FAIL importKey step for decryption: AES-GCM 128-bit key, 32-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 32-bit tag Reached unreachable code
     89FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 32-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 32-bit tag Reached unreachable code
     90FAIL importKey step for decryption: AES-GCM 128-bit key, 64-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 64-bit tag Reached unreachable code
     91FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 64-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 64-bit tag Reached unreachable code
     92FAIL importKey step for decryption: AES-GCM 128-bit key, 96-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 96-bit tag Reached unreachable code
     93FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 96-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 96-bit tag Reached unreachable code
     94FAIL importKey step for decryption: AES-GCM 128-bit key, 104-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 104-bit tag Reached unreachable code
     95FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 104-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 104-bit tag Reached unreachable code
     96FAIL importKey step for decryption: AES-GCM 128-bit key, 112-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 112-bit tag Reached unreachable code
     97FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 112-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 112-bit tag Reached unreachable code
     98FAIL importKey step for decryption: AES-GCM 128-bit key, 120-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 120-bit tag Reached unreachable code
     99FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 120-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 120-bit tag Reached unreachable code
     100FAIL importKey step for decryption: AES-GCM 128-bit key, 128-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, 128-bit tag Reached unreachable code
     101FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 128-bit tag assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 128-bit tag Reached unreachable code
     102FAIL importKey step for decryption: AES-GCM 192-bit key, 32-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 32-bit tag Reached unreachable code
     103FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 32-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 32-bit tag Reached unreachable code
     104FAIL importKey step for decryption: AES-GCM 192-bit key, 64-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 64-bit tag Reached unreachable code
     105FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 64-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 64-bit tag Reached unreachable code
     106FAIL importKey step for decryption: AES-GCM 192-bit key, 96-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 96-bit tag Reached unreachable code
     107FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 96-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 96-bit tag Reached unreachable code
     108FAIL importKey step for decryption: AES-GCM 192-bit key, 104-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 104-bit tag Reached unreachable code
     109FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 104-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 104-bit tag Reached unreachable code
     110FAIL importKey step for decryption: AES-GCM 192-bit key, 112-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 112-bit tag Reached unreachable code
     111FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 112-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 112-bit tag Reached unreachable code
     112FAIL importKey step for decryption: AES-GCM 192-bit key, 120-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 120-bit tag Reached unreachable code
     113FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 120-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 120-bit tag Reached unreachable code
     114FAIL importKey step for decryption: AES-GCM 192-bit key, 128-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, 128-bit tag Reached unreachable code
     115FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 128-bit tag assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 128-bit tag Reached unreachable code
     116FAIL importKey step for decryption: AES-GCM 256-bit key, 32-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 32-bit tag Reached unreachable code
     117FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 32-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 32-bit tag Reached unreachable code
     118FAIL importKey step for decryption: AES-GCM 256-bit key, 64-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 64-bit tag Reached unreachable code
     119FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 64-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 64-bit tag Reached unreachable code
     120FAIL importKey step for decryption: AES-GCM 256-bit key, 96-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 96-bit tag Reached unreachable code
     121FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 96-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 96-bit tag Reached unreachable code
     122FAIL importKey step for decryption: AES-GCM 256-bit key, 104-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 104-bit tag Reached unreachable code
     123FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 104-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 104-bit tag Reached unreachable code
     124FAIL importKey step for decryption: AES-GCM 256-bit key, 112-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 112-bit tag Reached unreachable code
     125FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 112-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 112-bit tag Reached unreachable code
     126FAIL importKey step for decryption: AES-GCM 256-bit key, 120-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 120-bit tag Reached unreachable code
     127FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 120-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 120-bit tag Reached unreachable code
     128FAIL importKey step for decryption: AES-GCM 256-bit key, 128-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, 128-bit tag Reached unreachable code
     129FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 128-bit tag assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 128-bit tag Reached unreachable code
     130FAIL importKey step for decryption: AES-GCM 128-bit key, 32-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, 32-bit tag Reached unreachable code
     131FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 32-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 32-bit tag Reached unreachable code
     132FAIL importKey step for decryption: AES-GCM 128-bit key, 64-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, 64-bit tag Reached unreachable code
     133FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 64-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 64-bit tag Reached unreachable code
     134FAIL importKey step for decryption: AES-GCM 128-bit key, 96-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, 96-bit tag Reached unreachable code
     135FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 96-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 96-bit tag Reached unreachable code
     136FAIL importKey step for decryption: AES-GCM 128-bit key, 104-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, 104-bit tag Reached unreachable code
     137FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 104-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 104-bit tag Reached unreachable code
     138FAIL importKey step for decryption: AES-GCM 128-bit key, 112-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, 112-bit tag Reached unreachable code
     139FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 112-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 112-bit tag Reached unreachable code
     140FAIL importKey step for decryption: AES-GCM 128-bit key, 120-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, 120-bit tag Reached unreachable code
     141FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 120-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 120-bit tag Reached unreachable code
     142FAIL importKey step for decryption: AES-GCM 128-bit key, 128-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, 128-bit tag Reached unreachable code
     143FAIL importKey step for decryption: AES-GCM 128-bit key, no additional data, 128-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 128-bit tag Reached unreachable code
     144FAIL importKey step for decryption: AES-GCM 192-bit key, 32-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, 32-bit tag Reached unreachable code
     145FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 32-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 32-bit tag Reached unreachable code
     146FAIL importKey step for decryption: AES-GCM 192-bit key, 64-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, 64-bit tag Reached unreachable code
     147FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 64-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 64-bit tag Reached unreachable code
     148FAIL importKey step for decryption: AES-GCM 192-bit key, 96-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, 96-bit tag Reached unreachable code
     149FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 96-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 96-bit tag Reached unreachable code
     150FAIL importKey step for decryption: AES-GCM 192-bit key, 104-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, 104-bit tag Reached unreachable code
     151FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 104-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 104-bit tag Reached unreachable code
     152FAIL importKey step for decryption: AES-GCM 192-bit key, 112-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, 112-bit tag Reached unreachable code
     153FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 112-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 112-bit tag Reached unreachable code
     154FAIL importKey step for decryption: AES-GCM 192-bit key, 120-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, 120-bit tag Reached unreachable code
     155FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 120-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 120-bit tag Reached unreachable code
     156FAIL importKey step for decryption: AES-GCM 192-bit key, 128-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, 128-bit tag Reached unreachable code
     157FAIL importKey step for decryption: AES-GCM 192-bit key, no additional data, 128-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 128-bit tag Reached unreachable code
     158FAIL importKey step for decryption: AES-GCM 256-bit key, 32-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, 32-bit tag Reached unreachable code
     159FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 32-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 32-bit tag Reached unreachable code
     160FAIL importKey step for decryption: AES-GCM 256-bit key, 64-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, 64-bit tag Reached unreachable code
     161FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 64-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 64-bit tag Reached unreachable code
     162FAIL importKey step for decryption: AES-GCM 256-bit key, 96-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, 96-bit tag Reached unreachable code
     163FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 96-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 96-bit tag Reached unreachable code
     164FAIL importKey step for decryption: AES-GCM 256-bit key, 104-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, 104-bit tag Reached unreachable code
     165FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 104-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 104-bit tag Reached unreachable code
     166FAIL importKey step for decryption: AES-GCM 256-bit key, 112-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, 112-bit tag Reached unreachable code
     167FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 112-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 112-bit tag Reached unreachable code
     168FAIL importKey step for decryption: AES-GCM 256-bit key, 120-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, 120-bit tag Reached unreachable code
     169FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 120-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 120-bit tag Reached unreachable code
     170FAIL importKey step for decryption: AES-GCM 256-bit key, 128-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, 128-bit tag Reached unreachable code
     171FAIL importKey step for decryption: AES-GCM 256-bit key, no additional data, 128-bit tag with altered ciphertext assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 128-bit tag Reached unreachable code
     172FAIL importKey step: AES-GCM 128-bit key, 32-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 32-bit tag Reached unreachable code
     173FAIL importKey step: AES-GCM 128-bit key, no additional data, 32-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 32-bit tag Reached unreachable code
     174FAIL importKey step: AES-GCM 128-bit key, 64-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 64-bit tag Reached unreachable code
     175FAIL importKey step: AES-GCM 128-bit key, no additional data, 64-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 64-bit tag Reached unreachable code
     176FAIL importKey step: AES-GCM 128-bit key, 96-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 96-bit tag Reached unreachable code
     177FAIL importKey step: AES-GCM 128-bit key, no additional data, 96-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 96-bit tag Reached unreachable code
     178FAIL importKey step: AES-GCM 128-bit key, 104-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 104-bit tag Reached unreachable code
     179FAIL importKey step: AES-GCM 128-bit key, no additional data, 104-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 104-bit tag Reached unreachable code
     180FAIL importKey step: AES-GCM 128-bit key, 112-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 112-bit tag Reached unreachable code
     181FAIL importKey step: AES-GCM 128-bit key, no additional data, 112-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 112-bit tag Reached unreachable code
     182FAIL importKey step: AES-GCM 128-bit key, 120-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 120-bit tag Reached unreachable code
     183FAIL importKey step: AES-GCM 128-bit key, no additional data, 120-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 120-bit tag Reached unreachable code
     184FAIL importKey step: AES-GCM 128-bit key, 128-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 128-bit tag Reached unreachable code
     185FAIL importKey step: AES-GCM 128-bit key, no additional data, 128-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 128-bit tag Reached unreachable code
     186FAIL importKey step: AES-GCM 192-bit key, 32-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 32-bit tag Reached unreachable code
     187FAIL importKey step: AES-GCM 192-bit key, no additional data, 32-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 32-bit tag Reached unreachable code
     188FAIL importKey step: AES-GCM 192-bit key, 64-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 64-bit tag Reached unreachable code
     189FAIL importKey step: AES-GCM 192-bit key, no additional data, 64-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 64-bit tag Reached unreachable code
     190FAIL importKey step: AES-GCM 192-bit key, 96-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 96-bit tag Reached unreachable code
     191FAIL importKey step: AES-GCM 192-bit key, no additional data, 96-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 96-bit tag Reached unreachable code
     192FAIL importKey step: AES-GCM 192-bit key, 104-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 104-bit tag Reached unreachable code
     193FAIL importKey step: AES-GCM 192-bit key, no additional data, 104-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 104-bit tag Reached unreachable code
     194FAIL importKey step: AES-GCM 192-bit key, 112-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 112-bit tag Reached unreachable code
     195FAIL importKey step: AES-GCM 192-bit key, no additional data, 112-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 112-bit tag Reached unreachable code
     196FAIL importKey step: AES-GCM 192-bit key, 120-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 120-bit tag Reached unreachable code
     197FAIL importKey step: AES-GCM 192-bit key, no additional data, 120-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 120-bit tag Reached unreachable code
     198FAIL importKey step: AES-GCM 192-bit key, 128-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 128-bit tag Reached unreachable code
     199FAIL importKey step: AES-GCM 192-bit key, no additional data, 128-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 128-bit tag Reached unreachable code
     200FAIL importKey step: AES-GCM 256-bit key, 32-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 32-bit tag Reached unreachable code
     201FAIL importKey step: AES-GCM 256-bit key, no additional data, 32-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 32-bit tag Reached unreachable code
     202FAIL importKey step: AES-GCM 256-bit key, 64-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 64-bit tag Reached unreachable code
     203FAIL importKey step: AES-GCM 256-bit key, no additional data, 64-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 64-bit tag Reached unreachable code
     204FAIL importKey step: AES-GCM 256-bit key, 96-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 96-bit tag Reached unreachable code
     205FAIL importKey step: AES-GCM 256-bit key, no additional data, 96-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 96-bit tag Reached unreachable code
     206FAIL importKey step: AES-GCM 256-bit key, 104-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 104-bit tag Reached unreachable code
     207FAIL importKey step: AES-GCM 256-bit key, no additional data, 104-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 104-bit tag Reached unreachable code
     208FAIL importKey step: AES-GCM 256-bit key, 112-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 112-bit tag Reached unreachable code
     209FAIL importKey step: AES-GCM 256-bit key, no additional data, 112-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 112-bit tag Reached unreachable code
     210FAIL importKey step: AES-GCM 256-bit key, 120-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 120-bit tag Reached unreachable code
     211FAIL importKey step: AES-GCM 256-bit key, no additional data, 120-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 120-bit tag Reached unreachable code
     212FAIL importKey step: AES-GCM 256-bit key, 128-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 128-bit tag Reached unreachable code
     213FAIL importKey step: AES-GCM 256-bit key, no additional data, 128-bit tag without encrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 128-bit tag Reached unreachable code
     214FAIL importKey step: AES-GCM 128-bit key, 32-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, 32-bit tag Reached unreachable code
     215FAIL importKey step: AES-GCM 128-bit key, no additional data, 32-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 32-bit tag Reached unreachable code
     216FAIL importKey step: AES-GCM 128-bit key, 64-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, 64-bit tag Reached unreachable code
     217FAIL importKey step: AES-GCM 128-bit key, no additional data, 64-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 64-bit tag Reached unreachable code
     218FAIL importKey step: AES-GCM 128-bit key, 96-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, 96-bit tag Reached unreachable code
     219FAIL importKey step: AES-GCM 128-bit key, no additional data, 96-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 96-bit tag Reached unreachable code
     220FAIL importKey step: AES-GCM 128-bit key, 104-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, 104-bit tag Reached unreachable code
     221FAIL importKey step: AES-GCM 128-bit key, no additional data, 104-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 104-bit tag Reached unreachable code
     222FAIL importKey step: AES-GCM 128-bit key, 112-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, 112-bit tag Reached unreachable code
     223FAIL importKey step: AES-GCM 128-bit key, no additional data, 112-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 112-bit tag Reached unreachable code
     224FAIL importKey step: AES-GCM 128-bit key, 120-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, 120-bit tag Reached unreachable code
     225FAIL importKey step: AES-GCM 128-bit key, no additional data, 120-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 120-bit tag Reached unreachable code
     226FAIL importKey step: AES-GCM 128-bit key, 128-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, 128-bit tag Reached unreachable code
     227FAIL importKey step: AES-GCM 128-bit key, no additional data, 128-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 128-bit tag Reached unreachable code
     228FAIL importKey step: AES-GCM 192-bit key, 32-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, 32-bit tag Reached unreachable code
     229FAIL importKey step: AES-GCM 192-bit key, no additional data, 32-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 32-bit tag Reached unreachable code
     230FAIL importKey step: AES-GCM 192-bit key, 64-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, 64-bit tag Reached unreachable code
     231FAIL importKey step: AES-GCM 192-bit key, no additional data, 64-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 64-bit tag Reached unreachable code
     232FAIL importKey step: AES-GCM 192-bit key, 96-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, 96-bit tag Reached unreachable code
     233FAIL importKey step: AES-GCM 192-bit key, no additional data, 96-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 96-bit tag Reached unreachable code
     234FAIL importKey step: AES-GCM 192-bit key, 104-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, 104-bit tag Reached unreachable code
     235FAIL importKey step: AES-GCM 192-bit key, no additional data, 104-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 104-bit tag Reached unreachable code
     236FAIL importKey step: AES-GCM 192-bit key, 112-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, 112-bit tag Reached unreachable code
     237FAIL importKey step: AES-GCM 192-bit key, no additional data, 112-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 112-bit tag Reached unreachable code
     238FAIL importKey step: AES-GCM 192-bit key, 120-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, 120-bit tag Reached unreachable code
     239FAIL importKey step: AES-GCM 192-bit key, no additional data, 120-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 120-bit tag Reached unreachable code
     240FAIL importKey step: AES-GCM 192-bit key, 128-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, 128-bit tag Reached unreachable code
     241FAIL importKey step: AES-GCM 192-bit key, no additional data, 128-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 128-bit tag Reached unreachable code
     242FAIL importKey step: AES-GCM 256-bit key, 32-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, 32-bit tag Reached unreachable code
     243FAIL importKey step: AES-GCM 256-bit key, no additional data, 32-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 32-bit tag Reached unreachable code
     244FAIL importKey step: AES-GCM 256-bit key, 64-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, 64-bit tag Reached unreachable code
     245FAIL importKey step: AES-GCM 256-bit key, no additional data, 64-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 64-bit tag Reached unreachable code
     246FAIL importKey step: AES-GCM 256-bit key, 96-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, 96-bit tag Reached unreachable code
     247FAIL importKey step: AES-GCM 256-bit key, no additional data, 96-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 96-bit tag Reached unreachable code
     248FAIL importKey step: AES-GCM 256-bit key, 104-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, 104-bit tag Reached unreachable code
     249FAIL importKey step: AES-GCM 256-bit key, no additional data, 104-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 104-bit tag Reached unreachable code
     250FAIL importKey step: AES-GCM 256-bit key, 112-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, 112-bit tag Reached unreachable code
     251FAIL importKey step: AES-GCM 256-bit key, no additional data, 112-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 112-bit tag Reached unreachable code
     252FAIL importKey step: AES-GCM 256-bit key, 120-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, 120-bit tag Reached unreachable code
     253FAIL importKey step: AES-GCM 256-bit key, no additional data, 120-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 120-bit tag Reached unreachable code
     254FAIL importKey step: AES-GCM 256-bit key, 128-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, 128-bit tag Reached unreachable code
     255FAIL importKey step: AES-GCM 256-bit key, no additional data, 128-bit tag with mismatched key and algorithm assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 128-bit tag Reached unreachable code
     256FAIL importKey step: AES-GCM 128-bit key, 32-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 32-bit tag Reached unreachable code
     257FAIL importKey step: AES-GCM 128-bit key, no additional data, 32-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 32-bit tag Reached unreachable code
     258FAIL importKey step: AES-GCM 128-bit key, 64-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 64-bit tag Reached unreachable code
     259FAIL importKey step: AES-GCM 128-bit key, no additional data, 64-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 64-bit tag Reached unreachable code
     260FAIL importKey step: AES-GCM 128-bit key, 96-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 96-bit tag Reached unreachable code
     261FAIL importKey step: AES-GCM 128-bit key, no additional data, 96-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 96-bit tag Reached unreachable code
     262FAIL importKey step: AES-GCM 128-bit key, 104-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 104-bit tag Reached unreachable code
     263FAIL importKey step: AES-GCM 128-bit key, no additional data, 104-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 104-bit tag Reached unreachable code
     264FAIL importKey step: AES-GCM 128-bit key, 112-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 112-bit tag Reached unreachable code
     265FAIL importKey step: AES-GCM 128-bit key, no additional data, 112-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 112-bit tag Reached unreachable code
     266FAIL importKey step: AES-GCM 128-bit key, 120-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 120-bit tag Reached unreachable code
     267FAIL importKey step: AES-GCM 128-bit key, no additional data, 120-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 120-bit tag Reached unreachable code
     268FAIL importKey step: AES-GCM 128-bit key, 128-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, 128-bit tag Reached unreachable code
     269FAIL importKey step: AES-GCM 128-bit key, no additional data, 128-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 128-bit key, no additional data, 128-bit tag Reached unreachable code
     270FAIL importKey step: AES-GCM 192-bit key, 32-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 32-bit tag Reached unreachable code
     271FAIL importKey step: AES-GCM 192-bit key, no additional data, 32-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 32-bit tag Reached unreachable code
     272FAIL importKey step: AES-GCM 192-bit key, 64-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 64-bit tag Reached unreachable code
     273FAIL importKey step: AES-GCM 192-bit key, no additional data, 64-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 64-bit tag Reached unreachable code
     274FAIL importKey step: AES-GCM 192-bit key, 96-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 96-bit tag Reached unreachable code
     275FAIL importKey step: AES-GCM 192-bit key, no additional data, 96-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 96-bit tag Reached unreachable code
     276FAIL importKey step: AES-GCM 192-bit key, 104-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 104-bit tag Reached unreachable code
     277FAIL importKey step: AES-GCM 192-bit key, no additional data, 104-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 104-bit tag Reached unreachable code
     278FAIL importKey step: AES-GCM 192-bit key, 112-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 112-bit tag Reached unreachable code
     279FAIL importKey step: AES-GCM 192-bit key, no additional data, 112-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 112-bit tag Reached unreachable code
     280FAIL importKey step: AES-GCM 192-bit key, 120-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 120-bit tag Reached unreachable code
     281FAIL importKey step: AES-GCM 192-bit key, no additional data, 120-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 120-bit tag Reached unreachable code
     282FAIL importKey step: AES-GCM 192-bit key, 128-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, 128-bit tag Reached unreachable code
     283FAIL importKey step: AES-GCM 192-bit key, no additional data, 128-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 192-bit key, no additional data, 128-bit tag Reached unreachable code
     284FAIL importKey step: AES-GCM 256-bit key, 32-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 32-bit tag Reached unreachable code
     285FAIL importKey step: AES-GCM 256-bit key, no additional data, 32-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 32-bit tag Reached unreachable code
     286FAIL importKey step: AES-GCM 256-bit key, 64-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 64-bit tag Reached unreachable code
     287FAIL importKey step: AES-GCM 256-bit key, no additional data, 64-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 64-bit tag Reached unreachable code
     288FAIL importKey step: AES-GCM 256-bit key, 96-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 96-bit tag Reached unreachable code
     289FAIL importKey step: AES-GCM 256-bit key, no additional data, 96-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 96-bit tag Reached unreachable code
     290FAIL importKey step: AES-GCM 256-bit key, 104-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 104-bit tag Reached unreachable code
     291FAIL importKey step: AES-GCM 256-bit key, no additional data, 104-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 104-bit tag Reached unreachable code
     292FAIL importKey step: AES-GCM 256-bit key, 112-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 112-bit tag Reached unreachable code
     293FAIL importKey step: AES-GCM 256-bit key, no additional data, 112-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 112-bit tag Reached unreachable code
     294FAIL importKey step: AES-GCM 256-bit key, 120-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 120-bit tag Reached unreachable code
     295FAIL importKey step: AES-GCM 256-bit key, no additional data, 120-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 120-bit tag Reached unreachable code
     296FAIL importKey step: AES-GCM 256-bit key, 128-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, 128-bit tag Reached unreachable code
     297FAIL importKey step: AES-GCM 256-bit key, no additional data, 128-bit tag without decrypt usage assert_unreached: importKey failed for AES-GCM 256-bit key, no additional data, 128-bit tag Reached unreachable code
     298FAIL importKey step: AES-GCM 128-bit key, illegal tag length 24-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 24-bits Reached unreachable code
     299FAIL importKey step: AES-GCM 128-bit key, illegal tag length 48-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 48-bits Reached unreachable code
     300FAIL importKey step: AES-GCM 128-bit key, illegal tag length 72-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 72-bits Reached unreachable code
     301FAIL importKey step: AES-GCM 128-bit key, illegal tag length 95-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 95-bits Reached unreachable code
     302FAIL importKey step: AES-GCM 128-bit key, illegal tag length 129-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 129-bits Reached unreachable code
     303FAIL importKey step: AES-GCM 128-bit key, illegal tag length 256-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 256-bits Reached unreachable code
     304FAIL importKey step: AES-GCM 192-bit key, illegal tag length 24-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 24-bits Reached unreachable code
     305FAIL importKey step: AES-GCM 192-bit key, illegal tag length 48-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 48-bits Reached unreachable code
     306FAIL importKey step: AES-GCM 192-bit key, illegal tag length 72-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 72-bits Reached unreachable code
     307FAIL importKey step: AES-GCM 192-bit key, illegal tag length 95-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 95-bits Reached unreachable code
     308FAIL importKey step: AES-GCM 192-bit key, illegal tag length 129-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 129-bits Reached unreachable code
     309FAIL importKey step: AES-GCM 192-bit key, illegal tag length 256-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 256-bits Reached unreachable code
     310FAIL importKey step: AES-GCM 256-bit key, illegal tag length 24-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 24-bits Reached unreachable code
     311FAIL importKey step: AES-GCM 256-bit key, illegal tag length 48-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 48-bits Reached unreachable code
     312FAIL importKey step: AES-GCM 256-bit key, illegal tag length 72-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 72-bits Reached unreachable code
     313FAIL importKey step: AES-GCM 256-bit key, illegal tag length 95-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 95-bits Reached unreachable code
     314FAIL importKey step: AES-GCM 256-bit key, illegal tag length 129-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 129-bits Reached unreachable code
     315FAIL importKey step: AES-GCM 256-bit key, illegal tag length 256-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 256-bits Reached unreachable code
     316FAIL importKey step: decryption AES-GCM 128-bit key, illegal tag length 24-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 24-bits Reached unreachable code
     317FAIL importKey step: decryption AES-GCM 128-bit key, illegal tag length 48-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 48-bits Reached unreachable code
     318FAIL importKey step: decryption AES-GCM 128-bit key, illegal tag length 72-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 72-bits Reached unreachable code
     319FAIL importKey step: decryption AES-GCM 128-bit key, illegal tag length 95-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 95-bits Reached unreachable code
     320FAIL importKey step: decryption AES-GCM 128-bit key, illegal tag length 129-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 129-bits Reached unreachable code
     321FAIL importKey step: decryption AES-GCM 128-bit key, illegal tag length 256-bits assert_unreached: importKey failed for AES-GCM 128-bit key, illegal tag length 256-bits Reached unreachable code
     322FAIL importKey step: decryption AES-GCM 192-bit key, illegal tag length 24-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 24-bits Reached unreachable code
     323FAIL importKey step: decryption AES-GCM 192-bit key, illegal tag length 48-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 48-bits Reached unreachable code
     324FAIL importKey step: decryption AES-GCM 192-bit key, illegal tag length 72-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 72-bits Reached unreachable code
     325FAIL importKey step: decryption AES-GCM 192-bit key, illegal tag length 95-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 95-bits Reached unreachable code
     326FAIL importKey step: decryption AES-GCM 192-bit key, illegal tag length 129-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 129-bits Reached unreachable code
     327FAIL importKey step: decryption AES-GCM 192-bit key, illegal tag length 256-bits assert_unreached: importKey failed for AES-GCM 192-bit key, illegal tag length 256-bits Reached unreachable code
     328FAIL importKey step: decryption AES-GCM 256-bit key, illegal tag length 24-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 24-bits Reached unreachable code
     329FAIL importKey step: decryption AES-GCM 256-bit key, illegal tag length 48-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 48-bits Reached unreachable code
     330FAIL importKey step: decryption AES-GCM 256-bit key, illegal tag length 72-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 72-bits Reached unreachable code
     331FAIL importKey step: decryption AES-GCM 256-bit key, illegal tag length 95-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 95-bits Reached unreachable code
     332FAIL importKey step: decryption AES-GCM 256-bit key, illegal tag length 129-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 129-bits Reached unreachable code
     333FAIL importKey step: decryption AES-GCM 256-bit key, illegal tag length 256-bits assert_unreached: importKey failed for AES-GCM 256-bit key, illegal tag length 256-bits Reached unreachable code
     334
  • trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt

    r203201 r208891  
    1 CONSOLE MESSAGE: line 313: TypeError: undefined is not an object (evaluating 'subtle.importKey')
    2 FAIL: Timed out waiting for notifyDone to be called
     1encrypt Tests for RSA-OAEP
    32
     3
     4FAIL importVectorKeys step: RSA-OAEP with SHA-1 and no label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     5FAIL importVectorKeys step: RSA-OAEP with SHA-256 and no label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     6FAIL importVectorKeys step: RSA-OAEP with SHA-384 and no label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     7FAIL importVectorKeys step: RSA-OAEP with SHA-512 and no label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     8FAIL importVectorKeys step: RSA-OAEP with SHA-1 and empty label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     9FAIL importVectorKeys step: RSA-OAEP with SHA-256 and empty label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     10FAIL importVectorKeys step: RSA-OAEP with SHA-384 and empty label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     11FAIL importVectorKeys step: RSA-OAEP with SHA-512 and empty label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     12FAIL importVectorKeys step: RSA-OAEP with SHA-1 and a label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     13FAIL importVectorKeys step: RSA-OAEP with SHA-256 and a label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     14FAIL importVectorKeys step: RSA-OAEP with SHA-384 and a label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     15FAIL importVectorKeys step: RSA-OAEP with SHA-512 and a label decryption assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     16FAIL importVectorKeys step: RSA-OAEP with SHA-1 and no label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     17FAIL importVectorKeys step: RSA-OAEP with SHA-256 and no label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     18FAIL importVectorKeys step: RSA-OAEP with SHA-384 and no label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     19FAIL importVectorKeys step: RSA-OAEP with SHA-512 and no label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     20FAIL importVectorKeys step: RSA-OAEP with SHA-1 and empty label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     21FAIL importVectorKeys step: RSA-OAEP with SHA-256 and empty label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     22FAIL importVectorKeys step: RSA-OAEP with SHA-384 and empty label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     23FAIL importVectorKeys step: RSA-OAEP with SHA-512 and empty label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     24FAIL importVectorKeys step: RSA-OAEP with SHA-1 and a label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     25FAIL importVectorKeys step: RSA-OAEP with SHA-256 and a label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     26FAIL importVectorKeys step: RSA-OAEP with SHA-384 and a label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     27FAIL importVectorKeys step: RSA-OAEP with SHA-512 and a label decryption with altered ciphertext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     28FAIL importVectorKeys step: RSA-OAEP with SHA-1 and no label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     29FAIL importVectorKeys step: RSA-OAEP with SHA-256 and no label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     30FAIL importVectorKeys step: RSA-OAEP with SHA-384 and no label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     31FAIL importVectorKeys step: RSA-OAEP with SHA-512 and no label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     32FAIL importVectorKeys step: RSA-OAEP with SHA-1 and empty label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     33FAIL importVectorKeys step: RSA-OAEP with SHA-256 and empty label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     34FAIL importVectorKeys step: RSA-OAEP with SHA-384 and empty label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     35FAIL importVectorKeys step: RSA-OAEP with SHA-512 and empty label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     36FAIL importVectorKeys step: RSA-OAEP with SHA-1 and a label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     37FAIL importVectorKeys step: RSA-OAEP with SHA-256 and a label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     38FAIL importVectorKeys step: RSA-OAEP with SHA-384 and a label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     39FAIL importVectorKeys step: RSA-OAEP with SHA-512 and a label using publicKey to decrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     40FAIL importVectorKeys step: RSA-OAEP with SHA-1 and no label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     41FAIL importVectorKeys step: RSA-OAEP with SHA-256 and no label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     42FAIL importVectorKeys step: RSA-OAEP with SHA-384 and no label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     43FAIL importVectorKeys step: RSA-OAEP with SHA-512 and no label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     44FAIL importVectorKeys step: RSA-OAEP with SHA-1 and empty label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     45FAIL importVectorKeys step: RSA-OAEP with SHA-256 and empty label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     46FAIL importVectorKeys step: RSA-OAEP with SHA-384 and empty label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     47FAIL importVectorKeys step: RSA-OAEP with SHA-512 and empty label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     48FAIL importVectorKeys step: RSA-OAEP with SHA-1 and a label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     49FAIL importVectorKeys step: RSA-OAEP with SHA-256 and a label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     50FAIL importVectorKeys step: RSA-OAEP with SHA-384 and a label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     51FAIL importVectorKeys step: RSA-OAEP with SHA-512 and a label no decrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     52FAIL importVectorKeys step: RSA-OAEP with SHA-1 and no label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     53FAIL importVectorKeys step: RSA-OAEP with SHA-256 and no label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     54FAIL importVectorKeys step: RSA-OAEP with SHA-384 and no label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     55FAIL importVectorKeys step: RSA-OAEP with SHA-512 and no label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     56FAIL importVectorKeys step: RSA-OAEP with SHA-1 and empty label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     57FAIL importVectorKeys step: RSA-OAEP with SHA-256 and empty label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     58FAIL importVectorKeys step: RSA-OAEP with SHA-384 and empty label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     59FAIL importVectorKeys step: RSA-OAEP with SHA-512 and empty label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     60FAIL importVectorKeys step: RSA-OAEP with SHA-1 and a label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     61FAIL importVectorKeys step: RSA-OAEP with SHA-256 and a label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     62FAIL importVectorKeys step: RSA-OAEP with SHA-384 and a label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     63FAIL importVectorKeys step: RSA-OAEP with SHA-512 and a label with altered plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     64FAIL importVectorKeys step: RSA-OAEP with SHA-1 and no label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     65FAIL importVectorKeys step: RSA-OAEP with SHA-256 and no label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     66FAIL importVectorKeys step: RSA-OAEP with SHA-384 and no label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     67FAIL importVectorKeys step: RSA-OAEP with SHA-512 and no label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     68FAIL importVectorKeys step: RSA-OAEP with SHA-1 and empty label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     69FAIL importVectorKeys step: RSA-OAEP with SHA-256 and empty label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     70FAIL importVectorKeys step: RSA-OAEP with SHA-384 and empty label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     71FAIL importVectorKeys step: RSA-OAEP with SHA-512 and empty label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     72FAIL importVectorKeys step: RSA-OAEP with SHA-1 and a label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     73FAIL importVectorKeys step: RSA-OAEP with SHA-256 and a label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     74FAIL importVectorKeys step: RSA-OAEP with SHA-384 and a label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     75FAIL importVectorKeys step: RSA-OAEP with SHA-512 and a label assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     76FAIL importVectorKeys step: RSA-OAEP with SHA-1 and no label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     77FAIL importVectorKeys step: RSA-OAEP with SHA-256 and no label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     78FAIL importVectorKeys step: RSA-OAEP with SHA-384 and no label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     79FAIL importVectorKeys step: RSA-OAEP with SHA-512 and no label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     80FAIL importVectorKeys step: RSA-OAEP with SHA-1 and empty label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     81FAIL importVectorKeys step: RSA-OAEP with SHA-256 and empty label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     82FAIL importVectorKeys step: RSA-OAEP with SHA-384 and empty label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     83FAIL importVectorKeys step: RSA-OAEP with SHA-512 and empty label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     84FAIL importVectorKeys step: RSA-OAEP with SHA-1 and a label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     85FAIL importVectorKeys step: RSA-OAEP with SHA-256 and a label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     86FAIL importVectorKeys step: RSA-OAEP with SHA-384 and a label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     87FAIL importVectorKeys step: RSA-OAEP with SHA-512 and a label too long plaintext assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     88FAIL importVectorKeys step: RSA-OAEP with SHA-1 and no label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     89FAIL importVectorKeys step: RSA-OAEP with SHA-256 and no label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     90FAIL importVectorKeys step: RSA-OAEP with SHA-384 and no label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     91FAIL importVectorKeys step: RSA-OAEP with SHA-512 and no label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     92FAIL importVectorKeys step: RSA-OAEP with SHA-1 and empty label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     93FAIL importVectorKeys step: RSA-OAEP with SHA-256 and empty label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     94FAIL importVectorKeys step: RSA-OAEP with SHA-384 and empty label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     95FAIL importVectorKeys step: RSA-OAEP with SHA-512 and empty label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     96FAIL importVectorKeys step: RSA-OAEP with SHA-1 and a label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     97FAIL importVectorKeys step: RSA-OAEP with SHA-256 and a label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     98FAIL importVectorKeys step: RSA-OAEP with SHA-384 and a label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     99FAIL importVectorKeys step: RSA-OAEP with SHA-512 and a label using privateKey to encrypt assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     100FAIL importVectorKeys step: RSA-OAEP with SHA-1 and no label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     101FAIL importVectorKeys step: RSA-OAEP with SHA-256 and no label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     102FAIL importVectorKeys step: RSA-OAEP with SHA-384 and no label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     103FAIL importVectorKeys step: RSA-OAEP with SHA-512 and no label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and no label. Message: ''The operation is not supported.'' Reached unreachable code
     104FAIL importVectorKeys step: RSA-OAEP with SHA-1 and empty label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     105FAIL importVectorKeys step: RSA-OAEP with SHA-256 and empty label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     106FAIL importVectorKeys step: RSA-OAEP with SHA-384 and empty label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     107FAIL importVectorKeys step: RSA-OAEP with SHA-512 and empty label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and empty label. Message: ''The operation is not supported.'' Reached unreachable code
     108FAIL importVectorKeys step: RSA-OAEP with SHA-1 and a label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-1 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     109FAIL importVectorKeys step: RSA-OAEP with SHA-256 and a label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-256 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     110FAIL importVectorKeys step: RSA-OAEP with SHA-384 and a label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-384 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     111FAIL importVectorKeys step: RSA-OAEP with SHA-512 and a label no encrypt usage assert_unreached: importVectorKeys failed for RSA-OAEP with SHA-512 and a label. Message: ''The operation is not supported.'' Reached unreachable code
     112
  • trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt

    r208737 r208891  
    4444FAIL SubtleCrypto must be primary interface of crypto.subtle assert_own_property: self does not have own property "SubtleCrypto" expected property "SubtleCrypto" missing
    4545PASS Stringification of crypto.subtle
    46 FAIL SubtleCrypto interface: crypto.subtle must inherit property "encrypt" with the proper type (0) assert_inherits: property "encrypt" not found in prototype chain
    47 FAIL SubtleCrypto interface: calling encrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "encrypt" not found in prototype chain
     46PASS SubtleCrypto interface: crypto.subtle must inherit property "encrypt" with the proper type (0)
     47PASS SubtleCrypto interface: calling encrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError
    4848FAIL SubtleCrypto interface: crypto.subtle must inherit property "decrypt" with the proper type (1) assert_inherits: property "decrypt" not found in prototype chain
    4949FAIL SubtleCrypto interface: calling decrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "decrypt" not found in prototype chain
  • trunk/Source/WebCore/CMakeLists.txt

    r208872 r208891  
    334334    crypto/WebKitSubtleCrypto.idl
    335335
     336    crypto/parameters/AesCbcParams.idl
    336337    crypto/parameters/AesKeyGenParams.idl
    337338    crypto/parameters/HmacKeyParams.idl
     
    339340    crypto/parameters/RsaHashedKeyGenParams.idl
    340341    crypto/parameters/RsaKeyGenParams.idl
     342    crypto/parameters/RsaOaepParams.idl
    341343
    342344    css/CSSFontFaceLoadEvent.idl
  • trunk/Source/WebCore/ChangeLog

    r208890 r208891  
     12016-11-17  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        Update SubtleCrypto::encrypt to match the latest spec
     4        https://bugs.webkit.org/show_bug.cgi?id=164738
     5        <rdar://problem/29257812>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        This patch does following few things:
     10        1. It updates the SubtleCrypto::encrypt method to match the latest spec:
     11           https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt.
     12           It also refers to the latest Editor's Draft to a certain degree:
     13           https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-encrypt.
     14        2. It implements encrypt operations of the following algorithms: AES-CBC,
     15           RSAES-PKCS1-V1_5, and RSA-OAEP.
     16        3. It addes ASSERT(parameters) for every method that accepts a
     17           std::unique_ptr<CryptoAlgorithmParameters>&& type parameter.
     18        4. It changes RefPtr<CryptoKey>&& to Ref<CryptoKey>&& for every method that
     19           accepts a CryptoKey.
     20
     21        Tests: crypto/subtle/aes-cbc-encrypt-malformed-parameters.html
     22               crypto/subtle/aes-cbc-import-key-encrypt.html
     23               crypto/subtle/encrypt-malformed-parameters.html
     24               crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html
     25               crypto/subtle/rsa-oaep-import-key-encrypt-label.html
     26               crypto/subtle/rsa-oaep-import-key-encrypt.html
     27               crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html
     28               crypto/workers/subtle/aes-cbc-import-key-encrypt.html
     29               crypto/workers/subtle/rsa-oaep-import-key-encrypt.html
     30               crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html
     31
     32        * CMakeLists.txt:
     33        * DerivedSources.make:
     34        * WebCore.xcodeproj/project.pbxproj:
     35        * bindings/js/BufferSource.h:
     36        (WebCore::BufferSource::BufferSource):
     37        Add a default constructor for initializing an empty BufferSource object.
     38        * bindings/js/JSSubtleCryptoCustom.cpp:
     39        (WebCore::normalizeCryptoAlgorithmParameters):
     40        (WebCore::jsSubtleCryptoFunctionEncryptPromise):
     41        (WebCore::JSSubtleCrypto::encrypt):
     42        * crypto/CryptoAlgorithm.cpp:
     43        (WebCore::CryptoAlgorithm::encrypt):
     44        (WebCore::CryptoAlgorithm::exportKey):
     45        * crypto/CryptoAlgorithm.h:
     46        * crypto/CryptoAlgorithmParameters.h:
     47        * crypto/CryptoKey.h:
     48        * crypto/SubtleCrypto.cpp:
     49        (WebCore::SubtleCrypto::SubtleCrypto):
     50        * crypto/SubtleCrypto.h:
     51        (WebCore::SubtleCrypto::workQueue):
     52        * crypto/SubtleCrypto.idl:
     53        * crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
     54        (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
     55        * crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
     56        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
     57        * crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
     58        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
     59        * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
     60        (WebCore::CryptoKeyRSA::generatePair):
     61        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
     62        (WebCore::CryptoAlgorithmAES_CBC::encrypt):
     63        (WebCore::CryptoAlgorithmAES_CBC::generateKey):
     64        (WebCore::CryptoAlgorithmAES_CBC::importKey):
     65        (WebCore::CryptoAlgorithmAES_CBC::exportKey):
     66        * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
     67        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
     68        (WebCore::CryptoAlgorithmAES_KW::generateKey):
     69        (WebCore::CryptoAlgorithmAES_KW::importKey):
     70        (WebCore::CryptoAlgorithmAES_KW::exportKey):
     71        * crypto/algorithms/CryptoAlgorithmAES_KW.h:
     72        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
     73        (WebCore::CryptoAlgorithmHMAC::generateKey):
     74        (WebCore::CryptoAlgorithmHMAC::importKey):
     75        (WebCore::CryptoAlgorithmHMAC::exportKey):
     76        * crypto/algorithms/CryptoAlgorithmHMAC.h:
     77        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
     78        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
     79        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
     80        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
     81        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
     82        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
     83        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
     84        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
     85        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
     86        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
     87        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
     88        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
     89        (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
     90        (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
     91        (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
     92        (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
     93        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
     94        * crypto/keys/CryptoKeyRSA.h:
     95        * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
     96        (WebCore::transformAES_CBC):
     97        (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
     98        (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
     99        * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
     100        (WebCore::encryptRSAES_PKCS1_v1_5):
     101        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
     102        * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
     103        (WebCore::encryptRSA_OAEP):
     104        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
     105        * crypto/mac/CryptoKeyRSAMac.cpp:
     106        (WebCore::CryptoKeyRSA::generatePair):
     107        * crypto/parameters/AesCbcParams.idl: Added.
     108        * crypto/parameters/CryptoAlgorithmAesCbcParams.h: Added.
     109        * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
     110        * crypto/parameters/CryptoAlgorithmRsaOaepParams.h: Added.
     111        * crypto/parameters/RsaOaepParams.idl: Added.
     112
    11132016-11-18  Ryan Haddad  <ryanhaddad@apple.com>
    2114
  • trunk/Source/WebCore/DerivedSources.make

    r208872 r208891  
    255255    $(WebCore)/crypto/CryptoKeyUsage.idl \
    256256    $(WebCore)/crypto/JsonWebKey.idl \
     257    $(WebCore)/crypto/parameters/AesCbcParams.idl \
    257258    $(WebCore)/crypto/parameters/AesKeyGenParams.idl \
    258259    $(WebCore)/crypto/parameters/HmacKeyParams.idl \
     
    260261    $(WebCore)/crypto/parameters/RsaHashedKeyGenParams.idl \
    261262    $(WebCore)/crypto/parameters/RsaKeyGenParams.idl \
     263    $(WebCore)/crypto/parameters/RsaOaepParams.idl \
    262264    $(WebCore)/crypto/RsaOtherPrimesInfo.idl \
    263265    $(WebCore)/crypto/SubtleCrypto.idl \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r208872 r208891  
    23542354                55A336F71D8209F40022C4C7 /* NativeImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 55A336F61D8209F40022C4C7 /* NativeImage.h */; };
    23552355                55A336F91D821E3C0022C4C7 /* ImageBackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 55A336F81D821E3C0022C4C7 /* ImageBackingStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
     2356                5706A6961DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */; };
     2357                5706A6981DDE5E4600A03B14 /* JSRsaOaepParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5706A6971DDE5E4600A03B14 /* JSRsaOaepParams.h */; };
     2358                5706A69A1DDE5E8500A03B14 /* JSRsaOaepParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5706A6991DDE5E8500A03B14 /* JSRsaOaepParams.cpp */; };
    23562359                5709E8CD1D413D47003244AC /* WebKitSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */; };
    23572360                5709E8CE1D413D5B003244AC /* JSWebKitSubtleCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */; };
     
    23612364                571F21891DA57C54005C9EFD /* JSSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */; };
    23622365                571F218B1DA57C7B005C9EFD /* JSSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */; };
     2366                572093D31DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 572093D21DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcParams.h */; };
     2367                572093D51DDCED8E00310AB0 /* JSAesCbcParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 572093D41DDCED8E00310AB0 /* JSAesCbcParams.h */; };
     2368                572093D71DDCEDA700310AB0 /* JSAesCbcParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572093D61DDCEDA700310AB0 /* JSAesCbcParams.cpp */; };
    23632369                572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A7F201C6E5719009C6149 /* SimulatedClick.h */; };
    23642370                572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */; };
     
    95859591                55A336F81D821E3C0022C4C7 /* ImageBackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageBackingStore.h; sourceTree = "<group>"; };
    95869592                55D408F71A7C631800C78450 /* SVGImageClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageClients.h; sourceTree = "<group>"; };
     9593                5706A6941DDE5BF800A03B14 /* RsaOaepParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RsaOaepParams.idl; sourceTree = "<group>"; };
     9594                5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaOaepParams.h; sourceTree = "<group>"; };
     9595                5706A6971DDE5E4600A03B14 /* JSRsaOaepParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaOaepParams.h; sourceTree = "<group>"; };
     9596                5706A6991DDE5E8500A03B14 /* JSRsaOaepParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRsaOaepParams.cpp; sourceTree = "<group>"; };
    95879597                5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitSubtleCrypto.cpp; sourceTree = "<group>"; };
    95889598                5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitSubtleCrypto.h; sourceTree = "<group>"; };
     
    95909600                571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSubtleCrypto.h; sourceTree = "<group>"; };
    95919601                571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCrypto.cpp; sourceTree = "<group>"; };
     9602                572093D11DDCEA4B00310AB0 /* AesCbcParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AesCbcParams.idl; sourceTree = "<group>"; };
     9603                572093D21DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAesCbcParams.h; sourceTree = "<group>"; };
     9604                572093D41DDCED8E00310AB0 /* JSAesCbcParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAesCbcParams.h; sourceTree = "<group>"; };
     9605                572093D61DDCEDA700310AB0 /* JSAesCbcParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAesCbcParams.cpp; sourceTree = "<group>"; };
    95929606                572A7F201C6E5719009C6149 /* SimulatedClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatedClick.h; sourceTree = "<group>"; };
    95939607                572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulatedClick.cpp; sourceTree = "<group>"; };
     
    2295822972                        isa = PBXGroup;
    2295922973                        children = (
     22974                                572093D11DDCEA4B00310AB0 /* AesCbcParams.idl */,
    2296022975                                577483101DADC49900716EF9 /* AesKeyGenParams.idl */,
     22976                                572093D21DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcParams.h */,
    2296122977                                E125F8391824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h */,
    2296222978                                577483111DADC55D00716EF9 /* CryptoAlgorithmAesKeyGenParams.h */,
     
    2297022986                                E1BD331D182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h */,
    2297122987                                E1C266DA18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h */,
     22988                                5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */,
    2297222989                                E1FE1376184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h */,
    2297322990                                E1BD331B182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h */,
     
    2297622993                                57F827391DB72C22009D2BF4 /* RsaHashedKeyGenParams.idl */,
    2297722994                                57FEDD3D1DB6D47F00EB96F5 /* RsaKeyGenParams.idl */,
     22995                                5706A6941DDE5BF800A03B14 /* RsaOaepParams.idl */,
    2297822996                        );
    2297922997                        path = parameters;
     
    2313023148                        isa = PBXGroup;
    2313123149                        children = (
     23150                                572093D61DDCEDA700310AB0 /* JSAesCbcParams.cpp */,
     23151                                572093D41DDCED8E00310AB0 /* JSAesCbcParams.h */,
    2313223152                                577483151DAEC32200716EF9 /* JSAesKeyGenParams.cpp */,
    2313323153                                577483131DAEC2EA00716EF9 /* JSAesKeyGenParams.h */,
     
    2315023170                                57FEDD421DB6D76000EB96F5 /* JSRsaKeyGenParams.cpp */,
    2315123171                                57FEDD401DB6D73A00EB96F5 /* JSRsaKeyGenParams.h */,
     23172                                5706A6991DDE5E8500A03B14 /* JSRsaOaepParams.cpp */,
     23173                                5706A6971DDE5E4600A03B14 /* JSRsaOaepParams.h */,
    2315223174                                57E233601DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp */,
    2315323175                                57E2335C1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h */,
     
    2501925041                                7C93F34E1AA6BF0700A98BAB /* ContentExtensionCompiler.h in Headers */,
    2502025042                                7CFDC57D1AC1D80500E24A57 /* ContentExtensionError.h in Headers */,
     25043                                572093D31DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcParams.h in Headers */,
    2502125044                                26F0C8981A2E724B002794F8 /* ContentExtensionParser.h in Headers */,
    2502225045                                26F0C89C1A2EC110002794F8 /* ContentExtensionRule.h in Headers */,
     
    2534425367                                A9C6E4E40D745E05006442E9 /* DOMMimeType.h in Headers */,
    2534525368                                A9C6E4E80D745E18006442E9 /* DOMMimeTypeArray.h in Headers */,
     25369                                5706A6961DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h in Headers */,
    2534625370                                52B6C9C315E3F4DF00690B05 /* DOMNamedFlowCollection.h in Headers */,
    2534725371                                1ACE53E80A8D18E70022947D /* DOMParser.h in Headers */,
     
    2613926163                                BC305C7A0C076BB300CD20F0 /* JSHTMLObjectElement.h in Headers */,
    2614026164                                1A85B1EB0A1B240500D8C87C /* JSHTMLOListElement.h in Headers */,
     26165                                5706A6981DDE5E4600A03B14 /* JSRsaOaepParams.h in Headers */,
    2614126166                                A80E7E9B0A1A83E3007FB8C5 /* JSHTMLOptGroupElement.h in Headers */,
     26167                                572093D51DDCED8E00310AB0 /* JSAesCbcParams.h in Headers */,
    2614226168                                A80E7E990A1A83E3007FB8C5 /* JSHTMLOptionElement.h in Headers */,
    2614326169                                448A29BF0A46D9CB0030759F /* JSHTMLOptionsCollection.h in Headers */,
     
    2859128617                        buildActionMask = 2147483647;
    2859228618                        files = (
     28619                                5706A69A1DDE5E8500A03B14 /* JSRsaOaepParams.cpp in Sources */,
     28620                                572093D71DDCEDA700310AB0 /* JSAesCbcParams.cpp in Sources */,
    2859328621                                57D0018F1DD5415300ED19D9 /* JSCryptoKeyUsage.cpp in Sources */,
    2859428622                                41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/BufferSource.h

    r208539 r208891  
    3737    using VariantType = WTF::Variant<RefPtr<JSC::ArrayBufferView>, RefPtr<JSC::ArrayBuffer>>;
    3838
     39    BufferSource() { }
    3940    BufferSource(VariantType&& variant)
    4041        : m_variant(WTFMove(variant))
  • trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp

    r208757 r208891  
    3131#include "CryptoAlgorithm.h"
    3232#include "CryptoAlgorithmRegistry.h"
     33#include "JSAesCbcParams.h"
    3334#include "JSAesKeyGenParams.h"
    3435#include "JSCryptoAlgorithmParameters.h"
     
    4142#include "JSRsaHashedKeyGenParams.h"
    4243#include "JSRsaKeyGenParams.h"
     44#include "JSRsaOaepParams.h"
    4345#include "ScriptState.h"
    4446#include <runtime/Error.h>
     
    5153
    5254enum class Operations {
     55    Encrypt,
    5356    Digest,
    5457    GenerateKey,
     
    9194        std::unique_ptr<CryptoAlgorithmParameters> result;
    9295        switch (operation) {
     96        case Operations::Encrypt:
     97            switch (*identifier) {
     98            case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
     99                result = std::make_unique<CryptoAlgorithmParameters>(params);
     100                break;
     101            case CryptoAlgorithmIdentifier::RSA_OAEP: {
     102                auto params = convertDictionary<CryptoAlgorithmRsaOaepParams>(state, value);
     103                RETURN_IF_EXCEPTION(scope, nullptr);
     104                result = std::make_unique<CryptoAlgorithmRsaOaepParams>(params);
     105                break;
     106            }
     107            case CryptoAlgorithmIdentifier::AES_CBC: {
     108                auto params = convertDictionary<CryptoAlgorithmAesCbcParams>(state, value);
     109                RETURN_IF_EXCEPTION(scope, nullptr);
     110                result = std::make_unique<CryptoAlgorithmAesCbcParams>(params);
     111                break;
     112            }
     113            default:
     114                setDOMException(&state, NOT_SUPPORTED_ERR);
     115                return nullptr;
     116            }
     117            break;
    93118        case Operations::Digest:
    94119            switch (*identifier) {
     
    364389}
    365390
     391static void jsSubtleCryptoFunctionEncryptPromise(ExecState& state, Ref<DeferredPromise>&& promise)
     392{
     393    VM& vm = state.vm();
     394    auto scope = DECLARE_THROW_SCOPE(vm);
     395
     396    if (UNLIKELY(state.argumentCount() < 3)) {
     397        promise->reject<JSValue>(createNotEnoughArgumentsError(&state));
     398        return;
     399    }
     400
     401    auto params = normalizeCryptoAlgorithmParameters(state, state.uncheckedArgument(0), Operations::Encrypt);
     402    RETURN_IF_EXCEPTION(scope, void());
     403
     404    RefPtr<CryptoKey> key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
     405    if (!key) {
     406        promise->reject(TypeError, ASCIILiteral("Invalid CryptoKey"));
     407        return;
     408    }
     409
     410    BufferSource data = convert<IDLBufferSource>(state, state.uncheckedArgument(2));
     411    RETURN_IF_EXCEPTION(scope, void());
     412    Vector<uint8_t> dataVector;
     413    dataVector.append(data.data(), data.length());
     414
     415    if (params->identifier != key->algorithmIdentifier()) {
     416        promise->reject(INVALID_ACCESS_ERR, ASCIILiteral("CryptoKey doesn't match AlgorithmIdentifier"));
     417        return;
     418    }
     419
     420    if (!key->allows(CryptoKeyUsageEncrypt)) {
     421        promise->reject(INVALID_ACCESS_ERR, ASCIILiteral("CryptoKey doesn't support encryption"));
     422        return;
     423    }
     424
     425    auto algorithm = createAlgorithm(state, key->algorithmIdentifier());
     426    RETURN_IF_EXCEPTION(scope, void());
     427
     428    auto callback = [capturedPromise = promise.copyRef()](const Vector<uint8_t>& cipherText) mutable {
     429        fulfillPromiseWithArrayBuffer(WTFMove(capturedPromise), cipherText.data(), cipherText.size());
     430        return;
     431    };
     432    auto exceptionCallback = [capturedPromise = promise.copyRef()](ExceptionCode ec) mutable {
     433        rejectWithException(WTFMove(capturedPromise), ec);
     434    };
     435
     436    JSSubtleCrypto* subtle = jsDynamicDowncast<JSSubtleCrypto*>(state.thisValue());
     437    ASSERT(subtle);
     438    algorithm->encrypt(WTFMove(params), key.releaseNonNull(), WTFMove(dataVector), WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContextFromExecState(&state), subtle->wrapped().workQueue());
     439}
     440
    366441static void jsSubtleCryptoFunctionGenerateKeyPromise(ExecState& state, Ref<DeferredPromise>&& promise)
    367442{
     
    525600    // https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-exportKey
    526601    // It is not beneficial for less time consuming operations. Therefore, we perform it synchronously.
    527     algorithm->exportKey(format, WTFMove(key), WTFMove(callback), WTFMove(exceptionCallback));
     602    algorithm->exportKey(format, key.releaseNonNull(), WTFMove(callback), WTFMove(exceptionCallback));
     603}
     604
     605JSValue JSSubtleCrypto::encrypt(ExecState& state)
     606{
     607    return callPromiseFunction<jsSubtleCryptoFunctionEncryptPromise, PromiseExecutionScope::WindowOrWorker>(state);
    528608}
    529609
  • trunk/Source/WebCore/crypto/CryptoAlgorithm.cpp

    r208737 r208891  
    3333namespace WebCore {
    3434
     35void CryptoAlgorithm::encrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&& exceptionCallback, ScriptExecutionContext&, WorkQueue&)
     36{
     37    exceptionCallback(NOT_SUPPORTED_ERR);
     38}
     39
    3540void CryptoAlgorithm::generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&& exceptionCallback, ScriptExecutionContext&)
    3641{
     
    4348}
    4449
    45 void CryptoAlgorithm::exportKey(SubtleCrypto::KeyFormat, RefPtr<WebCore::CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&& exceptionCallback)
     50void CryptoAlgorithm::exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&& exceptionCallback)
    4651{
    4752    exceptionCallback(NOT_SUPPORTED_ERR);
  • trunk/Source/WebCore/crypto/CryptoAlgorithm.h

    r208737 r208891  
    3333#include <wtf/Function.h>
    3434#include <wtf/Vector.h>
     35#include <wtf/WorkQueue.h>
    3536
    3637#if ENABLE(SUBTLE_CRYPTO)
     
    6465    using KeyDataCallback = WTF::Function<void(SubtleCrypto::KeyFormat, KeyData&&)>;
    6566
     67    virtual void encrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&);
    6668    virtual void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&);
    6769    virtual void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&);
    68     virtual void exportKey(SubtleCrypto::KeyFormat, RefPtr<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&);
     70    virtual void exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&);
    6971
    7072    // The following will be deprecated.
  • trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h

    r208548 r208891  
    3838    enum class Class {
    3939        None,
     40        AesCbcParams,
    4041        AesKeyGenParams,
    4142        HmacKeyParams,
     
    4344        RsaHashedImportParams,
    4445        RsaKeyGenParams,
     46        RsaOaepParams,
    4547    };
    4648
  • trunk/Source/WebCore/crypto/CryptoKey.h

    r208646 r208891  
    3232#include "CryptoKeyUsage.h"
    3333#include <wtf/Forward.h>
    34 #include <wtf/RefCounted.h>
     34#include <wtf/ThreadSafeRefCounted.h>
    3535#include <wtf/TypeCasts.h>
    3636#include <wtf/Vector.h>
     
    7575};
    7676
    77 class CryptoKey : public RefCounted<CryptoKey> {
     77class CryptoKey : public ThreadSafeRefCounted<CryptoKey> {
    7878public:
    7979    using Type = CryptoKeyType;
  • trunk/Source/WebCore/crypto/SubtleCrypto.cpp

    r206883 r208891  
    3333SubtleCrypto::SubtleCrypto(ScriptExecutionContext& context)
    3434    : ContextDestructionObserver(&context)
     35    , m_workQueue(WorkQueue::create("com.apple.WebKit.CryptoQueue"))
    3536{
    3637}
  • trunk/Source/WebCore/crypto/SubtleCrypto.h

    r208548 r208891  
    2929#include <wtf/Ref.h>
    3030#include <wtf/RefCounted.h>
     31#include <wtf/WorkQueue.h>
    3132
    3233#if ENABLE(SUBTLE_CRYPTO)
     
    4041    static Ref<SubtleCrypto> create(ScriptExecutionContext& context) { return adoptRef(*new SubtleCrypto(context)); }
    4142
     43    WorkQueue& workQueue() { return m_workQueue.get(); };
     44
    4245private:
    4346    SubtleCrypto(ScriptExecutionContext&);
     47
     48    Ref<WorkQueue> m_workQueue;
    4449};
    4550
  • trunk/Source/WebCore/crypto/SubtleCrypto.idl

    r208737 r208891  
    3232    NoInterfaceObject,
    3333] interface SubtleCrypto {
     34    [Custom] Promise<any> encrypt(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource data);
    3435    // FIXME: Should this return a Promise<(CryptoKey or CryptoKeyPair)>?
    3536    [Custom] Promise<any> generateKey(AlgorithmIdentifier algorithm, boolean extractable, sequence<CryptoKeyUsage> keyUsages);
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp

    r208737 r208891  
    2929#if ENABLE(SUBTLE_CRYPTO)
    3030
     31#include "CryptoAlgorithmAesCbcParams.h"
    3132#include "CryptoAlgorithmAesCbcParamsDeprecated.h"
    3233#include "CryptoAlgorithmAesKeyGenParams.h"
     
    4142static const char* const ALG192 = "A192CBC";
    4243static const char* const ALG256 = "A256CBC";
     44static const size_t IVSIZE = 16;
    4345
    4446static inline bool usagesAreInvalidForCryptoAlgorithmAES_CBC(CryptoKeyUsageBitmap usages)
     
    6567}
    6668
     69void CryptoAlgorithmAES_CBC::encrypt(std::unique_ptr<CryptoAlgorithmParameters>&& parameters, Ref<CryptoKey>&& key, Vector<uint8_t>&& plainText, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
     70{
     71    ASSERT(parameters);
     72    auto& aesParameters = downcast<CryptoAlgorithmAesCbcParams>(*parameters);
     73    if (aesParameters.ivVector().size() != IVSIZE) {
     74        exceptionCallback(OperationError);
     75        return;
     76    }
     77    platformEncrypt(WTFMove(parameters), WTFMove(key), WTFMove(plainText), WTFMove(callback), WTFMove(exceptionCallback), context, workQueue);
     78}
     79
    6780void CryptoAlgorithmAES_CBC::generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyOrKeyPairCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext&)
    6881{
     82    ASSERT(parameters);
    6983    auto& aesParameters = downcast<CryptoAlgorithmAesKeyGenParams>(*parameters);
    7084
     
    8599void CryptoAlgorithmAES_CBC::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback)
    86100{
     101    ASSERT(parameters);
    87102    if (usagesAreInvalidForCryptoAlgorithmAES_CBC(usages)) {
    88103        exceptionCallback(SYNTAX_ERR);
     
    122137}
    123138
    124 void CryptoAlgorithmAES_CBC::exportKey(SubtleCrypto::KeyFormat format, RefPtr<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
    125 {
    126     const auto& aesKey = downcast<CryptoKeyAES>(*key);
     139void CryptoAlgorithmAES_CBC::exportKey(SubtleCrypto::KeyFormat format, Ref<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
     140{
     141    const auto& aesKey = downcast<CryptoKeyAES>(key.get());
    127142
    128143    if (aesKey.key().isEmpty()) {
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.h

    r208737 r208891  
    4545    CryptoAlgorithmIdentifier identifier() const final;
    4646
     47    void encrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&) final;
    4748    void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
    4849    void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final;
    49     void exportKey(SubtleCrypto::KeyFormat, RefPtr<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
     50    void exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
    5051
    5152    ExceptionOr<void> encrypt(const CryptoAlgorithmParametersDeprecated&, const CryptoKey&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback) final;
     
    5556
    5657    bool keyAlgorithmMatches(const CryptoAlgorithmAesCbcParamsDeprecated& algorithmParameters, const CryptoKey&) const;
     58    void platformEncrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&);
    5759    ExceptionOr<void> platformEncrypt(const CryptoAlgorithmAesCbcParamsDeprecated&, const CryptoKeyAES&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback);
    5860    ExceptionOr<void> platformDecrypt(const CryptoAlgorithmAesCbcParamsDeprecated&, const CryptoKeyAES&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback);
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp

    r208737 r208891  
    6666void CryptoAlgorithmAES_KW::generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyOrKeyPairCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext&)
    6767{
     68    ASSERT(parameters);
    6869    if (usagesAreInvalidForCryptoAlgorithmAES_KW(usages)) {
    6970        exceptionCallback(SYNTAX_ERR);
     
    8283void CryptoAlgorithmAES_KW::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback)
    8384{
     85    ASSERT(parameters);
    8486    if (usagesAreInvalidForCryptoAlgorithmAES_KW(usages)) {
    8587        exceptionCallback(SYNTAX_ERR);
     
    118120}
    119121
    120 void CryptoAlgorithmAES_KW::exportKey(SubtleCrypto::KeyFormat format, RefPtr<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
     122void CryptoAlgorithmAES_KW::exportKey(SubtleCrypto::KeyFormat format, Ref<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
    121123{
    122     const auto& aesKey = downcast<CryptoKeyAES>(*key);
     124    const auto& aesKey = downcast<CryptoKeyAES>(key.get());
    123125
    124126    if (aesKey.key().isEmpty()) {
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h

    r208737 r208891  
    4646    void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
    4747    void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final;
    48     void exportKey(SubtleCrypto::KeyFormat, RefPtr<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
     48    void exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
    4949
    5050    ExceptionOr<void> encryptForWrapKey(const CryptoAlgorithmParametersDeprecated&, const CryptoKey&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback) final;
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp

    r208737 r208891  
    7272void CryptoAlgorithmHMAC::generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyOrKeyPairCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext&)
    7373{
     74    ASSERT(parameters);
    7475    const auto& hmacParameters = downcast<CryptoAlgorithmHmacKeyParams>(*parameters);
    7576
     
    9596void CryptoAlgorithmHMAC::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback)
    9697{
     98    ASSERT(parameters);
    9799    const auto& hmacParameters = downcast<CryptoAlgorithmHmacKeyParams>(*parameters);
    98100
     
    140142}
    141143
    142 void CryptoAlgorithmHMAC::exportKey(SubtleCrypto::KeyFormat format, RefPtr<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
    143 {
    144     const auto& hmacKey = downcast<CryptoKeyHMAC>(*key);
     144void CryptoAlgorithmHMAC::exportKey(SubtleCrypto::KeyFormat format, Ref<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
     145{
     146    const auto& hmacKey = downcast<CryptoKeyHMAC>(key.get());
    145147
    146148    if (hmacKey.key().isEmpty()) {
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h

    r208737 r208891  
    4747    void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
    4848    void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final;
    49     void exportKey(SubtleCrypto::KeyFormat, RefPtr<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
     49    void exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
    5050
    5151    // The following will be deprecated.
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp

    r208737 r208891  
    6060}
    6161
     62void CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&& key, Vector<uint8_t>&& plainText, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
     63{
     64    if (key->type() != CryptoKeyType::Public) {
     65        exceptionCallback(INVALID_ACCESS_ERR);
     66        return;
     67    }
     68    platformEncrypt(WTFMove(key), WTFMove(plainText), WTFMove(callback), WTFMove(exceptionCallback), context, workQueue);
     69}
     70
    6271void CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyOrKeyPairCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context)
    6372{
     73    ASSERT(parameters);
    6474    const auto& rsaParameters = downcast<CryptoAlgorithmRsaKeyGenParams>(*parameters);
    6575
     
    8393void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback)
    8494{
     95    ASSERT(parameters);
    8596    RefPtr<CryptoKeyRSA> result;
    8697    switch (format) {
     
    114125}
    115126
    116 void CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey(SubtleCrypto::KeyFormat format, RefPtr<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
     127void CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey(SubtleCrypto::KeyFormat format, Ref<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
    117128{
    118     const auto& rsaKey = downcast<CryptoKeyRSA>(*key);
     129    const auto& rsaKey = downcast<CryptoKeyRSA>(key.get());
    119130
    120131    if (!rsaKey.keySizeInBits()) {
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h

    r208737 r208891  
    4545    CryptoAlgorithmIdentifier identifier() const final;
    4646
     47    void encrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&) final;
    4748    void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
    4849    void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final;
    49     void exportKey(SubtleCrypto::KeyFormat, RefPtr<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
     50    void exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
    5051
    51     // The following will be deprecated.
    5252    ExceptionOr<void> encrypt(const CryptoAlgorithmParametersDeprecated&, const CryptoKey&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback) final;
    5353    ExceptionOr<void> decrypt(const CryptoAlgorithmParametersDeprecated&, const CryptoKey&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback) final;
     
    5656
    5757    bool keyAlgorithmMatches(const CryptoKey&) const;
     58    void platformEncrypt(Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&);
    5859    ExceptionOr<void> platformEncrypt(const CryptoKeyRSA&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback);
    5960    ExceptionOr<void> platformDecrypt(const CryptoKeyRSA&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback);
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp

    r208737 r208891  
    7171void CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyOrKeyPairCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context)
    7272{
     73    ASSERT(parameters);
    7374    const auto& rsaParameters = downcast<CryptoAlgorithmRsaHashedKeyGenParams>(*parameters);
    7475
     
    9192void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback)
    9293{
     94    ASSERT(parameters);
    9395    const auto& rsaParameters = downcast<CryptoAlgorithmRsaHashedImportParams>(*parameters);
    9496
     
    147149}
    148150
    149 void CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey(SubtleCrypto::KeyFormat format, RefPtr<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
    150 {
    151     const auto& rsaKey = downcast<CryptoKeyRSA>(*key);
     151void CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey(SubtleCrypto::KeyFormat format, Ref<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
     152{
     153    const auto& rsaKey = downcast<CryptoKeyRSA>(key.get());
    152154
    153155    if (!rsaKey.keySizeInBits()) {
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h

    r208737 r208891  
    4747    void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
    4848    void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final;
    49     void exportKey(SubtleCrypto::KeyFormat, RefPtr<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
     49    void exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
    5050
    5151    ExceptionOr<void> sign(const CryptoAlgorithmParametersDeprecated&, const CryptoKey&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback) final;
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp

    r208737 r208891  
    6969}
    7070
     71void CryptoAlgorithmRSA_OAEP::encrypt(std::unique_ptr<CryptoAlgorithmParameters>&& parameters, Ref<CryptoKey>&& key, Vector<uint8_t>&& plainText, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
     72{
     73    ASSERT(parameters);
     74    if (key->type() != CryptoKeyType::Public) {
     75        exceptionCallback(INVALID_ACCESS_ERR);
     76        return;
     77    }
     78    platformEncrypt(WTFMove(parameters), WTFMove(key), WTFMove(plainText), WTFMove(callback), WTFMove(exceptionCallback), context, workQueue);
     79}
     80
     81
    7182void CryptoAlgorithmRSA_OAEP::generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyOrKeyPairCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context)
    7283{
     84    ASSERT(parameters);
    7385    const auto& rsaParameters = downcast<CryptoAlgorithmRsaHashedKeyGenParams>(*parameters);
    7486
     
    91103void CryptoAlgorithmRSA_OAEP::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback)
    92104{
     105    ASSERT(parameters);
    93106    const auto& rsaParameters = downcast<CryptoAlgorithmRsaHashedImportParams>(*parameters);
    94107
     
    158171}
    159172
    160 void CryptoAlgorithmRSA_OAEP::exportKey(SubtleCrypto::KeyFormat format, RefPtr<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
    161 {
    162     const auto& rsaKey = downcast<CryptoKeyRSA>(*key);
     173void CryptoAlgorithmRSA_OAEP::exportKey(SubtleCrypto::KeyFormat format, Ref<CryptoKey>&& key, KeyDataCallback&& callback, ExceptionCallback&& exceptionCallback)
     174{
     175    const auto& rsaKey = downcast<CryptoKeyRSA>(key.get());
    163176
    164177    if (!rsaKey.keySizeInBits()) {
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h

    r208737 r208891  
    4545    CryptoAlgorithmIdentifier identifier() const final;
    4646
     47    void encrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&) final;
    4748    void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext&) final;
    4849    void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final;
    49     void exportKey(SubtleCrypto::KeyFormat, RefPtr<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
     50    void exportKey(SubtleCrypto::KeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final;
    5051
    5152    ExceptionOr<void> encrypt(const CryptoAlgorithmParametersDeprecated&, const CryptoKey&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback) final;
     
    5556
    5657    bool keyAlgorithmMatches(const CryptoAlgorithmRsaOaepParamsDeprecated& algorithmParameters, const CryptoKey&) const;
     58    void platformEncrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&);
    5759    ExceptionOr<void> platformEncrypt(const CryptoAlgorithmRsaOaepParamsDeprecated&, const CryptoKeyRSA&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback);
    5860    ExceptionOr<void> platformDecrypt(const CryptoAlgorithmRsaOaepParamsDeprecated&, const CryptoKeyRSA&, const CryptoOperationData&, VectorCallback&&, VoidCallback&& failureCallback);
  • trunk/Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp

    r208669 r208891  
    3434namespace WebCore {
    3535
     36void CryptoAlgorithmAES_CBC::platformEncrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&)
     37{
     38    notImplemented();
     39}
     40
    3641ExceptionOr<void> CryptoAlgorithmAES_CBC::platformEncrypt(const CryptoAlgorithmAesCbcParamsDeprecated&, const CryptoKeyAES&, const CryptoOperationData&, VectorCallback&&, VoidCallback&&)
    3742{
  • trunk/Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp

    r208669 r208891  
    3535namespace WebCore {
    3636
     37void CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt(Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&)
     38{
     39    notImplemented();
     40}
     41
    3742ExceptionOr<void> CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt(const CryptoKeyRSA&, const CryptoOperationData&, VectorCallback&&, VoidCallback&&)
    3843{
  • trunk/Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp

    r208669 r208891  
    3434namespace WebCore {
    3535
     36void CryptoAlgorithmRSA_OAEP::platformEncrypt(std::unique_ptr<CryptoAlgorithmParameters>&&, Ref<CryptoKey>&&, Vector<uint8_t>&&, VectorCallback&&, ExceptionCallback&&, ScriptExecutionContext&, WorkQueue&)
     37{
     38    notImplemented();
     39}
     40
    3641ExceptionOr<void> CryptoAlgorithmRSA_OAEP::platformEncrypt(const CryptoAlgorithmRsaOaepParamsDeprecated&, const CryptoKeyRSA&, const CryptoOperationData&, VectorCallback&&, VoidCallback&&)
    3742{
  • trunk/Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp

    r208602 r208891  
    9696}
    9797
    98 void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsageBitmap usage, KeyPairCallback callback, VoidCallback failureCallback, ScriptExecutionContext* context)
     98void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsageBitmap usage, KeyPairCallback&& callback, VoidCallback&& failureCallback, ScriptExecutionContext* context)
    9999{
    100100    notImplemented();
  • trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.h

    r208737 r208891  
    100100    using KeyPairCallback = WTF::Function<void(CryptoKeyPair&)>;
    101101    using VoidCallback = WTF::Function<void()>;
    102     static void generatePair(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsageBitmap, KeyPairCallback, VoidCallback failureCallback, ScriptExecutionContext*);
     102    static void generatePair(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsageBitmap, KeyPairCallback&&, VoidCallback&& failureCallback, ScriptExecutionContext*);
    103103    static RefPtr<CryptoKeyRSA> importJwk(CryptoAlgorithmIdentifier, Optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap);
    104104
  • trunk/Source/WebCore/crypto/mac/CryptoAlgorithmAES_CBCMac.cpp

    r208669 r208891  
    2929#if ENABLE(SUBTLE_CRYPTO)
    3030
     31#include "CryptoAlgorithmAesCbcParams.h"
    3132#include "CryptoAlgorithmAesCbcParamsDeprecated.h"
    3233#include "CryptoKeyAES.h"
     34#include "ExceptionCode.h"
     35#include "ScriptExecutionContext.h"
    3336#include <CommonCrypto/CommonCrypto.h>
    3437
    3538namespace WebCore {
    3639
    37 static void transformAES_CBC(CCOperation operation, const CryptoAlgorithmAesCbcParamsDeprecated& parameters, const CryptoKeyAES& key, const CryptoOperationData& data, CryptoAlgorithm::VectorCallback&& callback, CryptoAlgorithm::VoidCallback&& failureCallback)
     40// FIXME: We should change iv and data to Vector<uint8_t> type once WebKitSubtleCrypto is deprecated.
     41// https://bugs.webkit.org/show_bug.cgi?id=164939
     42static ExceptionOr<Vector<uint8_t>> transformAES_CBC(CCOperation operation, const uint8_t* iv, const Vector<uint8_t>& key, const uint8_t* data, size_t dataLength)
    3843{
    39     static_assert(sizeof(parameters.iv) == kCCBlockSizeAES128, "Initialization vector size must be the same as algorithm block size");
    40 
    41     size_t keyLengthInBytes = key.key().size();
    42     if (keyLengthInBytes != 16 && keyLengthInBytes != 24 && keyLengthInBytes != 32) {
    43         failureCallback();
    44         return;
    45     }
    46 
     44    size_t keyLengthInBytes = key.size();
    4745    CCCryptorRef cryptor;
    4846#if PLATFORM(COCOA)
     
    5149    CCAlgorithm aesAlgorithm = kCCAlgorithmAES128;
    5250#endif
    53     CCCryptorStatus status = CCCryptorCreate(operation, aesAlgorithm, kCCOptionPKCS7Padding, key.key().data(), keyLengthInBytes, parameters.iv.data(), &cryptor);
    54     if (status) {
    55         failureCallback();
    56         return;
    57     }
     51    CCCryptorStatus status = CCCryptorCreate(operation, aesAlgorithm, kCCOptionPKCS7Padding, key.data(), keyLengthInBytes, iv, &cryptor);
     52    if (status)
     53        return Exception { OperationError };
    5854
    59     Vector<uint8_t> result(CCCryptorGetOutputLength(cryptor, data.second, true));
     55    Vector<uint8_t> result(CCCryptorGetOutputLength(cryptor, dataLength, true));
    6056
    6157    size_t bytesWritten;
    62     status = CCCryptorUpdate(cryptor, data.first, data.second, result.data(), result.size(), &bytesWritten);
    63     if (status) {
    64         failureCallback();
    65         return;
    66     }
     58    status = CCCryptorUpdate(cryptor, data, dataLength, result.data(), result.size(), &bytesWritten);
     59    if (status)
     60        return Exception { OperationError };
    6761
    6862    uint8_t* p = result.data() + bytesWritten;
    6963    status = CCCryptorFinal(cryptor, p, result.end() - p, &bytesWritten);
    7064    p += bytesWritten;
    71     if (status) {
    72         failureCallback();
    73         return;
    74     }
     65    if (status)
     66        return Exception { OperationError };
    7567
    7668    ASSERT(p <= result.end());
     
    7971    CCCryptorRelease(cryptor);
    8072
    81     callback(result);
     73    return WTFMove(result);
     74}
     75
     76void CryptoAlgorithmAES_CBC::platformEncrypt(std::unique_ptr<CryptoAlgorithmParameters>&& parameters, Ref<CryptoKey>&& key, Vector<uint8_t>&& plainText, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
     77{
     78    context.ref();
     79    workQueue.dispatch([parameters = WTFMove(parameters), key = WTFMove(key), plainText = WTFMove(plainText), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback), &context]() mutable {
     80        auto& aesParameters = downcast<CryptoAlgorithmAesCbcParams>(*parameters);
     81        auto& aesKey = downcast<CryptoKeyAES>(key.get());
     82        ASSERT(aesParameters.ivVector().size() == kCCBlockSizeAES128);
     83        auto result = transformAES_CBC(kCCEncrypt, aesParameters.ivVector().data(), aesKey.key(), plainText.data(), plainText.size());
     84        if (result.hasException()) {
     85            context.postTask([exceptionCallback = WTFMove(exceptionCallback), ec = result.releaseException().code()](ScriptExecutionContext& context) {
     86                exceptionCallback(ec);
     87                context.deref();
     88            });
     89            return;
     90        }
     91        context.postTask([callback = WTFMove(callback), result = result.releaseReturnValue()](ScriptExecutionContext& context) {
     92            callback(result);
     93            context.deref();
     94        });
     95    });
    8296}
    8397
    8498ExceptionOr<void> CryptoAlgorithmAES_CBC::platformEncrypt(const CryptoAlgorithmAesCbcParamsDeprecated& parameters, const CryptoKeyAES& key, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    8599{
    86     transformAES_CBC(kCCEncrypt, parameters, key, data, WTFMove(callback), WTFMove(failureCallback));
     100    ASSERT(sizeof(parameters.iv) == kCCBlockSizeAES128);
     101    auto result = transformAES_CBC(kCCEncrypt, parameters.iv.data(), key.key(), data.first, data.second);
     102    if (result.hasException()) {
     103        failureCallback();
     104        return { };
     105    }
     106    callback(result.releaseReturnValue());
    87107    return { };
    88108}
     
    90110ExceptionOr<void> CryptoAlgorithmAES_CBC::platformDecrypt(const CryptoAlgorithmAesCbcParamsDeprecated& parameters, const CryptoKeyAES& key, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    91111{
    92     transformAES_CBC(kCCDecrypt, parameters, key, data, WTFMove(callback), WTFMove(failureCallback));
     112    ASSERT(sizeof(parameters.iv) == kCCBlockSizeAES128);
     113    auto result = transformAES_CBC(kCCDecrypt, parameters.iv.data(), key.key(), data.first, data.second);
     114    if (result.hasException()) {
     115        failureCallback();
     116        return { };
     117    }
     118    callback(result.releaseReturnValue());
    93119    return { };
    94120}
  • trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp

    r208669 r208891  
    3131#include "CommonCryptoUtilities.h"
    3232#include "CryptoKeyRSA.h"
     33#include "ExceptionCode.h"
     34#include "ScriptExecutionContext.h"
    3335
    3436namespace WebCore {
    3537
     38// FIXME: We should change data to Vector<uint8_t> type once WebKitSubtleCrypto is deprecated.
     39// https://bugs.webkit.org/show_bug.cgi?id=164939
     40static ExceptionOr<Vector<uint8_t>> encryptRSAES_PKCS1_v1_5(const PlatformRSAKey key, size_t keyLength, const uint8_t* data, size_t dataLength)
     41{
     42    Vector<uint8_t> cipherText(keyLength / 8); // Per Step 3.c of https://tools.ietf.org/html/rfc3447#section-7.2.1
     43    size_t cipherTextLength = cipherText.size();
     44    if (CCRSACryptorEncrypt(key, ccPKCS1Padding, data, dataLength, cipherText.data(), &cipherTextLength, 0, 0, kCCDigestNone))
     45        return Exception { OperationError };
     46
     47    return WTFMove(cipherText);
     48}
     49
     50void CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt(Ref<CryptoKey>&& key, Vector<uint8_t>&& plainText, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
     51{
     52    context.ref();
     53    workQueue.dispatch([key = WTFMove(key), plainText = WTFMove(plainText), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback), &context]() mutable {
     54        auto& rsaKey = downcast<CryptoKeyRSA>(key.get());
     55        auto result = encryptRSAES_PKCS1_v1_5(rsaKey.platformKey(), rsaKey.keySizeInBits(), plainText.data(), plainText.size());
     56        if (result.hasException()) {
     57            context.postTask([exceptionCallback = WTFMove(exceptionCallback), ec = result.releaseException().code()](ScriptExecutionContext& context) {
     58                exceptionCallback(ec);
     59                context.deref();
     60            });
     61            return;
     62        }
     63        context.postTask([callback = WTFMove(callback), result = result.releaseReturnValue()](ScriptExecutionContext& context) {
     64            callback(result);
     65            context.deref();
     66        });
     67    });
     68}
     69
    3670ExceptionOr<void> CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt(const CryptoKeyRSA& key, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    3771{
    38     Vector<uint8_t> cipherText(1024);
    39     size_t cipherTextLength = cipherText.size();
    40     CCCryptorStatus status = CCRSACryptorEncrypt(key.platformKey(), ccPKCS1Padding, data.first, data.second, cipherText.data(), &cipherTextLength, 0, 0, kCCDigestNone);
    41     if (status) {
     72    auto result = encryptRSAES_PKCS1_v1_5(key.platformKey(), key.keySizeInBits(), data.first, data.second);
     73    if (result.hasException()) {
    4274        failureCallback();
    4375        return { };
    4476    }
    45 
    46     cipherText.resize(cipherTextLength);
    47     callback(cipherText);
     77    callback(result.releaseReturnValue());
    4878    return { };
    4979}
    5080
     81// FIXME: We should get rid of the magic number 1024. It only makes sense when key length < 8192 bits
    5182ExceptionOr<void> CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt(const CryptoKeyRSA& key, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    5283{
  • trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp

    r208669 r208891  
    3030
    3131#include "CommonCryptoUtilities.h"
     32#include "CryptoAlgorithmRsaOaepParams.h"
    3233#include "CryptoAlgorithmRsaOaepParamsDeprecated.h"
    3334#include "CryptoKeyRSA.h"
    3435#include "ExceptionCode.h"
     36#include "ScriptExecutionContext.h"
    3537
    3638namespace WebCore {
    3739
     40// FIXME: We should change data to Vector<uint8_t> type once WebKitSubtleCrypto is deprecated.
     41// https://bugs.webkit.org/show_bug.cgi?id=164939
     42static ExceptionOr<Vector<uint8_t>> encryptRSA_OAEP(CryptoAlgorithmIdentifier hash, const Vector<uint8_t>& label, const PlatformRSAKey key, size_t keyLength, const uint8_t* data, size_t dataLength)
     43{
     44    CCDigestAlgorithm digestAlgorithm;
     45    if (!getCommonCryptoDigestAlgorithm(hash, digestAlgorithm))
     46        return Exception { OperationError };
     47
     48    Vector<uint8_t> cipherText(keyLength / 8); // Per Step 3.c of https://tools.ietf.org/html/rfc3447#section-7.1.1
     49    size_t cipherTextLength = cipherText.size();
     50    if (CCRSACryptorEncrypt(key, ccOAEPPadding, data, dataLength, cipherText.data(), &cipherTextLength, label.data(), label.size(), digestAlgorithm))
     51        return Exception { OperationError };
     52
     53    return WTFMove(cipherText);
     54}
     55
     56void CryptoAlgorithmRSA_OAEP::platformEncrypt(std::unique_ptr<CryptoAlgorithmParameters>&& parameters, Ref<CryptoKey>&& key, Vector<uint8_t>&& plainText, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
     57{
     58    context.ref();
     59    workQueue.dispatch([parameters = WTFMove(parameters), key = WTFMove(key), plainText = WTFMove(plainText), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback), &context]() mutable {
     60        auto& rsaParameters = downcast<CryptoAlgorithmRsaOaepParams>(*parameters);
     61        auto& rsaKey = downcast<CryptoKeyRSA>(key.get());
     62        auto result = encryptRSA_OAEP(rsaKey.hashAlgorithmIdentifier(), rsaParameters.labelVector(), rsaKey.platformKey(), rsaKey.keySizeInBits(), plainText.data(), plainText.size());
     63        if (result.hasException()) {
     64            context.postTask([exceptionCallback = WTFMove(exceptionCallback), ec = result.releaseException().code()](ScriptExecutionContext& context) {
     65                exceptionCallback(ec);
     66                context.deref();
     67            });
     68            return;
     69        }
     70        context.postTask([callback = WTFMove(callback), result = result.releaseReturnValue()](ScriptExecutionContext& context) {
     71            callback(result);
     72            context.deref();
     73        });
     74    });
     75}
     76
    3877ExceptionOr<void> CryptoAlgorithmRSA_OAEP::platformEncrypt(const CryptoAlgorithmRsaOaepParamsDeprecated& parameters, const CryptoKeyRSA& key, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    3978{
    40     CCDigestAlgorithm digestAlgorithm;
    41     if (!getCommonCryptoDigestAlgorithm(parameters.hash, digestAlgorithm))
    42         return Exception { NOT_SUPPORTED_ERR };
    43 
    44     Vector<uint8_t> cipherText(1024);
    45     size_t cipherTextLength = cipherText.size();
    4679    ASSERT(parameters.hasLabel || parameters.label.isEmpty());
    47     CCCryptorStatus status = CCRSACryptorEncrypt(key.platformKey(), ccOAEPPadding, data.first, data.second, cipherText.data(), &cipherTextLength, parameters.label.data(), parameters.label.size(), digestAlgorithm);
    48     if (status) {
     80    auto result = encryptRSA_OAEP(parameters.hash, parameters.label, key.platformKey(), key.keySizeInBits(), data.first, data.second);
     81    if (result.hasException()) {
    4982        failureCallback();
    5083        return { };
    5184    }
    52 
    53     cipherText.resize(cipherTextLength);
    54     callback(cipherText);
     85    callback(result.releaseReturnValue());
    5586    return { };
    5687}
    5788
     89// FIXME: We should get rid of the magic number 1024. It only makes sense when key length < 8192 bits
    5890ExceptionOr<void> CryptoAlgorithmRSA_OAEP::platformDecrypt(const CryptoAlgorithmRsaOaepParamsDeprecated& parameters, const CryptoKeyRSA& key, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    5991{
  • trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp

    r208801 r208891  
    3838namespace WebCore {
    3939
     40// FIXME: We should get rid of magic number 16384. It assumes that the length of provided key will not exceed 16KB.
     41// https://bugs.webkit.org/show_bug.cgi?id=164942
    4042static CCCryptorStatus getPublicKeyComponents(CCRSACryptorRef rsaKey, Vector<uint8_t>& modulus, Vector<uint8_t>& publicExponent)
    4143{
     
    234236}
    235237
    236 void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsageBitmap usage, KeyPairCallback callback, VoidCallback failureCallback, ScriptExecutionContext* context)
     238// FIXME: We should use WorkQueue here instead of dispatch_async once WebKitSubtleCrypto is deprecated.
     239// https://bugs.webkit.org/show_bug.cgi?id=164943
     240void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsageBitmap usage, KeyPairCallback&& callback, VoidCallback&& failureCallback, ScriptExecutionContext* context)
    237241{
    238242    uint32_t e;
  • trunk/Source/WebCore/crypto/parameters/AesCbcParams.idl

    r208890 r208891  
    2424 */
    2525
    26 #include "config.h"
    27 #include "SubtleCrypto.h"
    28 
    29 #if ENABLE(SUBTLE_CRYPTO)
    30 
    31 namespace WebCore {
    32 
    33 SubtleCrypto::SubtleCrypto(ScriptExecutionContext& context)
    34     : ContextDestructionObserver(&context)
    35 {
    36 }
    37 
    38 }
    39 
    40 #endif
     26[
     27    Conditional=SUBTLE_CRYPTO,
     28    ImplementedAs=CryptoAlgorithmAesCbcParams
     29] dictionary AesCbcParams : CryptoAlgorithmParameters {
     30    // The initialization vector. MUST be 16 bytes.
     31    required BufferSource iv;
     32};
  • trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h

    r208890 r208891  
    2626#pragma once
    2727
    28 #include "ContextDestructionObserver.h"
    29 #include <wtf/Ref.h>
    30 #include <wtf/RefCounted.h>
     28#include "BufferSource.h"
     29#include "CryptoAlgorithmParameters.h"
     30#include <wtf/Vector.h>
    3131
    3232#if ENABLE(SUBTLE_CRYPTO)
     
    3434namespace WebCore {
    3535
    36 class SubtleCrypto : public ContextDestructionObserver, public RefCounted<SubtleCrypto> {
     36class CryptoAlgorithmAesCbcParams final : public CryptoAlgorithmParameters {
    3737public:
    38     enum class KeyFormat { Raw, Spki, Pkcs8, Jwk };
     38    BufferSource iv;
    3939
    40     static Ref<SubtleCrypto> create(ScriptExecutionContext& context) { return adoptRef(*new SubtleCrypto(context)); }
     40    Class parametersClass() const final { return Class::AesCbcParams; }
     41
     42    const Vector<uint8_t>& ivVector()
     43    {
     44        if (!m_ivVector.isEmpty() || !iv.length())
     45            return m_ivVector;
     46
     47        m_ivVector.append(iv.data(), iv.length());
     48        return m_ivVector;
     49    }
    4150
    4251private:
    43     SubtleCrypto(ScriptExecutionContext&);
     52    Vector<uint8_t> m_ivVector;
    4453};
    4554
    46 }
     55} // namespace WebCore
    4756
    48 #endif
     57SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(AesCbcParams)
     58
     59#endif // ENABLE(SUBTLE_CRYPTO)
  • trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h

    r207809 r208891  
    3636public:
    3737    // The initialization vector. MUST be 16 bytes.
    38     std::array<char, 16> iv;
     38    std::array<uint8_t, 16> iv;
    3939
    4040    Class parametersClass() const override { return Class::AesCbcParams; }
  • trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h

    r208890 r208891  
    2626#pragma once
    2727
    28 #include "CryptoAlgorithmIdentifier.h"
    29 #include <wtf/TypeCasts.h>
    30 #include <wtf/text/WTFString.h>
     28#include "BufferSource.h"
     29#include "CryptoAlgorithmParameters.h"
     30#include <wtf/Vector.h>
    3131
    3232#if ENABLE(SUBTLE_CRYPTO)
     
    3434namespace WebCore {
    3535
    36 class CryptoAlgorithmParameters {
     36class CryptoAlgorithmRsaOaepParams final : public CryptoAlgorithmParameters {
    3737public:
    38     enum class Class {
    39         None,
    40         AesKeyGenParams,
    41         HmacKeyParams,
    42         RsaHashedKeyGenParams,
    43         RsaHashedImportParams,
    44         RsaKeyGenParams,
    45     };
     38    // Use labelVector() instead of label. The label will be gone once labelVector() is called.
     39    Optional<BufferSource::VariantType> label;
    4640
    47     // FIXME: Consider merging name and identifier.
    48     String name;
    49     CryptoAlgorithmIdentifier identifier;
     41    Class parametersClass() const final { return Class::RsaOaepParams; }
    5042
    51     virtual ~CryptoAlgorithmParameters() { }
     43    const Vector<uint8_t>& labelVector()
     44    {
     45        if (!m_labelVector.isEmpty() || !label)
     46            return m_labelVector;
    5247
    53     virtual Class parametersClass() const { return Class::None; }
     48        m_labelBuffer = WTFMove(*label);
     49        label = Nullopt;
     50        if (!m_labelBuffer.length())
     51            return m_labelVector;
     52
     53        m_labelVector.append(m_labelBuffer.data(), m_labelBuffer.length());
     54        return m_labelVector;
     55    }
     56
     57private:
     58    Vector<uint8_t> m_labelVector;
     59    BufferSource m_labelBuffer;
    5460};
    5561
    5662} // namespace WebCore
    5763
    58 #define SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(ToClassName) \
    59 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
    60 static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
    61 SPECIALIZE_TYPE_TRAITS_END()
     64SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaOaepParams)
    6265
    6366#endif // ENABLE(SUBTLE_CRYPTO)
Note: See TracChangeset for help on using the changeset viewer.