Skip to content

Commit

Permalink
test: update expectations for firefox 129
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Aug 14, 2024
1 parent e8cf88a commit c7dec2f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 25 deletions.
4 changes: 2 additions & 2 deletions tap/cookbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 0 additions & 6 deletions tap/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
2 changes: 1 addition & 1 deletion tap/jwk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion tap/jws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
[
Expand Down
18 changes: 3 additions & 15 deletions tap/pem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit c7dec2f

Please sign in to comment.