From b1e5251c21e261cd5a02ea785b0617f9d569964e Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sat, 10 Aug 2024 12:28:09 +0200 Subject: [PATCH] test: update expectations for firefox 129 --- tap/cookbook.ts | 4 ++-- tap/env.ts | 6 ------ tap/jwk.ts | 2 +- tap/jws.ts | 2 +- tap/pem.ts | 18 +++--------------- 5 files changed, 7 insertions(+), 25 deletions(-) diff --git a/tap/cookbook.ts b/tap/cookbook.ts index 5dbae7a9c6..4cc2bc79a3 100644 --- a/tap/cookbook.ts +++ b/tap/cookbook.ts @@ -9,7 +9,7 @@ import jweVectors from '../cookbook/jwe.mjs' // https://bugs.webkit.org/show_bug.cgi?id=262499 // https://github.com/web-platform-tests/wpt/pull/42292 -if (env.isWebKitAbove17) { +if (env.isWebKit) { // @ts-ignore const ed25519 = jwsVectors.find((vector) => vector.title.includes('Ed25519')) ed25519.reproducible = false @@ -42,7 +42,7 @@ export default (QUnit: QUnit, lib: typeof jose, keys: typeof jose) => { return !env.isDeno } if (vector.input.alg === 'EdDSA') { - return env.isWebKitAbove17 || !env.isBrowser + return !env.isBlink } return true } diff --git a/tap/env.ts b/tap/env.ts index 606fc5aedf..8cc379096a 100644 --- a/tap/env.ts +++ b/tap/env.ts @@ -33,14 +33,8 @@ async function isEngine(engine: string) { return userAgentData.engine.name === engine } -async function isVersionAtLeast(version: number) { - const userAgentData = await parseUserAgent() - return parseInt(userAgentData.browser.version.split('.')[0], 10) >= version -} - export const isBlink = isBrowser && (await isEngine('Blink')) export const isWebKit = isBrowser && (await isEngine('WebKit')) -export const isWebKitAbove17 = isBrowser && isWebKit && (await isVersionAtLeast(17)) export const isGecko = isBrowser && (await isEngine('Gecko')) diff --git a/tap/jwk.ts b/tap/jwk.ts index 87876e2dd8..855e1c958f 100644 --- a/tap/jwk.ts +++ b/tap/jwk.ts @@ -19,7 +19,7 @@ export default (QUnit: QUnit, lib: typeof jose, keys: typeof jose) => { env.isDeno, ], ['ECDH-ES', KEYS.X448.jwk, env.isNode || env.isEdgeRuntime], - ['EdDSA', KEYS.Ed25519.jwk, (env.isWebKit && env.isWebKitAbove17) || !env.isBrowser], + ['EdDSA', KEYS.Ed25519.jwk, !env.isBlink], ['EdDSA', KEYS.Ed448.jwk, env.isNode || env.isEdgeRuntime], ['ES256', KEYS.P256.jwk, true], ['ES256K', KEYS.secp256k1.jwk, lib.cryptoRuntime === 'node:crypto' && !env.isElectron], diff --git a/tap/jws.ts b/tap/jws.ts index a1f4895a52..be49545d68 100644 --- a/tap/jws.ts +++ b/tap/jws.ts @@ -9,7 +9,7 @@ export default (QUnit: QUnit, lib: typeof jose, keys: typeof jose) => { type Vector = [string, boolean] | [string, boolean, jose.GenerateKeyPairOptions] const algorithms: Vector[] = [ - ['EdDSA', (env.isWebKit && env.isWebKitAbove17) || !env.isBrowser], + ['EdDSA', !env.isBlink], ['EdDSA', env.isNode || env.isEdgeRuntime, { crv: 'Ed448' }], ['ES256', true], [ diff --git a/tap/pem.ts b/tap/pem.ts index 9d8bbe8622..597d80f05a 100644 --- a/tap/pem.ts +++ b/tap/pem.ts @@ -76,21 +76,9 @@ export default (QUnit: QUnit, lib: typeof jose, keys: typeof jose) => { ], [['ECDH-ES', 'X448'], KEYS.X448.pkcs8, env.isNode || env.isEdgeRuntime], [['ECDH-ES', 'X448'], KEYS.X448.spki, env.isNode || env.isEdgeRuntime], - [ - ['EdDSA', 'Ed25519'], - KEYS.Ed25519.pkcs8, - (env.isWebKit && env.isWebKitAbove17) || !env.isBrowser, - ], - [ - ['EdDSA', 'Ed25519'], - KEYS.Ed25519.spki, - (env.isWebKit && env.isWebKitAbove17) || !env.isBrowser, - ], - [ - ['EdDSA', 'Ed25519'], - KEYS.Ed25519.x509, - (env.isWebKit && env.isWebKitAbove17) || !env.isBrowser, - ], + [['EdDSA', 'Ed25519'], KEYS.Ed25519.pkcs8, !env.isBlink], + [['EdDSA', 'Ed25519'], KEYS.Ed25519.spki, !env.isBlink], + [['EdDSA', 'Ed25519'], KEYS.Ed25519.x509, !env.isBlink], [['EdDSA', 'Ed448'], KEYS.Ed448.pkcs8, env.isNode || env.isEdgeRuntime], [['EdDSA', 'Ed448'], KEYS.Ed448.spki, env.isNode || env.isEdgeRuntime], [['EdDSA', 'Ed448'], KEYS.Ed448.x509, env.isNode || env.isEdgeRuntime],