Bug 1214597 - Ensure that we check the actual result of calling crypto.subtle.verify() in tests r=mt

This commit is contained in:
Tim Taubert 2015-10-14 13:40:14 +02:00
parent 40a1e7a42d
commit 49300702a2
3 changed files with 7 additions and 7 deletions

View File

@ -373,7 +373,7 @@ TestArray.addTest(
.then(setPub)
]).then(doDerive)
.then(doSignAndVerify)
.then(complete(that), error(that));
.then(complete(that, x => x), error(that));
}
);

View File

@ -55,7 +55,7 @@ TestArray.addTest(
"ECDSA JWK import and verify a known-good signature",
function() {
var that = this;
var alg = { name: "ECDSA", namedCurve: "P-256", hash: "SHA-256" };
var alg = { name: "ECDSA", namedCurve: "P-521", hash: "SHA-512" };
function doVerify(x) {
return crypto.subtle.verify(alg, x, tv.ecdsa_verify.sig, tv.ecdsa_verify.data);
@ -63,7 +63,7 @@ TestArray.addTest(
crypto.subtle.importKey("jwk", tv.ecdsa_verify.pub_jwk, alg, true, ["verify"])
.then(doVerify)
.then(complete(that), error(that))
.then(complete(that, x => x), error(that))
}
);
@ -82,7 +82,7 @@ TestArray.addTest(
.then(spki => crypto.subtle.importKey("spki", spki, alg, false, ["verify"]))
]))
.then(sigAndKey => crypto.subtle.verify(alg, sigAndKey[1], sigAndKey[0], msg))
.then(complete(that), error(that))
.then(complete(that, x => x), error(that))
}
);
@ -124,7 +124,7 @@ TestArray.addTest(
crypto.subtle.generateKey(alg, true, ["sign", "verify"])
.then(doSign)
.then(doVerify)
.then(complete(that), error(that))
.then(complete(that, x => x), error(that))
}
);
@ -174,7 +174,7 @@ TestArray.addTest(
crypto.subtle.importKey("raw", tv.ecdsa_verify.raw, alg, true, ["verify"])
.then(doVerify)
.then(complete(that), error(that))
.then(complete(that, x => x), error(that))
}
);

View File

@ -119,7 +119,7 @@ TestArray.addTest(
crypto.subtle.importKey("raw", key, alg, false, ["deriveKey"])
.then( doDerive, fail )
.then( doSignAndVerify, fail )
.then( complete(that), fail );
.then( complete(that, x => x), fail );
}
);