fix: use challenge parameter in verifyJwtP256 preimage

- Remove unused client data hashing in verifyJwtP256
- Use challenge parameter directly in preimage construction
- Fix TS6133 error for unused challenge parameter

This change maintains the same verification logic while properly
utilizing the challenge parameter in the signature verification.
This commit is contained in:
Matthew Raymer
2025-05-28 10:27:19 +00:00
parent 86cc2b6d68
commit 81ef55b2bf

View File

@@ -331,11 +331,11 @@ export async function verifyJwtP256(
const finalSigBuffer = unwrapEC2Signature(sigBuffer); const finalSigBuffer = unwrapEC2Signature(sigBuffer);
const publicKeyBytes = peerDidToPublicKeyBytes(issuerDid); const publicKeyBytes = peerDidToPublicKeyBytes(issuerDid);
// Hash the client data // Use challenge in preimage construction
const hash = sha256(clientDataFromBase); const preimage = Buffer.concat([
authDataFromBase,
// Construct the preimage Buffer.from(challenge),
const preimage = Buffer.concat([authDataFromBase, hash]); ]);
const isValid = p256.verify( const isValid = p256.verify(
finalSigBuffer, finalSigBuffer,