diff --git a/IDE/HEXAGON/build.sh b/IDE/HEXAGON/build.sh index d139d3bbb..5e09fba45 100755 --- a/IDE/HEXAGON/build.sh +++ b/IDE/HEXAGON/build.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ -z $1 ]; then echo "./build " - exit -1 + exit 1 fi printf "Erasing previous hexagon_$1_dynamic_toolv83_v65 and UbuntuARM_$1_aarch64\n" diff --git a/IDE/MYSQL/do.sh b/IDE/MYSQL/do.sh index 093fb3874..91e743c3a 100755 --- a/IDE/MYSQL/do.sh +++ b/IDE/MYSQL/do.sh @@ -1,3 +1,5 @@ +#!/bin/sh + # Place CMakeList in needed directories cp CMakeLists_wolfSSL.txt ../../CMakeLists.txt diff --git a/certs/gen_revoked.sh b/certs/gen_revoked.sh index 143f2bc6a..484f99428 100755 --- a/certs/gen_revoked.sh +++ b/certs/gen_revoked.sh @@ -1,3 +1,5 @@ +#!/bin/sh + ########################################################### ########## update and sign server-revoked-key.pem ################ ########################################################### diff --git a/certs/test/gen-testcerts.sh b/certs/test/gen-testcerts.sh index 9f7dca97b..a3c42134f 100755 --- a/certs/test/gen-testcerts.sh +++ b/certs/test/gen-testcerts.sh @@ -54,13 +54,16 @@ build_test_cert_conf() { echo "" >> "$1".conf if [ -n "$3" ]; then echo "[ req_ext ]" >> "$1".conf - if [ "$3" != *"DER"* ]; then - echo "subjectAltName = @alt_names" >> "$1".conf - echo "[alt_names]" >> "$1".conf - echo "DNS.1 = $3" >> "$1".conf - else - echo "subjectAltName = $3" >> "$1".conf - fi + case "$3" in + *DER*) + echo "subjectAltName = $3" >> "$1".conf + ;; + *) + echo "subjectAltName = @alt_names" >> "$1".conf + echo "[alt_names]" >> "$1".conf + echo "DNS.1 = $3" >> "$1".conf + ;; + esac fi } diff --git a/doc/generate_documentation.sh b/doc/generate_documentation.sh index d8fbe6e6f..e5defefe3 100755 --- a/doc/generate_documentation.sh +++ b/doc/generate_documentation.sh @@ -34,7 +34,7 @@ fi # Checking arguments and setting appropriate option variables -for var in $@ +for var in "$@" do case $var in -install) diff --git a/scripts/benchmark.test b/scripts/benchmark.test index 9bff8c244..dc3ba9cec 100755 --- a/scripts/benchmark.test +++ b/scripts/benchmark.test @@ -43,7 +43,7 @@ do_cleanup() { do_trap() { echo "got trap" do_cleanup - exit -1 + exit 1 } trap do_trap INT TERM diff --git a/scripts/ocsp-stapling-with-ca-as-responder.test b/scripts/ocsp-stapling-with-ca-as-responder.test index 8e6309469..6a8fbf5e1 100755 --- a/scripts/ocsp-stapling-with-ca-as-responder.test +++ b/scripts/ocsp-stapling-with-ca-as-responder.test @@ -230,7 +230,7 @@ openssl ocsp -port $port1 -nmin 1 \ -rsigner certs/ocsp/intermediate1-ca-cert.pem \ -rkey certs/ocsp/intermediate1-ca-key.pem \ -CA certs/ocsp/intermediate1-ca-cert.pem \ - $@ \ + "$@" \ & sleep 0.1 diff --git a/scripts/ocsp-stapling2.test b/scripts/ocsp-stapling2.test index 70a9ab857..93f33e6ca 100755 --- a/scripts/ocsp-stapling2.test +++ b/scripts/ocsp-stapling2.test @@ -296,34 +296,34 @@ sleep 0.1 # OLD: ./certs/ocsp/ocspd-root-ca-and-intermediate-cas.sh & # NEW: openssl isn't being cleaned up, invoke directly in script for cleanup # purposes! -openssl ocsp -port $port1 -nmin 1 \ +openssl ocsp -port $port1 -nmin 1 \ -index certs/ocsp/index-ca-and-intermediate-cas.txt \ -rsigner certs/ocsp/ocsp-responder-cert.pem \ -rkey certs/ocsp/ocsp-responder-key.pem \ -CA certs/ocsp/root-ca-cert.pem \ - $@ \ + "$@" \ & # OLD: ./certs/ocsp/ocspd-intermediate2-ca-issued-certs.sh & # NEW: openssl isn't being cleaned up, invoke directly in script for cleanup # purposes! -openssl ocsp -port $port2 -nmin 1 \ +openssl ocsp -port $port2 -nmin 1 \ -index certs/ocsp/index-intermediate2-ca-issued-certs.txt \ -rsigner certs/ocsp/ocsp-responder-cert.pem \ -rkey certs/ocsp/ocsp-responder-key.pem \ -CA certs/ocsp/intermediate2-ca-cert.pem \ - $@ \ + "$@" \ & # OLD: ./certs/ocsp/ocspd-intermediate3-ca-issued-certs.sh & # NEW: openssl isn't being cleaned up, invoke directly in script for cleanup # purposes! -openssl ocsp -port $port3 -nmin 1 \ +openssl ocsp -port $port3 -nmin 1 \ -index certs/ocsp/index-intermediate3-ca-issued-certs.txt \ -rsigner certs/ocsp/ocsp-responder-cert.pem \ -rkey certs/ocsp/ocsp-responder-key.pem \ -CA certs/ocsp/intermediate3-ca-cert.pem \ - $@ \ + "$@" \ & sleep 0.1 diff --git a/scripts/openssl.test b/scripts/openssl.test index b6d109042..179adc5d2 100755 --- a/scripts/openssl.test +++ b/scripts/openssl.test @@ -407,11 +407,12 @@ command -v $OPENSSL >/dev/null 2>&1 || { echo >&2 "Requires openssl command, but echo -e "\nTesting for _build directory as part of distcheck, different paths" currentDir=`pwd` -if [ "$currentDir" = *"_build" ] -then +case "$currentDir" in +*_build) echo -e "_build directory detected, moving a directory back" cd .. -fi + ;; +esac echo -e "\nChecking for wolfSSL client - needed for cipher list" wolfssl_client_avail=`$WOLFSSL_CLIENT -?` case $wolfssl_client_avail in diff --git a/scripts/openssl_srtp.test b/scripts/openssl_srtp.test index c362ee0b5..b7db4e684 100755 --- a/scripts/openssl_srtp.test +++ b/scripts/openssl_srtp.test @@ -120,7 +120,7 @@ check_dtls_srtp() { echo -n "check dtls $1 $2... " if [ $check_ret -ne 0 ];then echo "failed" - exit -1 + exit 1 else echo "ok" fi diff --git a/scripts/psk.test b/scripts/psk.test index d264b0a75..5444bcf43 100755 --- a/scripts/psk.test +++ b/scripts/psk.test @@ -69,7 +69,7 @@ do_cleanup() { do_trap() { echo "got trap" do_cleanup - exit -1 + exit 1 } trap do_trap INT TERM diff --git a/scripts/resume.test b/scripts/resume.test index 129f7a669..4aa4f3b09 100755 --- a/scripts/resume.test +++ b/scripts/resume.test @@ -50,7 +50,7 @@ do_cleanup() { do_trap() { echo "got trap" do_cleanup - exit -1 + exit 1 } do_test() { diff --git a/scripts/tls13.test b/scripts/tls13.test index 7e1a33238..099e1513c 100755 --- a/scripts/tls13.test +++ b/scripts/tls13.test @@ -90,7 +90,7 @@ do_cleanup() { do_trap() { echo "got trap" do_cleanup - exit -1 + exit 1 } trap do_trap INT TERM diff --git a/scripts/trusted_peer.test b/scripts/trusted_peer.test index d38c3d771..a6104d01c 100755 --- a/scripts/trusted_peer.test +++ b/scripts/trusted_peer.test @@ -80,7 +80,7 @@ do_cleanup() { do_trap() { echo "got trap" do_cleanup - exit -1 + exit 1 } trap do_trap INT TERM diff --git a/wrapper/python/wolfcrypt/.centos-provisioner.sh b/wrapper/python/wolfcrypt/.centos-provisioner.sh index 8f74110d2..3572324f7 100644 --- a/wrapper/python/wolfcrypt/.centos-provisioner.sh +++ b/wrapper/python/wolfcrypt/.centos-provisioner.sh @@ -1,3 +1,5 @@ +#!/bin/sh + [ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1 rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm diff --git a/wrapper/python/wolfcrypt/.ubuntu-provisioner.sh b/wrapper/python/wolfcrypt/.ubuntu-provisioner.sh index ab9e54cb3..60857f530 100644 --- a/wrapper/python/wolfcrypt/.ubuntu-provisioner.sh +++ b/wrapper/python/wolfcrypt/.ubuntu-provisioner.sh @@ -1,3 +1,5 @@ +#!/bin/sh + [ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1 apt-get update diff --git a/wrapper/python/wolfssl/.centos-provisioner.sh b/wrapper/python/wolfssl/.centos-provisioner.sh index fc0ec19a7..0becbe143 100644 --- a/wrapper/python/wolfssl/.centos-provisioner.sh +++ b/wrapper/python/wolfssl/.centos-provisioner.sh @@ -1,3 +1,5 @@ +#!/bin/sh + [ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1 rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm diff --git a/wrapper/python/wolfssl/.ubuntu-provisioner.sh b/wrapper/python/wolfssl/.ubuntu-provisioner.sh index 30ee7f6fc..23e4683e1 100644 --- a/wrapper/python/wolfssl/.ubuntu-provisioner.sh +++ b/wrapper/python/wolfssl/.ubuntu-provisioner.sh @@ -1,3 +1,5 @@ +#!/bin/sh + [ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1 apt-get update