-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Set algorithm length for HMAC key generation
This assignment was missing from the spec, but has been fixed since w3c/webcrypto#394. Also add relevant WPT tests.
- Loading branch information
1 parent
ac0036d
commit f5d3d6a
Showing
4 changed files
with
230 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
198 changes: 198 additions & 0 deletions
198
Tests/LibWeb/Text/expected/wpt-import/WebCryptoAPI/generateKey/successes_HMAC.https.any.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
Harness status: OK | ||
|
||
Found 192 tests | ||
|
||
96 Pass | ||
96 Fail | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: HMAC}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: HMAC}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: HMAC}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: HMAC}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: HMAC}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: HMAC}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: HMAC}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: HMAC}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: HMAC}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: HMAC}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: HMAC}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: HMAC}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: HMAC}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: HMAC}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: HMAC}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: HMAC}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: HMAC}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: HMAC}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: HMAC}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: HMAC}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: HMAC}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: HMAC}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: HMAC}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: HMAC}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: HMAC}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: HMAC}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: HMAC}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: HMAC}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: HMAC}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: HMAC}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: HMAC}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: HMAC}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: HMAC}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: HMAC}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: HMAC}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: HMAC}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: HMAC}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: HMAC}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: HMAC}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: HMAC}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: HMAC}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: HMAC}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: HMAC}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: HMAC}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: HMAC}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: HMAC}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: HMAC}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: HMAC}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: HMAC}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: HMAC}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: HMAC}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: HMAC}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: HMAC}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: HMAC}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: HMAC}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: HMAC}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: HMAC}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: HMAC}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: HMAC}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: HMAC}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: HMAC}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: HMAC}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: HMAC}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: HMAC}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: hmac}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: hmac}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: hmac}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: hmac}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: hmac}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: hmac}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: hmac}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: hmac}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: hmac}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: hmac}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: hmac}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: hmac}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: hmac}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: hmac}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: hmac}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: hmac}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: hmac}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: hmac}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: hmac}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: hmac}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: hmac}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: hmac}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: hmac}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: hmac}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: hmac}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: hmac}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: hmac}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: hmac}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: hmac}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: hmac}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: hmac}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: hmac}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: hmac}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: hmac}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: hmac}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: hmac}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: hmac}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: hmac}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: hmac}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: hmac}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: hmac}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: hmac}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: hmac}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: hmac}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: hmac}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: hmac}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: hmac}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: hmac}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: hmac}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: hmac}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: hmac}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: hmac}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: hmac}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: hmac}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: hmac}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: hmac}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: hmac}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: hmac}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: hmac}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: hmac}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: hmac}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: hmac}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: hmac}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: hmac}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: Hmac}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: Hmac}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: Hmac}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: Hmac}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: Hmac}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: Hmac}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: Hmac}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-1, length: 160, name: Hmac}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: Hmac}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: Hmac}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: Hmac}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: Hmac}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: Hmac}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: Hmac}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: Hmac}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-256, length: 256, name: Hmac}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: Hmac}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: Hmac}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: Hmac}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: Hmac}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: Hmac}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: Hmac}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: Hmac}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-384, length: 384, name: Hmac}, true, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: Hmac}, false, [sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: Hmac}, true, [sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: Hmac}, false, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: Hmac}, true, [verify, sign]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: Hmac}, false, [verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: Hmac}, true, [verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: Hmac}, false, [sign, verify, sign, verify]) | ||
Pass Success: generateKey({hash: SHA-512, length: 512, name: Hmac}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: Hmac}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: Hmac}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: Hmac}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: Hmac}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-1, name: Hmac}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: Hmac}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: Hmac}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-1, name: Hmac}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: Hmac}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: Hmac}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: Hmac}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: Hmac}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-256, name: Hmac}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: Hmac}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: Hmac}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-256, name: Hmac}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: Hmac}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: Hmac}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: Hmac}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: Hmac}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-384, name: Hmac}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: Hmac}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: Hmac}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-384, name: Hmac}, true, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: Hmac}, false, [sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: Hmac}, true, [sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: Hmac}, false, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: Hmac}, true, [verify, sign]) | ||
Fail Success: generateKey({hash: SHA-512, name: Hmac}, false, [verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: Hmac}, true, [verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: Hmac}, false, [sign, verify, sign, verify]) | ||
Fail Success: generateKey({hash: SHA-512, name: Hmac}, true, [sign, verify, sign, verify]) |
18 changes: 18 additions & 0 deletions
18
Tests/LibWeb/Text/input/wpt-import/WebCryptoAPI/generateKey/successes_HMAC.https.any.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!doctype html> | ||
<meta charset=utf-8> | ||
<title>WebCryptoAPI: generateKey() Successful Calls</title> | ||
<meta name="timeout" content="long"> | ||
<script> | ||
self.GLOBAL = { | ||
isWindow: function() { return true; }, | ||
isWorker: function() { return false; }, | ||
isShadowRealm: function() { return false; }, | ||
}; | ||
</script> | ||
<script src="../../resources/testharness.js"></script> | ||
<script src="../../resources/testharnessreport.js"></script> | ||
<script src="../util/helpers.js"></script> | ||
<script src="../../common/subset-tests.js"></script> | ||
<script src="successes.js"></script> | ||
<div id=log></div> | ||
<script src="../../WebCryptoAPI/generateKey/successes_HMAC.https.any.js"></script> |
6 changes: 6 additions & 0 deletions
6
Tests/LibWeb/Text/input/wpt-import/WebCryptoAPI/generateKey/successes_HMAC.https.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// META: title=WebCryptoAPI: generateKey() Successful Calls | ||
// META: timeout=long | ||
// META: script=../util/helpers.js | ||
// META: script=/common/subset-tests.js | ||
// META: script=successes.js | ||
run_test(["HMAC"]); |