Skip to content

Commit c607004

Browse files
nodejs-github-bottargos
authored andcommitted
test: update WPT for WebCryptoAPI to ab08796857
PR-URL: #59129 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 15d8cc9 commit c607004

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

test/fixtures/wpt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Last update:
3434
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi
3535
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
3636
- web-locks: https://github.com/web-platform-tests/wpt/tree/10a122a6bc/web-locks
37-
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/19d82c57ab/WebCryptoAPI
37+
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/ab08796857/WebCryptoAPI
3838
- webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/2f96fa1996/webidl/ecmascript-binding/es-exceptions
3939
- webmessaging/broadcastchannel: https://github.com/web-platform-tests/wpt/tree/6495c91853/webmessaging/broadcastchannel
4040
- webstorage: https://github.com/web-platform-tests/wpt/tree/1291340aaa/webstorage

test/fixtures/wpt/WebCryptoAPI/generateKey/successes.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function run_test(algorithmNames, slowTest) {
7575
})
7676
.then(async function (result) {
7777
if (resultType === "CryptoKeyPair") {
78-
await Promise.all([
78+
const [jwkPub,,, jwkPriv] = await Promise.all([
7979
subtle.exportKey('jwk', result.publicKey),
8080
subtle.exportKey('spki', result.publicKey),
8181
result.publicKey.algorithm.name.startsWith('RSA') ? undefined : subtle.exportKey('raw', result.publicKey),
@@ -84,6 +84,15 @@ function run_test(algorithmNames, slowTest) {
8484
subtle.exportKey('pkcs8', result.privateKey),
8585
] : [])
8686
]);
87+
88+
if (extractable) {
89+
// Test that the JWK public key is a superset of the JWK private key.
90+
for (const [prop, value] of Object.entries(jwkPub)) {
91+
if (prop !== 'key_ops') {
92+
assert_equals(value, jwkPriv[prop], `Property ${prop} is equal in public and private JWK`);
93+
}
94+
}
95+
}
8796
} else {
8897
if (extractable) {
8998
await Promise.all([

test/fixtures/wpt/WebCryptoAPI/import_export/ec_importKey_failures_fixtures.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ function getMismatchedJWKKeyData(algorithm) {
2020
}
2121

2222
function getMismatchedKtyField(algorithm) {
23-
return mismatchedKtyField[algorithm.name];
23+
return mismatchedKtyField[algorithm.namedCurve];
2424
}
2525

2626
function getMismatchedCrvField(algorithm) {
27-
return mismatchedCrvField[algorithm.name];
27+
return mismatchedCrvField[algorithm.namedCurve];
2828
}
2929

3030
var validKeyData = {

test/fixtures/wpt/WebCryptoAPI/import_export/importKey_failures.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function run_test(algorithmNames) {
243243
allAlgorithmSpecifiersFor(name).forEach(function(algorithm) {
244244
getValidKeyData(algorithm).forEach(function(test) {
245245
if (test.format === "jwk") {
246-
var data = {crv: test.data.crv, kty: test.data.kty, d: test.data.d, x: test.data.x, d: test.data.d};
246+
var data = {crv: test.data.crv, kty: test.data.kty, d: test.data.d, x: test.data.x, y: test.data.y};
247247
data.use = "invalid";
248248
var usages = validUsages(vector, 'jwk', test.data);
249249
if (usages.length !== 0)

test/fixtures/wpt/versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"path": "web-locks"
9797
},
9898
"WebCryptoAPI": {
99-
"commit": "19d82c57abc7494bdc459a338c5dcfd79e818b4a",
99+
"commit": "ab08796857072c5a93e27e0a25effba2e07dad11",
100100
"path": "WebCryptoAPI"
101101
},
102102
"webidl/ecmascript-binding/es-exceptions": {

0 commit comments

Comments
 (0)