Skip to content

Commit 5e7aab1

Browse files
committed
Fix SHA256SUMS
Actually sign the npm package hash, rather than only the libbwt hashes. And rename to LIBBWT-SHA256SUMS, to prevent future confusion.
1 parent f07233b commit 5e7aab1

File tree

7 files changed

+28
-27
lines changed

7 files changed

+28
-27
lines changed

LIBBWT-SHA256SUMS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
0797b116d267ddfa4b327f80ed60ac7a73b149e2bdd7bb3e3e1cfffb4577be9a libbwt-0.2.1-electrum_only-x86_64-windows.tar.gz
2+
1a68ddf31b241837f3d537ff6a279dc294862c1fac4ed26d54fc9c0a0c2be71e libbwt-0.2.1-x86_64-osx.tar.gz
3+
3b5b4ba82f0932fd226fbd6455c02fb1df7cf708175fc2571acce08e2fc6582d libbwt-0.2.1-arm64v8-linux.tar.gz
4+
3ed646ca654e532a6917c491a85ca29a28ce901b030886d02a52b577edc6afb6 libbwt-0.2.1-electrum_only-arm64v8-linux.tar.gz
5+
6dfb0368418449ada0af3edc52baf01593e15a49d18b81c712361f3efc7fbccf libbwt-0.2.1-electrum_only-x86_64-osx.tar.gz
6+
8d3c1f05a32a9caa155986725a5af4e88071598fddd200f8f039b130dc090973 libbwt-0.2.1-electrum_only-arm32v7-linux.tar.gz
7+
b8d773f1feb7fc2612f26a324c8cd035ec2bc8ad021b86e090c5645b275e71fd libbwt-0.2.1-x86_64-linux.tar.gz
8+
bf9d19d6d0187b609c496fcfb41f500fc80834818e8491027cfd556971649668 libbwt-0.2.1-arm32v7-linux.tar.gz
9+
e73ab59429090aa467211101c63f273574b934f3eacff3399054c6cea976588a libbwt-0.2.1-x86_64-windows.tar.gz
10+
ebfdf7dcd570d116d73348113f36f7bebed998a953871aed6831d226f6073dc2 libbwt-0.2.1-electrum_only-x86_64-linux.tar.gz

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ The will download the `libbwt` library for your platform as a postinstall step.
111111
The currently supported platforms are Linux, Mac, Windows and ARMv7/8.
112112

113113
The hash of the downloaded library is verified against the
114-
[`SHA256SUMS`](SHA256SUMS) file that ships with the npm package.
114+
[`SHA256SUMS`](LIBBWT-SHA256SUMS) file that ships with the npm package.
115115

