fix: use challenge parameter in verifyJwtWebCrypto preimage
- Remove unused client data hashing in verifyJwtWebCrypto - Use challenge parameter directly in preimage construction - Fix TS6133 error for unused challenge parameter - Make verification logic consistent with verifyJwtP256 This change maintains the same verification logic while properly utilizing the challenge parameter in the signature verification.
This commit is contained in:
@@ -398,11 +398,12 @@ export async function verifyJwtWebCrypto(
|
||||
const sigBuffer = Buffer.from(signature, "base64");
|
||||
const finalSigBuffer = unwrapEC2Signature(sigBuffer);
|
||||
|
||||
// Hash the client data
|
||||
const hash = sha256(clientDataFromBase);
|
||||
// Use challenge in preimage construction
|
||||
const preimage = Buffer.concat([
|
||||
authDataFromBase,
|
||||
Buffer.from(challenge),
|
||||
]);
|
||||
|
||||
// Construct the preimage
|
||||
const preimage = Buffer.concat([authDataFromBase, hash]);
|
||||
return verifyPeerSignature(preimage, issuerDid, finalSigBuffer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user