Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Unified Diff: LayoutTests/crypto/rsa-oaep-generate-non-extractable-key.html

Issue 310513004: Import WebKit RSA-OAEP LayoutTests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add another test Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/crypto/rsa-oaep-generate-non-extractable-key-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/rsa-oaep-generate-non-extractable-key.html
diff --git a/LayoutTests/crypto/rsassa-pkcs1-v1_5-generate-key.html b/LayoutTests/crypto/rsa-oaep-generate-non-extractable-key.html
similarity index 57%
copy from LayoutTests/crypto/rsassa-pkcs1-v1_5-generate-key.html
copy to LayoutTests/crypto/rsa-oaep-generate-non-extractable-key.html
index 648bdde8be234ea1b926813768fc7faea0024427..493d4acb785145cbe330852d900418ced18f1b39 100644
--- a/LayoutTests/crypto/rsassa-pkcs1-v1_5-generate-key.html
+++ b/LayoutTests/crypto/rsa-oaep-generate-non-extractable-key.html
@@ -9,47 +9,36 @@
<div id="console"></div>
<script>
-description("Test generating an RSA key pair for RSASSA-PKCS1-v1_5.");
+description("Test that even when non-extractability is requested, the public key is still extractable.");
jsTestIsAsync = true;
var algorithmKeyGen = {
- name: "RSASSA-PKCS1-v1_5",
+ name: "RSA-OAEP",
hash: {name: "sha-256"},
// RsaKeyGenParams
modulusLength: 2048,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
};
-var extractable = true;
+var nonExtractable = false;
debug("Generating a key pair...");
-crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
+crypto.subtle.generateKey(algorithmKeyGen, nonExtractable, []).then(function(result) {
keyPair = result;
shouldBe("keyPair.toString()", "'[object KeyPair]'");
shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-256'");
+ 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'");
- shouldBe("keyPair.publicKey.usages", '["verify"]');
+ shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-256'");
shouldBe("keyPair.privateKey.type", "'private'");
- shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-256'");
+ 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'");
- shouldBe("keyPair.privateKey.usages", '["sign"]');
-
- debug("\nTesting that custom attributes on keys survive garbage collection...");
- keyPair.publicKey.foo = "bar";
- gc();
- setTimeout(function() {
- gc();
- setTimeout(function() {
- shouldBe("keyPair.publicKey.foo", "'bar'");
- finishJSTest();
- }, 0);
- }, 0);
-}).catch(failAndFinishJSTest);
+ shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-256'");
+}).then(finishJSTest, failAndFinishJSTest);
</script>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/crypto/rsa-oaep-generate-non-extractable-key-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698