aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"