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

Unified Diff: LayoutTests/crypto/sign-verify.html

Issue 24467004: [webcrypto] Remove MockWebCrypto. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove some unused params Created 7 years, 3 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
Index: LayoutTests/crypto/sign-verify.html
diff --git a/LayoutTests/crypto/sign-verify.html b/LayoutTests/crypto/sign-verify.html
index 8a3c54622af17eb759627f87c9dcb14ab2ce32e9..37aa54102a1ebb6d4274d5c5e527f3c30e13d178 100644
--- a/LayoutTests/crypto/sign-verify.html
+++ b/LayoutTests/crypto/sign-verify.html
@@ -47,38 +47,37 @@ importTestKeys().then(function(importedKeys) {
// ---------------------------------------------------
// RSASSA-PKCS1-v1_5 normalization failures (RsaSsaParams)
// ---------------------------------------------------
+ // TODO(eroman): Re-enable once can import RSA keys.
+ /*
shouldThrow("crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5'}, keys.rsaSsaSha1, data)");
shouldThrow("crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: 3}, keys.rsaSsaSha1, data)");
shouldThrow("crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: null}, keys.rsaSsaSha1, data)");
shouldThrow("crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: {}}, keys.rsaSsaSha1, data)");
shouldThrow("crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: {name: 'foo'}}, keys.rsaSsaSha1, data)");
shouldThrow("crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: {name: 'AES-CBC'}}, keys.rsaSsaSha1, data)");
+ */
return crypto.subtle.sign(hmacSha1, keys.hmacSha1, data);
}).then(function(result) {
- signResult = result;
- shouldBe("signResult.byteLength", "17");
-
- expectedSignature = asciiToArrayBuffer("signed HMAC:hello");
- return crypto.subtle.verify(hmacSha1, keys.hmacSha1, expectedSignature, data);
-}).then(function(result) {
- verifyResult = result;
- shouldBe("verifyResult", "true");
+ signResult = arrayBufferToHexString(result);
+ shouldBe("signResult", "'[89 0d 9b 89 4b 23 97 69 ac 77 25 04 66 dc e4 2a f9 26 ed 76]'");
return crypto.subtle.verify(hmacSha1, keys.hmacSha1, asciiToArrayBuffer("badsignature"), data);
}).then(function(result) {
verifyResult = result;
shouldBe("verifyResult", "false");
+/*
+ TODO(eroman): generateKey() not implemented.
+
return crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-1' }, length: 48}, false, ['sign']);
}).then(function(result) {
generatedHmacSha1Key = result;
- // Cannot use an HMAC SHA-1 key for signing HMAC SHA-256
- shouldThrow("crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, generatedHmacSha1Key, data)");
// However it can be used to sign for HMAC SHA-1
shouldNotThrow("crypto.subtle.sign(hmacSha1, generatedHmacSha1Key, data)");
+*/
}).then(finishJSTest, failAndFinishJSTest);
</script>

Powered by Google App Engine
This is Rietveld 408576698