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
@@ -17,6 +17,7 @@ const {
|
||||
checkSelfContained,
|
||||
htmlReferences,
|
||||
manifestReferences,
|
||||
sha256,
|
||||
} = require("../script/lib/package");
|
||||
const { readZip, writeZip } = require("../script/lib/zip");
|
||||
|
||||
@@ -142,6 +143,14 @@ describe("archive self-containment", () => {
|
||||
});
|
||||
});
|
||||
|
||||
// release/SHA256SUMS is checked with `sha256sum -c`, which needs the digest
|
||||
// as bare lowercase hex. The expected value is the FIPS 180-2 digest of "abc".
|
||||
test("sha256 prints the digest as sha256sum does", () => {
|
||||
expect(sha256(Buffer.from("abc"))).toBe(
|
||||
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
|
||||
);
|
||||
});
|
||||
|
||||
describe("the zip container", () => {
|
||||
const files = [
|
||||
{ name: "manifest.json", data: Buffer.from('{"a":1}') },
|
||||
|
||||
Reference in new issue
Block a user