From 2d1392106686f2ec9f9ae53c450c0d61ba746354 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Mon, 18 Jun 2018 23:39:49 +1200 Subject: Add auto-detection of sha1sum/shasum to 002-test-key-name.test --- test/002-test-key-name.test/run.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test') 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" -- cgit v1.1