Enable WebCrypto on Mac
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2013 21:50:01 +0000 (21:50 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2013 21:50:01 +0000 (21:50 +0000)
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/.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158396 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/crypto/crypto-gc-expected.txt [moved from LayoutTests/security/crypto-gc-expected.txt with 100% similarity]
LayoutTests/crypto/crypto-gc.html [moved from LayoutTests/security/crypto-gc.html with 100% similarity]
LayoutTests/crypto/crypto-random-values-expected.txt [moved from LayoutTests/security/crypto-random-values-expected.txt with 100% similarity]
LayoutTests/crypto/crypto-random-values-limits-expected.txt [moved from LayoutTests/security/crypto-random-values-limits-expected.txt with 100% similarity]
LayoutTests/crypto/crypto-random-values-limits.html [moved from LayoutTests/security/crypto-random-values-limits.html with 100% similarity]
LayoutTests/crypto/crypto-random-values-types-expected.txt [moved from LayoutTests/security/crypto-random-values-types-expected.txt with 100% similarity]
LayoutTests/crypto/crypto-random-values-types.html [moved from LayoutTests/security/crypto-random-values-types.html with 100% similarity]
LayoutTests/crypto/crypto-random-values.html [moved from LayoutTests/security/crypto-random-values.html with 100% similarity]
LayoutTests/crypto/subtle/argument-conversion-expected.txt [moved from LayoutTests/security/crypto-subtle-arguments-expected.txt with 100% similarity]
LayoutTests/crypto/subtle/argument-conversion.html [moved from LayoutTests/security/crypto-subtle-arguments.html with 95% similarity]
LayoutTests/crypto/subtle/gc-2-expected.txt [moved from LayoutTests/security/crypto-subtle-gc-2-expected.txt with 100% similarity]
LayoutTests/crypto/subtle/gc-2.html [moved from LayoutTests/security/crypto-subtle-gc-2.html with 88% similarity]
LayoutTests/crypto/subtle/gc-3-expected.txt [moved from LayoutTests/security/crypto-subtle-gc-3-expected.txt with 100% similarity]
LayoutTests/crypto/subtle/gc-3.html [moved from LayoutTests/security/crypto-subtle-gc-3.html with 87% similarity]
LayoutTests/crypto/subtle/gc-expected.txt [moved from LayoutTests/security/crypto-subtle-gc-expected.txt with 100% similarity]
LayoutTests/crypto/subtle/gc.html [moved from LayoutTests/security/crypto-subtle-gc.html with 82% similarity]
LayoutTests/crypto/subtle/resources/common.js [moved from LayoutTests/security/resources/common.js with 100% similarity]
LayoutTests/crypto/subtle/sha-1-expected.txt [moved from LayoutTests/security/crypto-subtle-sha1-expected.txt with 100% similarity]
LayoutTests/crypto/subtle/sha-1.html [moved from LayoutTests/security/crypto-subtle-sha1.html with 92% similarity]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp
Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp
Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig

index a2739b3..8c37e77 100644 (file)
@@ -1,3 +1,60 @@
+2013-10-31  Alexey Proskuryakov  <ap@apple.com>
+
+        Enable WebCrypto on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=123587
+
+        Reviewed by Anders Carlsson.
+
+        * 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/.
+
 2013-10-31  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Move CSS3 text decoration implementation behind ENABLE(CSS3_TEXT_DECORATION)
index c55fa67..7f8d70d 100644 (file)
@@ -71,12 +71,5 @@ fast/mediastream/MediaStream-clone.html [ Skip ]
 # Skipping it for now, then put it again when the spec decides it
 fast/mediastream/MediaStream-onended.html [ Skip ]
 
-# crypto.subtle is not yet enabled on any ports
-webkit.org/b/122679 security/crypto-subtle-gc.html [ Skip ]
-webkit.org/b/122679 security/crypto-subtle-gc-2.html [ Skip ]
-webkit.org/b/122679 security/crypto-subtle-gc-3.html [ Skip ]
-webkit.org/b/122679 security/crypto-subtle-sha1.html [ Skip ]
-webkit.org/b/122679 security/crypto-subtle-arguments.html [ Skip ]
-
 webkit.org/b/123555 [ Debug ] media/media-fragments/TC0054.html [ Crash ]
 webkit.org/b/123555 [ Debug ] media/media-fragments/TC0061.html [ Crash ]
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src="../resources/js-test-pre.js"></script>
+<script src="../../resources/js-test-pre.js"></script>
 <script src="resources/common.js"></script>
 </head>
 <body>
@@ -60,6 +60,6 @@ Promise.fulfill(null).then(function() {
 
 </script>
 
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
 </body>
 </html>
similarity index 88%
rename from LayoutTests/security/crypto-subtle-gc-2.html
rename to LayoutTests/crypto/subtle/gc-2.html
index d4fe457..9129920 100644 (file)
@@ -2,7 +2,7 @@
 <html>
 <head>
 <meta charset="utf-8">
-<script src="../resources/js-test-pre.js"></script>
+<script src="../../resources/js-test-pre.js"></script>
 </head>
 <body>
 <script>
@@ -41,6 +41,6 @@ window.onload = startTest;
 
 </script>
 <iframe src="about:blank"></iframe>
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
 </body>
 </html>
similarity index 87%
rename from LayoutTests/security/crypto-subtle-gc-3.html
rename to LayoutTests/crypto/subtle/gc-3.html
index 7a791aa..b6e0740 100644 (file)
@@ -2,7 +2,7 @@
 <html>
 <head>
 <meta charset="utf-8">
-<script src="../resources/js-test-pre.js"></script>
+<script src="../../resources/js-test-pre.js"></script>
 </head>
 <body>
 <script>
@@ -38,6 +38,6 @@ window.onload = startTest;
 
 </script>
 <iframe src="about:blank"></iframe>
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
 </body>
 </html>
similarity index 82%
rename from LayoutTests/security/crypto-subtle-gc.html
rename to LayoutTests/crypto/subtle/gc.html
index 601b019..a235b0b 100644 (file)
@@ -2,7 +2,7 @@
 <html>
 <head>
 <meta charset="utf-8">
-<script src="../resources/js-test-pre.js"></script>
+<script src="../../resources/js-test-pre.js"></script>
 </head>
 <body>
 <script>
@@ -33,6 +33,6 @@ function finishTest()
 window.onload = startTest;
 
 </script>
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
 </body>
 </html>
similarity index 92%
rename from LayoutTests/security/crypto-subtle-sha1.html
rename to LayoutTests/crypto/subtle/sha-1.html
index 277ee74..467e66c 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src="../resources/js-test-pre.js"></script>
+<script src="../../resources/js-test-pre.js"></script>
 <script src="resources/common.js"></script>
 </head>
 <body>
@@ -43,6 +43,6 @@ Promise.fulfill(null).then(function() {
 });
 </script>
 
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
 </body>
 </html>
index 6e4b815..707c203 100644 (file)
@@ -1588,3 +1588,6 @@ webkit.org/b/123561 printing/setPrinting.html [ Missing ]
 webkit.org/b/123561 printing/simultaneous-position-float-change.html [ Missing ]
 webkit.org/b/123561 printing/single-line-must-not-be-split-into-two-pages.html [ Missing ]
 webkit.org/b/123561 printing/width-overflow.html [ Missing ]
+
+# crypto.subtle is not yet enabled
+crypto/subtle [ Skip ]
index 9bfcf4d..68e47b1 100644 (file)
@@ -456,6 +456,9 @@ webkit.org/b/107194 http/tests/security/no-indexeddb-from-sandbox.html [ Skip ]
 # Needs to update the gtk databaseQuotaExceeded() test function to handle quota expansion requests.
 storage/websql/open-database-expand-quota.html [ Failure ]
 
+# crypto.subtle is not yet enabled
+crypto/subtle [ Skip ]
+
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of Expected failures
 #////////////////////////////////////////////////////////////////////////////////////////
index 7a999df..ab84804 100644 (file)
@@ -2875,4 +2875,5 @@ printing/print-close-crash.html
 # Test introduced in r157133 fails. State of colorspace management on Windows is unclear.
 media/video-canvas-drawing-output.html
 
-
+# crypto.subtle is not yet enabled
+crypto/subtle [ Skip ]
index 13a5342..f02e4e1 100644 (file)
@@ -2850,3 +2850,6 @@ webkit.org/b/?????? http/tests/loading/promote-img-preload-priority.html [ Failu
 
 # No concept of secure text input
 editing/secure-input [ Failure ]
+
+# crypto.subtle is not yet enabled
+crypto/subtle [ Skip ]
index 65c301c..17cb695 100644 (file)
@@ -1,3 +1,12 @@
+2013-10-31  Alexey Proskuryakov  <ap@apple.com>
+
+        Enable WebCrypto on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=123587
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/FeatureDefines.xcconfig: Do it.
+
 2013-10-31  Filip Pizlo  <fpizlo@apple.com>
 
         Unreviewed, really remove CachedTranscendentalFunction.h.
index d4d86c8..6a5cf51 100644 (file)
@@ -155,7 +155,7 @@ ENABLE_SPEECH_SYNTHESIS = $(ENABLE_SPEECH_SYNTHESIS_$(PLATFORM_NAME));
 ENABLE_SPEECH_SYNTHESIS_macosx = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
 ENABLE_SUBPIXEL_LAYOUT = ;
-ENABLE_SUBTLE_CRYPTO = ;
+ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG = ENABLE_SVG;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
 ENABLE_TEMPLATE_ELEMENT = ;
index b4dc081..f369fe8 100644 (file)
@@ -1,3 +1,20 @@
+2013-10-31  Alexey Proskuryakov  <ap@apple.com>
+
+        Enable WebCrypto on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=123587
+
+        Reviewed by Anders Carlsson.
+
+        * 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.
+
 2013-10-31  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Underline bounds cannot be queried before underline itself is drawn
index 30c89a5..1d2fabf 100644 (file)
@@ -155,7 +155,7 @@ ENABLE_SPEECH_SYNTHESIS = $(ENABLE_SPEECH_SYNTHESIS_$(PLATFORM_NAME));
 ENABLE_SPEECH_SYNTHESIS_macosx = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
 ENABLE_SUBPIXEL_LAYOUT = ;
-ENABLE_SUBTLE_CRYPTO = ;
+ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG = ENABLE_SVG;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
 ENABLE_TEMPLATE_ELEMENT = ;
index 2567cdc..7b9327f 100644 (file)
@@ -29,6 +29,7 @@
 #if ENABLE(SUBTLE_CRYPTO)
 
 #include <runtime/ObjectConstructor.h>
+#include <runtime/Operations.h>
 
 using namespace JSC;
 
index 5fc34df..f734985 100644 (file)
@@ -28,7 +28,6 @@
 
 #if ENABLE(SUBTLE_CRYPTO)
 
-#include "CryptoAlgorithmHMAC.h"
 #include "CryptoAlgorithmHmacKeyParams.h"
 #include "CryptoAlgorithmHmacParams.h"
 #include "CryptoAlgorithmRegistry.h"
@@ -149,7 +148,7 @@ static std::unique_ptr<CryptoAlgorithmParameters> createHmacKeyParams(JSC::ExecS
     return std::move(result);
 }
 
-std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForEncrypt(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
+std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForEncrypt(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
 {
     switch (algorithm) {
     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
@@ -178,7 +177,7 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
     }
 }
 
-std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDecrypt(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
+std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDecrypt(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
 {
     switch (algorithm) {
     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
@@ -303,7 +302,7 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
     }
 }
 
-std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForGenerateKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
+std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForGenerateKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
 {
     switch (algorithm) {
     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
@@ -332,7 +331,7 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
     }
 }
 
-std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDeriveKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
+std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDeriveKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
 {
     switch (algorithm) {
     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
@@ -361,7 +360,7 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
     }
 }
 
-std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDeriveBits(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
+std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForDeriveBits(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
 {
     switch (algorithm) {
     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
@@ -422,7 +421,7 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
     }
 }
 
-std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForExportKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
+std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForExportKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
 {
     switch (algorithm) {
     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
@@ -451,7 +450,7 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
     }
 }
 
-std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForWrapKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
+std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForWrapKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
 {
     switch (algorithm) {
     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
@@ -480,7 +479,7 @@ std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createPa
     }
 }
 
-std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForUnwrapKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier, JSC::JSValue)
+std::unique_ptr<CryptoAlgorithmParameters> JSCryptoAlgorithmDictionary::createParametersForUnwrapKey(JSC::ExecState* exec, CryptoAlgorithmIdentifier algorithm, JSC::JSValue)
 {
     switch (algorithm) {
     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
index 880d902..2934d71 100644 (file)
@@ -47,6 +47,9 @@ CryptoAlgorithmRegistry::CryptoAlgorithmRegistry()
 
 bool CryptoAlgorithmRegistry::getIdentifierForName(const String& name, CryptoAlgorithmIdentifier& result)
 {
+    if (name.isEmpty())
+        return false;
+
     auto iter = m_nameToIdentifierMap.find(name.lower());
     if (iter == m_nameToIdentifierMap.end())
         return false;
index 3eaae6d..db0665b 100644 (file)
@@ -42,7 +42,7 @@ CryptoAlgorithmSHA1::~CryptoAlgorithmSHA1()
 
 std::unique_ptr<CryptoAlgorithm> CryptoAlgorithmSHA1::create()
 {
-    return std::make_unique<CryptoAlgorithmSHA1>();
+    return std::unique_ptr<CryptoAlgorithm>(new CryptoAlgorithmSHA1);
 }
 
 CryptoAlgorithmIdentifier CryptoAlgorithmSHA1::identifier() const
index 280a90a..e516775 100644 (file)
@@ -1,3 +1,12 @@
+2013-10-31  Alexey Proskuryakov  <ap@apple.com>
+
+        Enable WebCrypto on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=123587
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/FeatureDefines.xcconfig: Do it.
+
 2013-10-30  Ryosuke Niwa  <rniwa@webkit.org>
 
         Remove code for Mac Lion
index 30c89a5..1d2fabf 100644 (file)
@@ -155,7 +155,7 @@ ENABLE_SPEECH_SYNTHESIS = $(ENABLE_SPEECH_SYNTHESIS_$(PLATFORM_NAME));
 ENABLE_SPEECH_SYNTHESIS_macosx = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
 ENABLE_SUBPIXEL_LAYOUT = ;
-ENABLE_SUBTLE_CRYPTO = ;
+ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG = ENABLE_SVG;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
 ENABLE_TEMPLATE_ELEMENT = ;
index e419b4a..4f017cb 100644 (file)
@@ -1,3 +1,12 @@
+2013-10-31  Alexey Proskuryakov  <ap@apple.com>
+
+        Enable WebCrypto on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=123587
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/FeatureDefines.xcconfig: Do it.
+
 2013-10-31  Sergio Correia  <sergio.correia@openbossa.org>
 
         [WK2] Convert SeccompFilters to using unique_ptr instead of OwnPtr/PassOwnPtr
index 4c6681c..27ff152 100644 (file)
@@ -155,7 +155,7 @@ ENABLE_SPEECH_SYNTHESIS = $(ENABLE_SPEECH_SYNTHESIS_$(PLATFORM_NAME));
 ENABLE_SPEECH_SYNTHESIS_macosx = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
 ENABLE_SUBPIXEL_LAYOUT = ;
-ENABLE_SUBTLE_CRYPTO = ;
+ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG = ENABLE_SVG;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
 ENABLE_TEMPLATE_ELEMENT = ;