116116
> Note: `libbwt-nodejs` uses [`ffi-napi`](https://github.com/node-ffi-napi/node-ffi-napi), which requires
117117
> a recent nodejs version. If you're running into errors during installation or segmentation faults,
@@ -158,7 +158,7 @@ copy the `libbwt.so`/`libbwt.dylib`/`bwt.dll` file into the root directory of `l
158158

159159
## Reproducible builds
160160

161-
The nodejs package (including the `SHA256SUMS` file with the `libbwt` hashes for all platforms)
161+
The nodejs package (including the `LIBBWT-SHA256SUMS` file with the `libbwt` hashes for all platforms)
162162
can be reproduced in a Docker container environment as follows:
163163

164164
```bash

SHA256SUMS.asc

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
-----BEGIN PGP SIGNED MESSAGE-----
22
Hash: SHA256
33

4-
0797b116d267ddfa4b327f80ed60ac7a73b149e2bdd7bb3e3e1cfffb4577be9a libbwt-0.2.1-electrum_only-x86_64-windows.tar.gz
5-
1a68ddf31b241837f3d537ff6a279dc294862c1fac4ed26d54fc9c0a0c2be71e libbwt-0.2.1-x86_64-osx.tar.gz
6-
3b5b4ba82f0932fd226fbd6455c02fb1df7cf708175fc2571acce08e2fc6582d libbwt-0.2.1-arm64v8-linux.tar.gz
7-
3ed646ca654e532a6917c491a85ca29a28ce901b030886d02a52b577edc6afb6 libbwt-0.2.1-electrum_only-arm64v8-linux.tar.gz
8-
6dfb0368418449ada0af3edc52baf01593e15a49d18b81c712361f3efc7fbccf libbwt-0.2.1-electrum_only-x86_64-osx.tar.gz
9-
8d3c1f05a32a9caa155986725a5af4e88071598fddd200f8f039b130dc090973 libbwt-0.2.1-electrum_only-arm32v7-linux.tar.gz
10-
b8d773f1feb7fc2612f26a324c8cd035ec2bc8ad021b86e090c5645b275e71fd libbwt-0.2.1-x86_64-linux.tar.gz
11-
bf9d19d6d0187b609c496fcfb41f500fc80834818e8491027cfd556971649668 libbwt-0.2.1-arm32v7-linux.tar.gz
12-
e73ab59429090aa467211101c63f273574b934f3eacff3399054c6cea976588a libbwt-0.2.1-x86_64-windows.tar.gz
13-
ebfdf7dcd570d116d73348113f36f7bebed998a953871aed6831d226f6073dc2 libbwt-0.2.1-electrum_only-x86_64-linux.tar.gz
4+
d580eb0543a5029625e8ba97f40a4d1199e0be53a08b177803f1d5f02af3dd3d libbwt-nodejs-0.2.1.tgz
145
-----BEGIN PGP SIGNATURE-----
156
Version: GnuPG v1
167

17-
iQEcBAEBCAAGBQJgAFAaAAoJEIH2EEzQ8VD8UdUH/AtwcsolOZH1Z2xEdEldfhxz
18-
fe2XnsDXjUfbN8s/i/Vwq8gHMv9iXAWIolPO01sugoI30BODgMClZHkQk+TnaQ6A
19-
m3dCCKqK2kaxu4/gOxm/Ksv311hVpktJhQ1/Ho7iMWbn9xprCu9KMpI0f9sD9Er4
20-
NZRtbV5Lp34Bqb5JNd48rvjzGAYeZoWKBpYp4weXMcWked51zXwM4XmMN7VR3sjS
21-
GCtI6eSUG0EE+paMGI3IVKIwoYQt/5SlFC01FAdaqySyc/K45KcuoysCCl9JoJ/E
22-
0rjjSeIWOYhATWkP0fqcHTqS4A0MC4zuu44QMeiGXi0sYoJRSlAnzGpvJw4f1NY=
23-
=2/mh
8+
iQEcBAEBCAAGBQJgAbbNAAoJEIH2EEzQ8VD8yuwIAJqGnLSri5+YAhwdyLS/2P1k
9+
oQz05CTZzdRj1Rl1gzdRkgcIsgvnC860f0qu+GIYyrRSmTm0XBd0EBuS/aG/DBKX
10+
73mWYAGNSToYlsdlu4tFZSIKYWO1Y01W3qRaH7FRU59WX3IX8hNhQdd4HJn0M+xq
11+
ZWUHY9wxVf/wCVbv4IeDsIoksUNqtGzT437uZJV6YJp0gkNl+Lz1elco362/18IP
12+
ABGPqs7JVAGiToPvrvypA7YuCHefkAgDpiK+2hvBcQAYRfsApDG01cRkZZMORQBl
13+
kSy6Bu7BoImOud8y2efMUviYoz+jWlguPS4V95l5UhKme+ksPZXXi2N67tKdQug=
14+
=rFKE
2415
-----END PGP SIGNATURE-----

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"files": [
2727
"index.js",
2828
"postinstall.js",
29-
"SHA256SUMS",
29+
"LIBBWT-SHA256SUMS",
3030
"npm-shrinkwrap.json",
3131
"README.md"
3232
]

postinstall.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ async function getFile(url, dest) {
6767

6868
// Read the expected sha256 hash out of the SHA256SUMS file
6969
function getExpectedHash(dist_name) {
70-
let line = fs.readFileSync(path.join(__dirname, 'SHA256SUMS'))
70+
let line = fs.readFileSync(path.join(__dirname, 'LIBBWT-SHA256SUMS'))
7171
.toString()
7272
.split('\n')
7373
.find(line => line.endsWith(` ${dist_name}.tar.gz`))
74-
if (!line) throw new Error(`Cannot find ${dist_name} in SHA256SUMS`)
74+
if (!line) throw new Error(`Cannot find ${dist_name} in LIBBWT-SHA256SUMS`)
7575
return line.split(' ')[0]
7676
}
7777

scripts/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ fi
1414

1515
mkdir -p dist && rm -rf dist/*
1616

17-
# Update SHA256SUMS
18-
(cd $LIBBWT_DIST && sha256sum *.tar.gz) | sort > SHA256SUMS
19-
chmod 664 SHA256SUMS
17+
# Update LIBBWT-SHA256SUMS
18+
(cd $LIBBWT_DIST && sha256sum *.tar.gz) | sort > LIBBWT-SHA256SUMS
19+
chmod 664 LIBBWT-SHA256SUMS
2020

2121
# Update version
2222
npm version --allow-same-version --no-git-tag-version $version

scripts/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ if [ -z "$SKIP_BUILD" ]; then
3838
fi
3939

4040
# Sign
41-
gpg --clearsign --digest-algo sha256 SHA256SUMS > SHA256SUMS.asc
41+
(cd dist && sha256sum *.tgz) | gpg --clearsign --digest-algo sha256 > SHA256SUMS.asc
4242

4343
# Git tag and push
4444
if [ -z "$SKIP_GIT" ]; then
45-
git add {package,npm-shrinkwrap}.json {CHANGELOG,README}.md SHA256SUMS SHA256SUMS.asc libbwt
45+
git add {package,npm-shrinkwrap}.json {CHANGELOG,README}.md LIBBWT-SHA256SUMS SHA256SUMS.asc libbwt
4646
git commit -S -m v$version
4747
git tag --sign -m "$changelog" v$version
4848
git branch -f latest HEAD

0 commit comments

Comments
 (0)