We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f57c197 commit 935e920Copy full SHA for 935e920
src/jws/flattened/verify.ts
@@ -169,7 +169,12 @@ export async function flattenedVerify(
169
encoder.encode('.'),
170
typeof jws.payload === 'string' ? encoder.encode(jws.payload) : jws.payload,
171
)
172
- const signature = base64url(jws.signature)
+ let signature: Uint8Array
173
+ try {
174
+ signature = base64url(jws.signature)
175
+ } catch {
176
+ throw new JWSInvalid('Failed to parse the base64url encoded signature')
177
+ }
178
const verified = await verify(alg, key, signature, data)
179
180
if (!verified) {
0 commit comments