fix: build hashes and recovery-phrase entropy come from ethers (closes #758)
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:
1 parent
6d158bf1b1
commit
ded29b3a9c
5 files changed
+27
-18
No files matched your search
@@ -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,
|
||||
};
|
||||
Reference in new issue
Block a user