jose-node-esm-runtime
Advanced tools
Comparing version 4.6.0 to 4.6.1
@@ -42,4 +42,5 @@ import { importJWK } from '../key/import.js'; | ||
const { alg, kid } = { ...protectedHeader, ...token.header }; | ||
const kty = getKtyFromAlg(alg); | ||
const candidates = this._jwks.keys.filter((jwk) => { | ||
let candidate = jwk.kty === getKtyFromAlg(alg); | ||
let candidate = kty === jwk.kty; | ||
if (candidate && typeof kid === 'string') { | ||
@@ -46,0 +47,0 @@ candidate = kid === jwk.kid; |
@@ -42,17 +42,11 @@ import digest from '../runtime/digest.js'; | ||
const iterations = Math.ceil((bits >> 3) / 32); | ||
let res; | ||
for (let iter = 1; iter <= iterations; iter++) { | ||
const res = new Uint8Array(iterations * 32); | ||
for (let iter = 0; iter < iterations; iter++) { | ||
const buf = new Uint8Array(4 + secret.length + value.length); | ||
buf.set(uint32be(iter)); | ||
buf.set(uint32be(iter + 1)); | ||
buf.set(secret, 4); | ||
buf.set(value, 4 + secret.length); | ||
if (!res) { | ||
res = await digest('sha256', buf); | ||
} | ||
else { | ||
res = concat(res, await digest('sha256', buf)); | ||
} | ||
res.set(await digest('sha256', buf), iter * 32); | ||
} | ||
res = res.slice(0, bits >> 3); | ||
return res; | ||
return res.slice(0, bits >> 3); | ||
} |
@@ -83,3 +83,4 @@ import { createSecretKey, generateKeyPair as generateKeyPairCb } from 'crypto'; | ||
case 'ECDH-ES+A256KW': | ||
switch (options === null || options === void 0 ? void 0 : options.crv) { | ||
const crv = (_b = options === null || options === void 0 ? void 0 : options.crv) !== null && _b !== void 0 ? _b : 'P-256'; | ||
switch (crv) { | ||
case undefined: | ||
@@ -89,3 +90,3 @@ case 'P-256': | ||
case 'P-521': | ||
return generate('ec', { namedCurve: (_b = options === null || options === void 0 ? void 0 : options.crv) !== null && _b !== void 0 ? _b : 'P-256' }); | ||
return generate('ec', { namedCurve: crv }); | ||
case 'X25519': | ||
@@ -92,0 +93,0 @@ return generate('x25519'); |
{ | ||
"name": "jose-node-esm-runtime", | ||
"version": "4.6.0", | ||
"version": "4.6.1", | ||
"homepage": "https://github.com/panva/jose", | ||
@@ -5,0 +5,0 @@ "repository": "panva/jose", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231057
6134