Changeset 158396 in webkit


Ignore:
Timestamp:
Oct 31, 2013 2:50:01 PM (10 years ago)
Author:
ap@apple.com
Message:

Enable WebCrypto on Mac
https://bugs.webkit.org/show_bug.cgi?id=123587

Reviewed by Anders Carlsson.

Source/JavaScriptCore:

  • Configurations/FeatureDefines.xcconfig: Do it.

Source/WebCore:

  • Configurations/FeatureDefines.xcconfig: Enable it.
  • bindings/js/JSCryptoAlgorithmDictionary.cpp: Build fix.
  • crypto/CryptoAlgorithmRegistry.cpp: (WebCore::CryptoAlgorithmRegistry::getIdentifierForName):

Special case empty keys to avoid upsetting HashMap.

  • crypto/algorithms/CryptoAlgorithmSHA1.cpp: (WebCore::CryptoAlgorithmSHA1::create):

Build fix. Can't use make_unique, because constructor is private.

Source/WebKit/mac:

  • Configurations/FeatureDefines.xcconfig: Do it.

Source/WebKit2:

  • Configurations/FeatureDefines.xcconfig: Do it.

LayoutTests:

  • TestExpectations:
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/win/TestExpectations:
  • platform/wincairo/TestExpectations:

Only skipping on specific platforms now.

  • crypto: Added.
  • crypto/crypto-gc-expected.txt: Copied from LayoutTests/security/crypto-gc-expected.txt.
  • crypto/crypto-gc.html: Copied from LayoutTests/security/crypto-gc.html.
  • crypto/crypto-random-values-expected.txt: Copied from LayoutTests/security/crypto-random-values-expected.txt.
  • crypto/crypto-random-values-limits-expected.txt: Copied from LayoutTests/security/crypto-random-values-limits-expected.txt.
  • crypto/crypto-random-values-limits.html: Copied from LayoutTests/security/crypto-random-values-limits.html.
  • crypto/crypto-random-values-types-expected.txt: Copied from LayoutTests/security/crypto-random-values-types-expected.txt.
  • crypto/crypto-random-values-types.html: Copied from LayoutTests/security/crypto-random-values-types.html.
  • crypto/crypto-random-values.html: Copied from LayoutTests/security/crypto-random-values.html.
  • crypto/subtle: Added.
  • crypto/subtle/argument-conversion-expected.txt: Copied from LayoutTests/security/crypto-subtle-arguments-expected.txt.
  • crypto/subtle/argument-conversion.html: Copied from LayoutTests/security/crypto-subtle-arguments.html.
  • crypto/subtle/gc-2-expected.txt: Copied from LayoutTests/security/crypto-subtle-gc-2-expected.txt.
  • crypto/subtle/gc-2.html: Copied from LayoutTests/security/crypto-subtle-gc-2.html.
  • crypto/subtle/gc-3-expected.txt: Copied from LayoutTests/security/crypto-subtle-gc-3-expected.txt.
  • crypto/subtle/gc-3.html: Copied from LayoutTests/security/crypto-subtle-gc-3.html.
  • crypto/subtle/gc-expected.txt: Copied from LayoutTests/security/crypto-subtle-gc-expected.txt.
  • crypto/subtle/gc.html: Copied from LayoutTests/security/crypto-subtle-gc.html.
  • crypto/subtle/resources: Added.
  • crypto/subtle/resources/common.js: Copied from LayoutTests/security/resources/common.js.
  • crypto/subtle/sha-1-expected.txt: Copied from LayoutTests/security/crypto-subtle-sha1-expected.txt.
  • crypto/subtle/sha-1.html: Copied from LayoutTests/security/crypto-subtle-sha1.html.
  • security/crypto-gc-expected.txt: Removed.
  • security/crypto-gc.html: Removed.
  • security/crypto-random-values-expected.txt: Removed.
  • security/crypto-random-values-limits-expected.txt: Removed.
  • security/crypto-random-values-limits.html: Removed.
  • security/crypto-random-values-types-expected.txt: Removed.
  • security/crypto-random-values-types.html: Removed.
  • security/crypto-random-values.html: Removed.
  • security/crypto-subtle-arguments-expected.txt: Removed.
  • security/crypto-subtle-arguments.html: Removed.
  • security/crypto-subtle-gc-2-expected.txt: Removed.
  • security/crypto-subtle-gc-2.html: Removed.
  • security/crypto-subtle-gc-3-expected.txt: Removed.
  • security/crypto-subtle-gc-3.html: Removed.
  • security/crypto-subtle-gc-expected.txt: Removed.
  • security/crypto-subtle-gc.html: Removed.
  • security/crypto-subtle-sha1-expected.txt: Removed.
  • security/crypto-subtle-sha1.html: Removed.
  • security/resources/common.js: Removed.

