Three places use cryptography outside ethers and libsodium-wrappers-sumo:
build.js hashes the files it writes for the build receipt with Node's crypto.createHash("sha256");
script/lib/package.js hashes the release files for SHA256SUMS the same way;
generateMnemonic() in src/shared/wallet.js takes the entropy for a new recovery phrase from globalThis.crypto.getRandomValues().
The rule: RULES.md Cryptography, "All crypto goes through ethers or libsodium-wrappers-sumo" and "No exceptions without an explicit code comment citing the Crypto Policy". sneak's Crypto Policy in README.md: "All cryptographic operations must go through ethers or libsodium-wrappers-sumo. Exceptions require explicit authorization in a code comment referencing this policy, but as of now there are none."
build.js and script/lib/package.js: hash with sha256 from ethers. The output stays lowercase hex without the 0x prefix, so the receipt and SHA256SUMS keep their format. Drop the crypto require where nothing else uses it.
generateMnemonic(): entropy from randomBytes(16) from ethers. The DEBUG branch and its comment stay as they are.
No exception comments: nothing is left that needs one.
Definition of done
grep finds no createHash, getRandomValues or require("crypto") in build.js, script/ or src/.
make build, make package and their checks give the same receipt and SHA256SUMS format; existing tests stay green. Add a test only where none covers a changed line (for example, SHA256SUMS lines match sha256sum output for a fixture file).
make check green. Gate runs: flock -w 3600 /srv/code/tmp/.autistmask-gate.lock script/cibuild.
Model: opus-5-5
Three places use cryptography outside `ethers` and `libsodium-wrappers-sumo`:
- `build.js` hashes the files it writes for the build receipt with Node's `crypto.createHash("sha256")`;
- `script/lib/package.js` hashes the release files for `SHA256SUMS` the same way;
- `generateMnemonic()` in `src/shared/wallet.js` takes the entropy for a new recovery phrase from `globalThis.crypto.getRandomValues()`.
The rule: `RULES.md` Cryptography, "All crypto goes through `ethers` or `libsodium-wrappers-sumo`" and "No exceptions without an explicit code comment citing the Crypto Policy". sneak's Crypto Policy in `README.md`: "All cryptographic operations must go through `ethers` or `libsodium-wrappers-sumo`. Exceptions require explicit authorization in a code comment referencing this policy, but as of now there are none."
Found in the `RULES.md` read on https://git.eeqj.de/sneak/AutistMask/issues/672#issuecomment-160312.
## Fix
- `build.js` and `script/lib/package.js`: hash with `sha256` from `ethers`. The output stays lowercase hex without the `0x` prefix, so the receipt and `SHA256SUMS` keep their format. Drop the `crypto` require where nothing else uses it.
- `generateMnemonic()`: entropy from `randomBytes(16)` from `ethers`. The DEBUG branch and its comment stay as they are.
- No exception comments: nothing is left that needs one.
## Definition of done
- `grep` finds no `createHash`, `getRandomValues` or `require("crypto")` in `build.js`, `script/` or `src/`.
- `make build`, `make package` and their checks give the same receipt and `SHA256SUMS` format; existing tests stay green. Add a test only where none covers a changed line (for example, `SHA256SUMS` lines match `sha256sum` output for a fixture file).
- `make check` green. Gate runs: `flock -w 3600 /srv/code/tmp/.autistmask-gate.lock script/cibuild`.
Model: opus-5-5
clawbot
self-assigned this 2026-11-10 20:54:18 +01:00
clawbot
added this to the 1.0.0 milestone 2026-11-10 20:54:24 +01:00
Fixed in #767. build.js and script/lib/package.js now hash with sha256 from ethers, and generateMnemonic() uses randomBytes from ethers. The README Crypto policy no longer lists them as exceptions. A test now covers the SHA256SUMS hash.
The first gate run failed once because jest force-stopped a worker that a test had left an open handle in. That is unrelated to this change and is filed as #766.
Model: opus-5-5
Fixed in https://git.eeqj.de/sneak/AutistMask/pulls/767. `build.js` and `script/lib/package.js` now hash with `sha256` from `ethers`, and `generateMnemonic()` uses `randomBytes` from `ethers`. The README Crypto policy no longer lists them as exceptions. A test now covers the `SHA256SUMS` hash.
The first gate run failed once because jest force-stopped a worker that a test had left an open handle in. That is unrelated to this change and is filed as https://git.eeqj.de/sneak/AutistMask/issues/766.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Three places use cryptography outside
ethersandlibsodium-wrappers-sumo:build.jshashes the files it writes for the build receipt with Node'scrypto.createHash("sha256");script/lib/package.jshashes the release files forSHA256SUMSthe same way;generateMnemonic()insrc/shared/wallet.jstakes the entropy for a new recovery phrase fromglobalThis.crypto.getRandomValues().The rule:
RULES.mdCryptography, "All crypto goes throughethersorlibsodium-wrappers-sumo" and "No exceptions without an explicit code comment citing the Crypto Policy". sneak's Crypto Policy inREADME.md: "All cryptographic operations must go throughethersorlibsodium-wrappers-sumo. Exceptions require explicit authorization in a code comment referencing this policy, but as of now there are none."Found in the
RULES.mdread on #672 (comment).Fix
build.jsandscript/lib/package.js: hash withsha256fromethers. The output stays lowercase hex without the0xprefix, so the receipt andSHA256SUMSkeep their format. Drop thecryptorequire where nothing else uses it.generateMnemonic(): entropy fromrandomBytes(16)fromethers. The DEBUG branch and its comment stay as they are.Definition of done
grepfinds nocreateHash,getRandomValuesorrequire("crypto")inbuild.js,script/orsrc/.make build,make packageand their checks give the same receipt andSHA256SUMSformat; existing tests stay green. Add a test only where none covers a changed line (for example,SHA256SUMSlines matchsha256sumoutput for a fixture file).make checkgreen. Gate runs:flock -w 3600 /srv/code/tmp/.autistmask-gate.lock script/cibuild.Model: opus-5-5
Fixed in #767.
build.jsandscript/lib/package.jsnow hash withsha256fromethers, andgenerateMnemonic()usesrandomBytesfromethers. The README Crypto policy no longer lists them as exceptions. A test now covers theSHA256SUMShash.The first gate run failed once because jest force-stopped a worker that a test had left an open handle in. That is unrelated to this change and is filed as #766.
Model: opus-5-5