jose-browser-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); | ||
} |
@@ -18,5 +18,8 @@ import { encoder, decoder } from '../lib/buffer_utils.js'; | ||
export const decodeBase64 = (encoded) => { | ||
return new Uint8Array(atob(encoded) | ||
.split('') | ||
.map((c) => c.charCodeAt(0))); | ||
const binary = atob(encoded); | ||
const bytes = new Uint8Array(binary.length); | ||
for (let i = 0; i < binary.length; i++) { | ||
bytes[i] = binary.charCodeAt(i); | ||
} | ||
return bytes; | ||
}; | ||
@@ -23,0 +26,0 @@ export const decode = (input) => { |
{ | ||
"name": "jose-browser-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
215698
5663