mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Update web-platform-tests to revision b'fcef086d46a1970a1b45eff5aa41b92bbb9d05b0'
This commit is contained in:
parent
7175a5368a
commit
839a2e5f43
133 changed files with 786 additions and 2345 deletions
|
@ -354,6 +354,18 @@ function run_test() {
|
|||
.catch(function() {done();})
|
||||
}, "setup");
|
||||
|
||||
// Test that generated keys are valid for signing and verifying.
|
||||
testVectors.forEach(function(vector) {
|
||||
var algorithm = {name: vector.algorithmName};
|
||||
promise_test(async() => {
|
||||
let key = await subtle.generateKey(algorithm, false, ["sign", "verify"]);
|
||||
let signature = await subtle.sign(algorithm, key.privateKey, vector.data);
|
||||
let isVerified = await subtle.verify(algorithm, key.publicKey, signature, vector.data);
|
||||
assert_true(isVerified, "Verificaton failed.");
|
||||
}, "Sign and verify using generated " + vector.algorithmName + " keys.");
|
||||
});
|
||||
|
||||
|
||||
// A test vector has all needed fields for signing and verifying, EXCEPT that the
|
||||
// key field may be null. This function replaces that null with the Correct
|
||||
// CryptoKey object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue