Commit 5aec375d authored by ap@apple.com's avatar ap@apple.com

Source/WebCore: Replace uses of WTF::BitArray with std::bitset

https://bugs.webkit.org/show_bug.cgi?id=125642

Patch by Sam Weinig <sam@webkit.org> on 2013-12-12
Reviewed by Anders Carlsson.

* css/CSSParser.cpp:
(WebCore::filterProperties):
(WebCore::CSSParser::createStyleProperties):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::asText):

LayoutTests: Public key in a generated KeyPair should always be extractable
https://bugs.webkit.org/show_bug.cgi?id=125643

Reviewed by Sam Weinig.

* crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt: Added.
* crypto/subtle/rsa-oaep-generate-non-extractable-key.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3e5d6e13
2013-12-12 Alexey Proskuryakov <ap@apple.com>
Public key in a generated KeyPair should always be extractable
https://bugs.webkit.org/show_bug.cgi?id=125643
Reviewed by Sam Weinig.
* crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt: Added.
* crypto/subtle/rsa-oaep-generate-non-extractable-key.html: Added.
2013-12-12 Alexey Proskuryakov <ap@apple.com>
Make algorithm.name return registered name, not normalized one
Test that even when non-extractability is requested, the public key is still extractable.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Generating a key pair...
PASS keyPair.toString() is '[object KeyPair]'
PASS keyPair.publicKey.type is 'public'
PASS keyPair.publicKey.extractable is true
PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
PASS keyPair.publicKey.algorithm.modulusLength is 2048
PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
PASS keyPair.publicKey.algorithm.hash is undefined.
PASS keyPair.privateKey.type is 'private'
PASS keyPair.privateKey.extractable is false
PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
PASS keyPair.privateKey.algorithm.modulusLength is 2048
PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
PASS keyPair.privateKey.algorithm.hash is undefined.
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="resources/common.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Test that even when non-extractability is requested, the public key is still extractable.");
jsTestIsAsync = true;
var algorithmKeyGen = {
name: "RSA-OAEP",
// RsaKeyGenParams
modulusLength: 2048,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
};
var nonExtractable = false;
debug("Generating a key pair...");
crypto.subtle.generateKey(algorithmKeyGen, nonExtractable, []).then(function(result) {
keyPair = result;
shouldBe("keyPair.toString()", "'[object KeyPair]'");
shouldBe("keyPair.publicKey.type", "'public'");
shouldBe("keyPair.publicKey.extractable", "true");
shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
shouldBeUndefined("keyPair.publicKey.algorithm.hash");
shouldBe("keyPair.privateKey.type", "'private'");
shouldBe("keyPair.privateKey.extractable", "false");
shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
shouldBeUndefined("keyPair.privateKey.algorithm.hash");
finishJSTest();
});
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
......@@ -11,6 +11,20 @@
* css/StyleProperties.cpp:
(WebCore::StyleProperties::asText):
2013-12-12 Alexey Proskuryakov <ap@apple.com>
Public key in a generated KeyPair should always be extractable
https://bugs.webkit.org/show_bug.cgi?id=125643
Reviewed by Sam Weinig.
The spec doesn't explain how generateKey works with key pairs (there are open bugs
about that). Making public keys non-extractable makes no sense one way or another.
Test: crypto/subtle/rsa-oaep-generate-non-extractable-key.html
* crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::generatePair):
2013-12-12 Alexey Proskuryakov <ap@apple.com>
Make algorithm.name return registered name, not normalized one
......@@ -267,7 +267,7 @@ void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, unsigned mo
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
RefPtr<CryptoKeyRSA> publicKey = CryptoKeyRSA::create(algorithm, CryptoKeyType::Public, ccPublicKey, extractable, usage);
RefPtr<CryptoKeyRSA> publicKey = CryptoKeyRSA::create(algorithm, CryptoKeyType::Public, ccPublicKey, true, usage);
RefPtr<CryptoKeyRSA> privateKey = CryptoKeyRSA::create(algorithm, CryptoKeyType::Private, ccPrivateKey, extractable, usage);
(*localCallback)(*CryptoKeyPair::create(publicKey.release(), privateKey.release()));
delete localCallback;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment