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

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

Issue 24467004: [webcrypto] Remove MockWebCrypto. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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
« no previous file with comments | « LayoutTests/crypto/resources/common.js ('k') | LayoutTests/crypto/sign-verify-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/sign-verify.html
diff --git a/LayoutTests/crypto/sign-verify.html b/LayoutTests/crypto/sign-verify.html
index 8a3c54622af17eb759627f87c9dcb14ab2ce32e9..03add1c251d4bab813e951b2d6c9277f3a713a51 100644
--- a/LayoutTests/crypto/sign-verify.html
+++ b/LayoutTests/crypto/sign-verify.html
@@ -44,41 +44,15 @@ importTestKeys().then(function(importedKeys) {
shouldThrow("crypto.subtle.sign({name: 'hmac', hash: {name: 'foo'}}, keys.hmacSha1, data)");
shouldThrow("crypto.subtle.sign({name: 'hmac', hash: {name: 'AES-CBC'}}, keys.hmacSha1, data)");
- // ---------------------------------------------------
- // RSASSA-PKCS1-v1_5 normalization failures (RsaSsaParams)
- // ---------------------------------------------------
- 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");
-
- 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>
« no previous file with comments | « LayoutTests/crypto/resources/common.js ('k') | LayoutTests/crypto/sign-verify-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698