Moved tests from security/ to crypto/.

Location:
trunk
Files:
3 added
18 edited
19 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r158389 r158396  
     12013-10-31  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Enable WebCrypto on Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=123587
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * TestExpectations:
     9        * platform/efl/TestExpectations:
     10        * platform/gtk/TestExpectations:
     11        * platform/win/TestExpectations:
     12        * platform/wincairo/TestExpectations:
     13        Only skipping on specific platforms now.
     14
     15        * crypto: Added.
     16        * crypto/crypto-gc-expected.txt: Copied from LayoutTests/security/crypto-gc-expected.txt.
     17        * crypto/crypto-gc.html: Copied from LayoutTests/security/crypto-gc.html.
     18        * crypto/crypto-random-values-expected.txt: Copied from LayoutTests/security/crypto-random-values-expected.txt.
     19        * crypto/crypto-random-values-limits-expected.txt: Copied from LayoutTests/security/crypto-random-values-limits-expected.txt.
     20        * crypto/crypto-random-values-limits.html: Copied from LayoutTests/security/crypto-random-values-limits.html.
     21        * crypto/crypto-random-values-types-expected.txt: Copied from LayoutTests/security/crypto-random-values-types-expected.txt.
     22        * crypto/crypto-random-values-types.html: Copied from LayoutTests/security/crypto-random-values-types.html.
     23        * crypto/crypto-random-values.html: Copied from LayoutTests/security/crypto-random-values.html.
     24        * crypto/subtle: Added.
     25        * crypto/subtle/argument-conversion-expected.txt: Copied from LayoutTests/security/crypto-subtle-arguments-expected.txt.
     26        * crypto/subtle/argument-conversion.html: Copied from LayoutTests/security/crypto-subtle-arguments.html.
     27        * crypto/subtle/gc-2-expected.txt: Copied from LayoutTests/security/crypto-subtle-gc-2-expected.txt.
     28        * crypto/subtle/gc-2.html: Copied from LayoutTests/security/crypto-subtle-gc-2.html.
     29        * crypto/subtle/gc-3-expected.txt: Copied from LayoutTests/security/crypto-subtle-gc-3-expected.txt.
     30        * crypto/subtle/gc-3.html: Copied from LayoutTests/security/crypto-subtle-gc-3.html.
     31        * crypto/subtle/gc-expected.txt: Copied from LayoutTests/security/crypto-subtle-gc-expected.txt.
     32        * crypto/subtle/gc.html: Copied from LayoutTests/security/crypto-subtle-gc.html.
     33        * crypto/subtle/resources: Added.
     34        * crypto/subtle/resources/common.js: Copied from LayoutTests/security/resources/common.js.
     35        * crypto/subtle/sha-1-expected.txt: Copied from LayoutTests/security/crypto-subtle-sha1-expected.txt.
     36        * crypto/subtle/sha-1.html: Copied from LayoutTests/security/crypto-subtle-sha1.html.
     37        * security/crypto-gc-expected.txt: Removed.
     38        * security/crypto-gc.html: Removed.
     39        * security/crypto-random-values-expected.txt: Removed.
     40        * security/crypto-random-values-limits-expected.txt: Removed.
     41        * security/crypto-random-values-limits.html: Removed.
     42        * security/crypto-random-values-types-expected.txt: Removed.
     43        * security/crypto-random-values-types.html: Removed.
     44        * security/crypto-random-values.html: Removed.
     45        * security/crypto-subtle-arguments-expected.txt: Removed.
     46        * security/crypto-subtle-arguments.html: Removed.
     47        * security/crypto-subtle-gc-2-expected.txt: Removed.
     48        * security/crypto-subtle-gc-2.html: Removed.
     49        * security/crypto-subtle-gc-3-expected.txt: Removed.
     50        * security/crypto-subtle-gc-3.html: Removed.
     51        * security/crypto-subtle-gc-expected.txt: Removed.
     52        * security/crypto-subtle-gc.html: Removed.
     53        * security/crypto-subtle-sha1-expected.txt: Removed.
     54        * security/crypto-subtle-sha1.html: Removed.
     55        * security/resources/common.js: Removed.
     56        Moved tests from security/ to crypto/.
     57
    1582013-10-31  Myles C. Maxfield  <mmaxfield@apple.com>
    259
  • trunk/LayoutTests/TestExpectations

    r158387 r158396  
    7272fast/mediastream/MediaStream-onended.html [ Skip ]
    7373
    74 # crypto.subtle is not yet enabled on any ports
    75 webkit.org/b/122679 security/crypto-subtle-gc.html [ Skip ]
    76 webkit.org/b/122679 security/crypto-subtle-gc-2.html [ Skip ]
    77 webkit.org/b/122679 security/crypto-subtle-gc-3.html [ Skip ]
    78 webkit.org/b/122679 security/crypto-subtle-sha1.html [ Skip ]
    79 webkit.org/b/122679 security/crypto-subtle-arguments.html [ Skip ]
    80 
    8174webkit.org/b/123555 [ Debug ] media/media-fragments/TC0054.html [ Crash ]
    8275webkit.org/b/123555 [ Debug ] media/media-fragments/TC0061.html [ Crash ]
  • trunk/LayoutTests/crypto/subtle/argument-conversion.html

    r158393 r158396  
    22<html>
    33<head>
    4 <script src="../resources/js-test-pre.js"></script>
     4<script src="../../resources/js-test-pre.js"></script>
    55<script src="resources/common.js"></script>
    66</head>
     
    6161</script>
    6262
    63 <script src="../resources/js-test-post.js"></script>
     63<script src="../../resources/js-test-post.js"></script>
    6464</body>
    6565</html>
  • trunk/LayoutTests/crypto/subtle/gc-2.html

    r158393 r158396  
    33<head>
    44<meta charset="utf-8">
    5 <script src="../resources/js-test-pre.js"></script>
     5<script src="../../resources/js-test-pre.js"></script>
    66</head>
    77<body>
     
    4242</script>
    4343<iframe src="about:blank"></iframe>
    44 <script src="../resources/js-test-post.js"></script>
     44<script src="../../resources/js-test-post.js"></script>
    4545</body>
    4646</html>
  • trunk/LayoutTests/crypto/subtle/gc-3.html

    r158393 r158396  
    33<head>
    44<meta charset="utf-8">
    5 <script src="../resources/js-test-pre.js"></script>
     5<script src="../../resources/js-test-pre.js"></script>
    66</head>
    77<body>
     
    3939</script>
    4040<iframe src="about:blank"></iframe>
    41 <script src="../resources/js-test-post.js"></script>
     41<script src="../../resources/js-test-post.js"></script>
    4242</body>
    4343</html>
  • trunk/LayoutTests/crypto/subtle/gc.html

    r158393 r158396  
    33<head>
    44<meta charset="utf-8">
    5 <script src="../resources/js-test-pre.js"></script>
     5<script src="../../resources/js-test-pre.js"></script>
    66</head>
    77<body>
     
    3434
    3535</script>
    36 <script src="../resources/js-test-post.js"></script>
     36<script src="../../resources/js-test-post.js"></script>
    3737</body>
    3838</html>
  • trunk/LayoutTests/crypto/subtle/sha-1.html

    r158393 r158396  
    22<html>
    33<head>
    4 <script src="../resources/js-test-pre.js"></script>
     4<script src="../../resources/js-test-pre.js"></script>
    55<script src="resources/common.js"></script>
    66</head>
     
    4444</script>
    4545
    46 <script src="../resources/js-test-post.js"></script>
     46<script src="../../resources/js-test-post.js"></script>
    4747</body>
    4848</html>
  • trunk/LayoutTests/platform/efl/TestExpectations

    r158353 r158396  
    15891589webkit.org/b/123561 printing/single-line-must-not-be-split-into-two-pages.html [ Missing ]
    15901590webkit.org/b/123561 printing/width-overflow.html [ Missing ]
     1591
     1592# crypto.subtle is not yet enabled
     1593crypto/subtle [ Skip ]
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r158267 r158396  
    456456# Needs to update the gtk databaseQuotaExceeded() test function to handle quota expansion requests.
    457457storage/websql/open-database-expand-quota.html [ Failure ]
     458
     459# crypto.subtle is not yet enabled
     460crypto/subtle [ Skip ]
    458461
    459462#////////////////////////////////////////////////////////////////////////////////////////
  • trunk/LayoutTests/platform/win/TestExpectations

    r157585 r158396  
    28762876media/video-canvas-drawing-output.html
    28772877
    2878 
     2878# crypto.subtle is not yet enabled
     2879crypto/subtle [ Skip ]
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r157407 r158396  
    28512851# No concept of secure text input
    28522852editing/secure-input [ Failure ]
     2853
     2854# crypto.subtle is not yet enabled
     2855crypto/subtle [ Skip ]
  • trunk/Source/JavaScriptCore/ChangeLog

    r158385 r158396  
     12013-10-31  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Enable WebCrypto on Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=123587
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Configurations/FeatureDefines.xcconfig: Do it.
     9
    1102013-10-31  Filip Pizlo  <fpizlo@apple.com>
    211
  • trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig

    r158127 r158396  
    156156ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
    157157ENABLE_SUBPIXEL_LAYOUT = ;
    158 ENABLE_SUBTLE_CRYPTO = ;
     158ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
    159159ENABLE_SVG = ENABLE_SVG;
    160160ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
  • trunk/Source/WebCore/ChangeLog

    r158392 r158396  
     12013-10-31  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Enable WebCrypto on Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=123587
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Configurations/FeatureDefines.xcconfig: Enable it.
     9
     10        * bindings/js/JSCryptoAlgorithmDictionary.cpp: Build fix.
     11
     12        * crypto/CryptoAlgorithmRegistry.cpp: (WebCore::CryptoAlgorithmRegistry::getIdentifierForName):
     13        Special case empty keys to avoid upsetting HashMap.
     14
     15        * crypto/algorithms/CryptoAlgorithmSHA1.cpp: (WebCore::CryptoAlgorithmSHA1::create):
     16        Build fix. Can't use make_unique, because constructor is private.
     17
    1182013-10-31  Myles C. Maxfield  <mmaxfield@apple.com>
    219
  • trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig

    r158231 r158396  
    156156ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
    157157ENABLE_SUBPIXEL_LAYOUT = ;
    158 ENABLE_SUBTLE_CRYPTO = ;
     158ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
    159159ENABLE_SVG = ENABLE_SVG;
    160160ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
  • trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp

    r158361 r158396  
    3030
    3131#include <runtime/ObjectConstructor.h>
     32#include <runtime/Operations.h>
    3233
    3334using namespace JSC;
  • trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp

    r158366 r158396  
    2929#if ENABLE(SUBTLE_CRYPTO)
    3030
    31 #include "CryptoAlgorithmHMAC.h"
    3231#include "CryptoAlgorithmHmacKeyParams.h"
    3332#include "CryptoAlgorithmHmacParams.h"
     
    150149}
    151150
    152 std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForEncrypt(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
    153 {
    154     switch (algorithm) {
    155     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
    156     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
    157     case CryptoAlgorithmIdentifier::RSA_PSS:
    158     case CryptoAlgorithmIdentifier::RSA_OAEP:
    159     case CryptoAlgorithmIdentifier::ECDSA:
    160     case CryptoAlgorithmIdentifier::ECDH:
    161     case CryptoAlgorithmIdentifier::AES_CTR:
    162     case CryptoAlgorithmIdentifier::AES_CBC:
    163     case CryptoAlgorithmIdentifier::AES_CMAC:
    164     case CryptoAlgorithmIdentifier::AES_GCM:
    165     case CryptoAlgorithmIdentifier::AES_CFB:
    166     case CryptoAlgorithmIdentifier::HMAC:
    167     case CryptoAlgorithmIdentifier::DH:
    168     case CryptoAlgorithmIdentifier::SHA_1:
    169     case CryptoAlgorithmIdentifier::SHA_224:
    170     case CryptoAlgorithmIdentifier::SHA_256:
    171     case CryptoAlgorithmIdentifier::SHA_384:
    172     case CryptoAlgorithmIdentifier::SHA_512:
    173     case CryptoAlgorithmIdentifier::CONCAT:
    174     case CryptoAlgorithmIdentifier::HKDF_CTR:
    175     case CryptoAlgorithmIdentifier::PBKDF2:
    176         setDOMException(exec, NOT_SUPPORTED_ERR);
    177         return nullptr;
    178     }
    179 }
    180 
    181 std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDecrypt(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
     151std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForEncrypt(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
     152{
     153    switch (algorithm) {
     154    case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
     155    case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
     156    case CryptoAlgorithmIdentifier::RSA_PSS:
     157    case CryptoAlgorithmIdentifier::RSA_OAEP:
     158    case CryptoAlgorithmIdentifier::ECDSA:
     159    case CryptoAlgorithmIdentifier::ECDH:
     160    case CryptoAlgorithmIdentifier::AES_CTR:
     161    case CryptoAlgorithmIdentifier::AES_CBC:
     162    case CryptoAlgorithmIdentifier::AES_CMAC:
     163    case CryptoAlgorithmIdentifier::AES_GCM:
     164    case CryptoAlgorithmIdentifier::AES_CFB:
     165    case CryptoAlgorithmIdentifier::HMAC:
     166    case CryptoAlgorithmIdentifier::DH:
     167    case CryptoAlgorithmIdentifier::SHA_1:
     168    case CryptoAlgorithmIdentifier::SHA_224:
     169    case CryptoAlgorithmIdentifier::SHA_256:
     170    case CryptoAlgorithmIdentifier::SHA_384:
     171    case CryptoAlgorithmIdentifier::SHA_512:
     172    case CryptoAlgorithmIdentifier::CONCAT:
     173    case CryptoAlgorithmIdentifier::HKDF_CTR:
     174    case CryptoAlgorithmIdentifier::PBKDF2:
     175        setDOMException(exec, NOT_SUPPORTED_ERR);
     176        return nullptr;
     177    }
     178}
     179
     180std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDecrypt(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
    182181{
    183182    switch (algorithm) {
     
    304303}
    305304
    306 std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForGenerateKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
    307 {
    308     switch (algorithm) {
    309     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
    310     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
    311     case CryptoAlgorithmIdentifier::RSA_PSS:
    312     case CryptoAlgorithmIdentifier::RSA_OAEP:
    313     case CryptoAlgorithmIdentifier::ECDSA:
    314     case CryptoAlgorithmIdentifier::ECDH:
    315     case CryptoAlgorithmIdentifier::AES_CTR:
    316     case CryptoAlgorithmIdentifier::AES_CBC:
    317     case CryptoAlgorithmIdentifier::AES_CMAC:
    318     case CryptoAlgorithmIdentifier::AES_GCM:
    319     case CryptoAlgorithmIdentifier::AES_CFB:
    320     case CryptoAlgorithmIdentifier::HMAC:
    321     case CryptoAlgorithmIdentifier::DH:
    322     case CryptoAlgorithmIdentifier::SHA_1:
    323     case CryptoAlgorithmIdentifier::SHA_224:
    324     case CryptoAlgorithmIdentifier::SHA_256:
    325     case CryptoAlgorithmIdentifier::SHA_384:
    326     case CryptoAlgorithmIdentifier::SHA_512:
    327     case CryptoAlgorithmIdentifier::CONCAT:
    328     case CryptoAlgorithmIdentifier::HKDF_CTR:
    329     case CryptoAlgorithmIdentifier::PBKDF2:
    330         setDOMException(exec, NOT_SUPPORTED_ERR);
    331         return nullptr;
    332     }
    333 }
    334 
    335 std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDeriveKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
    336 {
    337     switch (algorithm) {
    338     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
    339     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
    340     case CryptoAlgorithmIdentifier::RSA_PSS:
    341     case CryptoAlgorithmIdentifier::RSA_OAEP:
    342     case CryptoAlgorithmIdentifier::ECDSA:
    343     case CryptoAlgorithmIdentifier::ECDH:
    344     case CryptoAlgorithmIdentifier::AES_CTR:
    345     case CryptoAlgorithmIdentifier::AES_CBC:
    346     case CryptoAlgorithmIdentifier::AES_CMAC:
    347     case CryptoAlgorithmIdentifier::AES_GCM:
    348     case CryptoAlgorithmIdentifier::AES_CFB:
    349     case CryptoAlgorithmIdentifier::HMAC:
    350     case CryptoAlgorithmIdentifier::DH:
    351     case CryptoAlgorithmIdentifier::SHA_1:
    352     case CryptoAlgorithmIdentifier::SHA_224:
    353     case CryptoAlgorithmIdentifier::SHA_256:
    354     case CryptoAlgorithmIdentifier::SHA_384:
    355     case CryptoAlgorithmIdentifier::SHA_512:
    356     case CryptoAlgorithmIdentifier::CONCAT:
    357     case CryptoAlgorithmIdentifier::HKDF_CTR:
    358     case CryptoAlgorithmIdentifier::PBKDF2:
    359         setDOMException(exec, NOT_SUPPORTED_ERR);
    360         return nullptr;
    361     }
    362 }
    363 
    364 std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDeriveBits(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
     305std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForGenerateKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
     306{
     307    switch (algorithm) {
     308    case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
     309    case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
     310    case CryptoAlgorithmIdentifier::RSA_PSS:
     311    case CryptoAlgorithmIdentifier::RSA_OAEP:
     312    case CryptoAlgorithmIdentifier::ECDSA:
     313    case CryptoAlgorithmIdentifier::ECDH:
     314    case CryptoAlgorithmIdentifier::AES_CTR:
     315    case CryptoAlgorithmIdentifier::AES_CBC:
     316    case CryptoAlgorithmIdentifier::AES_CMAC:
     317    case CryptoAlgorithmIdentifier::AES_GCM:
     318    case CryptoAlgorithmIdentifier::AES_CFB:
     319    case CryptoAlgorithmIdentifier::HMAC:
     320    case CryptoAlgorithmIdentifier::DH:
     321    case CryptoAlgorithmIdentifier::SHA_1:
     322    case CryptoAlgorithmIdentifier::SHA_224:
     323    case CryptoAlgorithmIdentifier::SHA_256:
     324    case CryptoAlgorithmIdentifier::SHA_384:
     325    case CryptoAlgorithmIdentifier::SHA_512:
     326    case CryptoAlgorithmIdentifier::CONCAT:
     327    case CryptoAlgorithmIdentifier::HKDF_CTR:
     328    case CryptoAlgorithmIdentifier::PBKDF2:
     329        setDOMException(exec, NOT_SUPPORTED_ERR);
     330        return nullptr;
     331    }
     332}
     333
     334std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDeriveKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
     335{
     336    switch (algorithm) {
     337    case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
     338    case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
     339    case CryptoAlgorithmIdentifier::RSA_PSS:
     340    case CryptoAlgorithmIdentifier::RSA_OAEP:
     341    case CryptoAlgorithmIdentifier::ECDSA:
     342    case CryptoAlgorithmIdentifier::ECDH:
     343    case CryptoAlgorithmIdentifier::AES_CTR:
     344    case CryptoAlgorithmIdentifier::AES_CBC:
     345    case CryptoAlgorithmIdentifier::AES_CMAC:
     346    case CryptoAlgorithmIdentifier::AES_GCM:
     347    case CryptoAlgorithmIdentifier::AES_CFB:
     348    case CryptoAlgorithmIdentifier::HMAC:
     349    case CryptoAlgorithmIdentifier::DH:
     350    case CryptoAlgorithmIdentifier::SHA_1:
     351    case CryptoAlgorithmIdentifier::SHA_224:
     352    case CryptoAlgorithmIdentifier::SHA_256:
     353    case CryptoAlgorithmIdentifier::SHA_384:
     354    case CryptoAlgorithmIdentifier::SHA_512:
     355    case CryptoAlgorithmIdentifier::CONCAT:
     356    case CryptoAlgorithmIdentifier::HKDF_CTR:
     357    case CryptoAlgorithmIdentifier::PBKDF2:
     358        setDOMException(exec, NOT_SUPPORTED_ERR);
     359        return nullptr;
     360    }
     361}
     362
     363std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDeriveBits(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
    365364{
    366365    switch (algorithm) {
     
    423422}
    424423
    425 std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForExportKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
    426 {
    427     switch (algorithm) {
    428     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
    429     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
    430     case CryptoAlgorithmIdentifier::RSA_PSS:
    431     case CryptoAlgorithmIdentifier::RSA_OAEP:
    432     case CryptoAlgorithmIdentifier::ECDSA:
    433     case CryptoAlgorithmIdentifier::ECDH:
    434     case CryptoAlgorithmIdentifier::AES_CTR:
    435     case CryptoAlgorithmIdentifier::AES_CBC:
    436     case CryptoAlgorithmIdentifier::AES_CMAC:
    437     case CryptoAlgorithmIdentifier::AES_GCM:
    438     case CryptoAlgorithmIdentifier::AES_CFB:
    439     case CryptoAlgorithmIdentifier::HMAC:
    440     case CryptoAlgorithmIdentifier::DH:
    441     case CryptoAlgorithmIdentifier::SHA_1:
    442     case CryptoAlgorithmIdentifier::SHA_224:
    443     case CryptoAlgorithmIdentifier::SHA_256:
    444     case CryptoAlgorithmIdentifier::SHA_384:
    445     case CryptoAlgorithmIdentifier::SHA_512:
    446     case CryptoAlgorithmIdentifier::CONCAT:
    447     case CryptoAlgorithmIdentifier::HKDF_CTR:
    448     case CryptoAlgorithmIdentifier::PBKDF2:
    449         setDOMException(exec, NOT_SUPPORTED_ERR);
    450         return nullptr;
    451     }
    452 }
    453 
    454 std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForWrapKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
    455 {
    456     switch (algorithm) {
    457     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
    458     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
    459     case CryptoAlgorithmIdentifier::RSA_PSS:
    460     case CryptoAlgorithmIdentifier::RSA_OAEP:
    461     case CryptoAlgorithmIdentifier::ECDSA:
    462     case CryptoAlgorithmIdentifier::ECDH:
    463     case CryptoAlgorithmIdentifier::AES_CTR:
    464     case CryptoAlgorithmIdentifier::AES_CBC:
    465     case CryptoAlgorithmIdentifier::AES_CMAC:
    466     case CryptoAlgorithmIdentifier::AES_GCM:
    467     case CryptoAlgorithmIdentifier::AES_CFB:
    468     case CryptoAlgorithmIdentifier::HMAC:
    469     case CryptoAlgorithmIdentifier::DH:
    470     case CryptoAlgorithmIdentifier::SHA_1:
    471     case CryptoAlgorithmIdentifier::SHA_224:
    472     case CryptoAlgorithmIdentifier::SHA_256:
    473     case CryptoAlgorithmIdentifier::SHA_384:
    474     case CryptoAlgorithmIdentifier::SHA_512:
    475     case CryptoAlgorithmIdentifier::CONCAT:
    476     case CryptoAlgorithmIdentifier::HKDF_CTR:
    477     case CryptoAlgorithmIdentifier::PBKDF2:
    478         setDOMException(exec, NOT_SUPPORTED_ERR);
    479         return nullptr;
    480     }
    481 }
    482 
    483 std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForUnwrapKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
     424std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForExportKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
     425{
     426    switch (algorithm) {
     427    case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
     428    case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
     429    case CryptoAlgorithmIdentifier::RSA_PSS:
     430    case CryptoAlgorithmIdentifier::RSA_OAEP:
     431    case CryptoAlgorithmIdentifier::ECDSA:
     432    case CryptoAlgorithmIdentifier::ECDH:
     433    case CryptoAlgorithmIdentifier::AES_CTR:
     434    case CryptoAlgorithmIdentifier::AES_CBC:
     435    case CryptoAlgorithmIdentifier::AES_CMAC:
     436    case CryptoAlgorithmIdentifier::AES_GCM:
     437    case CryptoAlgorithmIdentifier::AES_CFB:
     438    case CryptoAlgorithmIdentifier::HMAC:
     439    case CryptoAlgorithmIdentifier::DH:
     440    case CryptoAlgorithmIdentifier::SHA_1:
     441    case CryptoAlgorithmIdentifier::SHA_224:
     442    case CryptoAlgorithmIdentifier::SHA_256:
     443    case CryptoAlgorithmIdentifier::SHA_384:
     444    case CryptoAlgorithmIdentifier::SHA_512:
     445    case CryptoAlgorithmIdentifier::CONCAT:
     446    case CryptoAlgorithmIdentifier::HKDF_CTR:
     447    case CryptoAlgorithmIdentifier::PBKDF2:
     448        setDOMException(exec, NOT_SUPPORTED_ERR);
     449        return nullptr;
     450    }
     451}
     452
     453std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForWrapKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
     454{
     455    switch (algorithm) {
     456    case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
     457    case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
     458    case CryptoAlgorithmIdentifier::RSA_PSS:
     459    case CryptoAlgorithmIdentifier::RSA_OAEP:
     460    case CryptoAlgorithmIdentifier::ECDSA:
     461    case CryptoAlgorithmIdentifier::ECDH:
     462    case CryptoAlgorithmIdentifier::AES_CTR:
     463    case CryptoAlgorithmIdentifier::AES_CBC:
     464    case CryptoAlgorithmIdentifier::AES_CMAC:
     465    case CryptoAlgorithmIdentifier::AES_GCM:
     466    case CryptoAlgorithmIdentifier::AES_CFB:
     467    case CryptoAlgorithmIdentifier::HMAC:
     468    case CryptoAlgorithmIdentifier::DH:
     469    case CryptoAlgorithmIdentifier::SHA_1:
     470    case CryptoAlgorithmIdentifier::SHA_224:
     471    case CryptoAlgorithmIdentifier::SHA_256:
     472    case CryptoAlgorithmIdentifier::SHA_384:
     473    case CryptoAlgorithmIdentifier::SHA_512:
     474    case CryptoAlgorithmIdentifier::CONCAT:
     475    case CryptoAlgorithmIdentifier::HKDF_CTR:
     476    case CryptoAlgorithmIdentifier::PBKDF2:
     477        setDOMException(exec, NOT_SUPPORTED_ERR);
     478        return nullptr;
     479    }
     480}
     481
     482std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForUnwrapKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
    484483{
    485484    switch (algorithm) {
  • trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp

    r158363 r158396  
    4848bool CryptoAlgorithmRegistry::getIdentifierForName(const String& name, CryptoAlgorithmIdentifier& result)
    4949{
     50    if (name.isEmpty())
     51        return false;
     52
    5053    auto iter = m_nameToIdentifierMap.find(name.lower());
    5154    if (iter == m_nameToIdentifierMap.end())
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp

    r158387 r158396  
    4343std::unique_ptr<CryptoAlgorithm> CryptoAlgorithmSHA1::create()
    4444{
    45     return std::make_unique<CryptoAlgorithmSHA1>();
     45    return std::unique_ptr<CryptoAlgorithm>(new CryptoAlgorithmSHA1);
    4646}
    4747
  • trunk/Source/WebKit/mac/ChangeLog

    r158330 r158396  
     12013-10-31  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Enable WebCrypto on Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=123587
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Configurations/FeatureDefines.xcconfig: Do it.
     9
    1102013-10-30  Ryosuke Niwa  <rniwa@webkit.org>
    211
  • trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig

    r158231 r158396  
    156156ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
    157157ENABLE_SUBPIXEL_LAYOUT = ;
    158 ENABLE_SUBTLE_CRYPTO = ;
     158ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
    159159ENABLE_SVG = ENABLE_SVG;
    160160ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
  • trunk/Source/WebKit2/ChangeLog

    r158388 r158396  
     12013-10-31  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Enable WebCrypto on Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=123587
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Configurations/FeatureDefines.xcconfig: Do it.
     9
    1102013-10-31  Sergio Correia  <sergio.correia@openbossa.org>
    211
  • trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig

    r158231 r158396  
    156156ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
    157157ENABLE_SUBPIXEL_LAYOUT = ;
    158 ENABLE_SUBTLE_CRYPTO = ;
     158ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
    159159ENABLE_SVG = ENABLE_SVG;
    160160ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
Note: See TracChangeset for help on using the changeset viewer.