fix: build hashes and recovery-phrase entropy come from ethers (closes #758)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run

build.js and script/lib/package.js hash with sha256 from ethers, with the
0x prefix stripped so the build receipt and SHA256SUMS keep bare lowercase
hex. generateMnemonic() takes its 16 bytes of entropy from randomBytes in
ethers. The README Crypto policy no longer lists these as exceptions.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-10 22:50:04 +00:00
1 parent 6d158bf1b1
commit edef504146
5 files changed
+31 -20

No files matched your search

+9 -3
View File
@@ -25,9 +25,9 @@
"use strict";
const crypto = require("crypto");
const fs = require("fs");
const path = require("path");
const ethers = require("ethers");
const { readZip, writeZip } = require("./zip");
const { resolveVersion } = require("./version");
@@ -60,8 +60,9 @@ function fail(message) {
throw new Error(message);
}
// Lowercase hex without the 0x prefix ethers adds, as sha256sum prints it.
function sha256(buf) {
return crypto.createHash("sha256").update(buf).digest("hex");
return ethers.sha256(buf).slice(2);
}
// Every regular file under dir, as archive-root-relative forward-slashed
@@ -291,4 +292,9 @@ if (require.main === module) {
}
}
module.exports = { checkSelfContained, htmlReferences, manifestReferences };
module.exports = {
checkSelfContained,
htmlReferences,
manifestReferences,
sha256,
};