diff options
author | David Phillips <david@sighup.nz> | 2018-06-18 23:39:49 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-06-18 23:42:38 +1200 |
commit | 2d1392106686f2ec9f9ae53c450c0d61ba746354 (patch) | |
tree | 43512bea3202ce105208e4701ad33f7d77bd8b99 | |
parent | 5fdd42e4188d26582b25a96a6938d3172ce69e91 (diff) | |
download | sand-leek-2d1392106686f2ec9f9ae53c450c0d61ba746354.tar.xz |
Add auto-detection of sha1sum/shasum to 002-test-key-name.test
-rwxr-xr-x | test/002-test-key-name.test/run.sh | 9 |
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" |