Skip to content

Commit

Permalink
Fix export signature verification
Browse files Browse the repository at this point in the history
  • Loading branch information
r-n-o committed May 9, 2024
1 parent 24041c6 commit 0aba476
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion export/index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,14 @@ <h2>Message log</h2>
if (!TKHQ.verifyEnclaveSignature) {
throw new Error("method not loaded");
}
verified = await TKHQ.verifyEnclaveSignature(bundleObj.enclaveQuorumPublic, bundleObj.dataSignature, bundleObj.data.encappedPublic);

// Temporary solution to get the bytes signed by the enclave
var signedData = /"data":({[^}]+)/.exec(bundle);
if (signedData === null || signedData.length !== 2) {
throw new Error(`unable to find signed data in bundle: ${bundle}`);
}

verified = await TKHQ.verifyEnclaveSignature(bundleObj.enclaveQuorumPublic, bundleObj.dataSignature, signedData + "}");
if (!verified) {
throw new Error(`failed to verify enclave signature: ${bundle}`);
}
Expand Down

0 comments on commit 0aba476

Please sign in to comment.