Fix EAB cal

This commit is contained in:
Fang-Pen Lin
2025-11-07 09:20:13 -08:00
parent e7f098e63e
commit 72717cdc58
@@ -352,11 +352,8 @@ export const pkiAcmeServiceFactory = ({
// Make sure the JWK in the EAB payload matches the one provided in the outer JWS payload // Make sure the JWK in the EAB payload matches the one provided in the outer JWS payload
const decoder = new TextDecoder(); const decoder = new TextDecoder();
const decodedEabPayload = decoder.decode(eabPayload); const decodedEabPayload = decoder.decode(eabPayload);
const eabPayloadJson = JSON.parse(decodedEabPayload); const eabJWK = JSON.parse(decodedEabPayload);
const eabPayloadJwkThumbprint = await calculateJwkThumbprint( const eabPayloadJwkThumbprint = await calculateJwkThumbprint(eabJWK, "sha256");
eabPayloadJson.jwk as JsonWebKey,
alg as "sha256" | "sha384" | "sha512"
);
if (eabPayloadJwkThumbprint !== publicKeyThumbprint || eabAlg !== alg) { if (eabPayloadJwkThumbprint !== publicKeyThumbprint || eabAlg !== alg) {
throw new AcmeBadPublicKeyError({ throw new AcmeBadPublicKeyError({
message: "External account binding public key thumbprint or algorithm mismatch" message: "External account binding public key thumbprint or algorithm mismatch"