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/.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a2739b3..8c37e77 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -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)
diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations
index c55fa67..7f8d70d 100644
--- a/LayoutTests/TestExpectations
+++ b/LayoutTests/TestExpectations
@@ -71,12 +71,5 @@
# 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 ]
diff --git a/LayoutTests/security/crypto-gc-expected.txt b/LayoutTests/crypto/crypto-gc-expected.txt
similarity index 100%
rename from LayoutTests/security/crypto-gc-expected.txt
rename to LayoutTests/crypto/crypto-gc-expected.txt
diff --git a/LayoutTests/security/crypto-gc.html b/LayoutTests/crypto/crypto-gc.html
similarity index 100%
rename from LayoutTests/security/crypto-gc.html
rename to LayoutTests/crypto/crypto-gc.html
diff --git a/LayoutTests/security/crypto-random-values-expected.txt b/LayoutTests/crypto/crypto-random-values-expected.txt
similarity index 100%
rename from LayoutTests/security/crypto-random-values-expected.txt
rename to LayoutTests/crypto/crypto-random-values-expected.txt
diff --git a/LayoutTests/security/crypto-random-values-limits-expected.txt b/LayoutTests/crypto/crypto-random-values-limits-expected.txt
similarity index 100%
rename from LayoutTests/security/crypto-random-values-limits-expected.txt
rename to LayoutTests/crypto/crypto-random-values-limits-expected.txt
diff --git a/LayoutTests/security/crypto-random-values-limits.html b/LayoutTests/crypto/crypto-random-values-limits.html
similarity index 100%
rename from LayoutTests/security/crypto-random-values-limits.html
rename to LayoutTests/crypto/crypto-random-values-limits.html
diff --git a/LayoutTests/security/crypto-random-values-types-expected.txt b/LayoutTests/crypto/crypto-random-values-types-expected.txt
similarity index 100%
rename from LayoutTests/security/crypto-random-values-types-expected.txt
rename to LayoutTests/crypto/crypto-random-values-types-expected.txt
diff --git a/LayoutTests/security/crypto-random-values-types.html b/LayoutTests/crypto/crypto-random-values-types.html
similarity index 100%
rename from LayoutTests/security/crypto-random-values-types.html
rename to LayoutTests/crypto/crypto-random-values-types.html
diff --git a/LayoutTests/security/crypto-random-values.html b/LayoutTests/crypto/crypto-random-values.html
similarity index 100%
rename from LayoutTests/security/crypto-random-values.html
rename to LayoutTests/crypto/crypto-random-values.html
diff --git a/LayoutTests/security/crypto-subtle-arguments-expected.txt b/LayoutTests/crypto/subtle/argument-conversion-expected.txt
similarity index 100%
rename from LayoutTests/security/crypto-subtle-arguments-expected.txt
rename to LayoutTests/crypto/subtle/argument-conversion-expected.txt
diff --git a/LayoutTests/security/crypto-subtle-arguments.html b/LayoutTests/crypto/subtle/argument-conversion.html
similarity index 95%
rename from LayoutTests/security/crypto-subtle-arguments.html
rename to LayoutTests/crypto/subtle/argument-conversion.html
index bcfa36d..46a4485 100644
--- a/LayoutTests/security/crypto-subtle-arguments.html
+++ b/LayoutTests/crypto/subtle/argument-conversion.html
@@ -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 @@
</script>
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
</body>
</html>
diff --git a/LayoutTests/security/crypto-subtle-gc-2-expected.txt b/LayoutTests/crypto/subtle/gc-2-expected.txt
similarity index 100%
rename from LayoutTests/security/crypto-subtle-gc-2-expected.txt
rename to LayoutTests/crypto/subtle/gc-2-expected.txt
diff --git a/LayoutTests/security/crypto-subtle-gc-2.html b/LayoutTests/crypto/subtle/gc-2.html
similarity index 87%
rename from LayoutTests/security/crypto-subtle-gc-2.html
rename to LayoutTests/crypto/subtle/gc-2.html
index d4fe457..9129920 100644
--- a/LayoutTests/security/crypto-subtle-gc-2.html
+++ b/LayoutTests/crypto/subtle/gc-2.html
@@ -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 @@
</script>
<iframe src="about:blank"></iframe>
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
</body>
</html>
diff --git a/LayoutTests/security/crypto-subtle-gc-3-expected.txt b/LayoutTests/crypto/subtle/gc-3-expected.txt
similarity index 100%
rename from LayoutTests/security/crypto-subtle-gc-3-expected.txt
rename to LayoutTests/crypto/subtle/gc-3-expected.txt
diff --git a/LayoutTests/security/crypto-subtle-gc-3.html b/LayoutTests/crypto/subtle/gc-3.html
similarity index 86%
rename from LayoutTests/security/crypto-subtle-gc-3.html
rename to LayoutTests/crypto/subtle/gc-3.html
index 7a791aa..b6e0740 100644
--- a/LayoutTests/security/crypto-subtle-gc-3.html
+++ b/LayoutTests/crypto/subtle/gc-3.html
@@ -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 @@
</script>
<iframe src="about:blank"></iframe>
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
</body>
</html>
diff --git a/LayoutTests/security/crypto-subtle-gc-expected.txt b/LayoutTests/crypto/subtle/gc-expected.txt
similarity index 100%
rename from LayoutTests/security/crypto-subtle-gc-expected.txt
rename to LayoutTests/crypto/subtle/gc-expected.txt
diff --git a/LayoutTests/security/crypto-subtle-gc.html b/LayoutTests/crypto/subtle/gc.html
similarity index 82%
rename from LayoutTests/security/crypto-subtle-gc.html
rename to LayoutTests/crypto/subtle/gc.html
index 601b019..a235b0b 100644
--- a/LayoutTests/security/crypto-subtle-gc.html
+++ b/LayoutTests/crypto/subtle/gc.html
@@ -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 @@
window.onload = startTest;
</script>
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
</body>
</html>
diff --git a/LayoutTests/security/resources/common.js b/LayoutTests/crypto/subtle/resources/common.js
similarity index 100%
rename from LayoutTests/security/resources/common.js
rename to LayoutTests/crypto/subtle/resources/common.js
diff --git a/LayoutTests/security/crypto-subtle-sha1-expected.txt b/LayoutTests/crypto/subtle/sha-1-expected.txt
similarity index 100%
rename from LayoutTests/security/crypto-subtle-sha1-expected.txt
rename to LayoutTests/crypto/subtle/sha-1-expected.txt
diff --git a/LayoutTests/security/crypto-subtle-sha1.html b/LayoutTests/crypto/subtle/sha-1.html
similarity index 91%
rename from LayoutTests/security/crypto-subtle-sha1.html
rename to LayoutTests/crypto/subtle/sha-1.html
index 277ee74..467e66c 100644
--- a/LayoutTests/security/crypto-subtle-sha1.html
+++ b/LayoutTests/crypto/subtle/sha-1.html
@@ -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 @@
});
</script>
-<script src="../resources/js-test-post.js"></script>
+<script src="../../resources/js-test-post.js"></script>
</body>
</html>
diff --git a/LayoutTests/platform/efl/TestExpectations b/LayoutTests/platform/efl/TestExpectations
index 6e4b815..707c203 100644
--- a/LayoutTests/platform/efl/TestExpectations
+++ b/LayoutTests/platform/efl/TestExpectations
@@ -1588,3 +1588,6 @@
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 ]
diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations
index 9bfcf4d..68e47b1 100644
--- a/LayoutTests/platform/gtk/TestExpectations
+++ b/LayoutTests/platform/gtk/TestExpectations
@@ -456,6 +456,9 @@
# 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
#////////////////////////////////////////////////////////////////////////////////////////
diff --git a/LayoutTests/platform/win/TestExpectations b/LayoutTests/platform/win/TestExpectations
index 7a999df..ab84804 100644
--- a/LayoutTests/platform/win/TestExpectations
+++ b/LayoutTests/platform/win/TestExpectations
@@ -2875,4 +2875,5 @@
# 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 ]
diff --git a/LayoutTests/platform/wincairo/TestExpectations b/LayoutTests/platform/wincairo/TestExpectations
index 13a5342..f02e4e1 100644
--- a/LayoutTests/platform/wincairo/TestExpectations
+++ b/LayoutTests/platform/wincairo/TestExpectations
@@ -2850,3 +2850,6 @@
# No concept of secure text input
editing/secure-input [ Failure ]
+
+# crypto.subtle is not yet enabled
+crypto/subtle [ Skip ]
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 65c301c..17cb695 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -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.
diff --git a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
index d4d86c8..6a5cf51 100644
--- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
+++ b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
@@ -155,7 +155,7 @@
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 = ;
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index b4dc081..f369fe8 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -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
diff --git a/Source/WebCore/Configurations/FeatureDefines.xcconfig b/Source/WebCore/Configurations/FeatureDefines.xcconfig
index 30c89a5..1d2fabf 100644
--- a/Source/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebCore/Configurations/FeatureDefines.xcconfig
@@ -155,7 +155,7 @@
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 = ;
diff --git a/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp b/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp
index 2567cdc..7b9327f 100644
--- a/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp
+++ b/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp
@@ -29,6 +29,7 @@
#if ENABLE(SUBTLE_CRYPTO)
#include <runtime/ObjectConstructor.h>
+#include <runtime/Operations.h>
using namespace JSC;
diff --git a/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp b/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp
index 5fc34df..f734985 100644
--- a/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp
+++ b/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp
@@ -28,7 +28,6 @@
#if ENABLE(SUBTLE_CRYPTO)
-#include "CryptoAlgorithmHMAC.h"
#include "CryptoAlgorithmHmacKeyParams.h"
#include "CryptoAlgorithmHmacParams.h"
#include "CryptoAlgorithmRegistry.h"
@@ -149,7 +148,7 @@
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::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::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::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::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::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::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::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:
diff --git a/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp b/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
index 880d902..2934d71 100644
--- a/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
+++ b/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
@@ -47,6 +47,9 @@
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;
diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp
index 3eaae6d..db0665b 100644
--- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp
+++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp
@@ -42,7 +42,7 @@
std::unique_ptr<CryptoAlgorithm> CryptoAlgorithmSHA1::create()
{
- return std::make_unique<CryptoAlgorithmSHA1>();
+ return std::unique_ptr<CryptoAlgorithm>(new CryptoAlgorithmSHA1);
}
CryptoAlgorithmIdentifier CryptoAlgorithmSHA1::identifier() const
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 280a90a..e516775 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -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
diff --git a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 30c89a5..1d2fabf 100644
--- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -155,7 +155,7 @@
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 = ;
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index e419b4a..4f017cb 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -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
diff --git a/Source/WebKit2/Configurations/FeatureDefines.xcconfig b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
index 4c6681c..27ff152 100644
--- a/Source/WebKit2/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
@@ -155,7 +155,7 @@
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 = ;