aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-06-18 23:39:49 +1200
committerDavid Phillips <david@sighup.nz>2018-06-18 23:42:38 +1200
commit2d1392106686f2ec9f9ae53c450c0d61ba746354 (patch)
tree43512bea3202ce105208e4701ad33f7d77bd8b99 /test
parent5fdd42e4188d26582b25a96a6938d3172ce69e91 (diff)
downloadsand-leek-2d1392106686f2ec9f9ae53c450c0d61ba746354.tar.xz
Add auto-detection of sha1sum/shasum to 002-test-key-name.test
Diffstat (limited to 'test')
-rwxr-xr-xtest/002-test-key-name.test/run.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/002-test-key-name.test/run.sh b/test/002-test-key-name.test/run.sh
index 661b451..cdd0004 100755
--- a/test/002-test-key-name.test/run.sh
+++ b/test/002-test-key-name.test/run.sh
@@ -2,6 +2,13 @@
set -e
+if hash sha1sum ; then
+ SHASUM=sha1sum
+else
+ # fallback for Travis OSX builds. Presume perl provides it
+ SHASUM=shasum
+fi
+
key="$(mktemp)"
stderr="$(mktemp)"
@@ -16,7 +23,7 @@ echo "sand-leek says it found $found..."
real="$( \
openssl rsa -in $key -pubout -outform DER \
| tail -c +23 \
- | sha1sum \
+ | $SHASUM \
| head -c 20 \
| python -c "import base64,sys,codecs; print(base64.b32encode(codecs.decode(sys.stdin.readline().strip('\n'), 'hex')).decode().lower())").onion"