diff --git a/src/libs/crypto/vc/passkeyDidPeer.ts b/src/libs/crypto/vc/passkeyDidPeer.ts index 37476f51..5f64f490 100644 --- a/src/libs/crypto/vc/passkeyDidPeer.ts +++ b/src/libs/crypto/vc/passkeyDidPeer.ts @@ -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); }