]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
src/*,test/*: Add missing quotes to shell scripts.
authorSimon Ruderich <simon@ruderich.org>
Sun, 11 Mar 2012 21:48:16 +0000 (22:48 +0100)
committerSimon Ruderich <simon@ruderich.org>
Sun, 11 Mar 2012 21:48:16 +0000 (22:48 +0100)
src/tlsproxy-add
src/tlsproxy-setup
tests/tests-normal.sh
tests/tests-passthrough.sh
tests/tests.sh

index 1acd03d4505b9d5863c40759a455138e5176e53a..c3acf3e4a19740b632aced94a81b5f5dfaa379cc 100755 (executable)
@@ -41,23 +41,23 @@ fi
 tempfile=`mktemp` || exit 1
 
 die() {
-    rm -f $tempfile
+    rm -f "$tempfile"
     exit 1
 }
 
 # Generate server certificate for given host.
-echo 'organization = tlsproxy' > $tempfile
-echo "cn = $1"                >> $tempfile
-echo tls_www_server           >> $tempfile
-echo encryption_key           >> $tempfile
-echo signing_key              >> $tempfile
+echo 'organization = tlsproxy' > "$tempfile"
+echo "cn = $1"                >> "$tempfile"
+echo tls_www_server           >> "$tempfile"
+echo encryption_key           >> "$tempfile"
+echo signing_key              >> "$tempfile"
 certtool --generate-certificate \
          --load-privkey proxy-key.pem \
          --load-ca-certificate proxy-ca.pem \
          --load-ca-privkey proxy-ca-key.pem \
-         --template $tempfile \
+         --template "$tempfile" \
          --outfile "certificate-$1-proxy.pem" || die
-rm $tempfile
+rm "$tempfile"
 
 if [ "x$2" = x ]; then
     echo please enter server certificate
index 48a034f63afd3e0b2c3a6c84ecdeac62f5c8cc28..24f1e0d0767164333e102a9d0663e1589345d4d0 100755 (executable)
 tempfile=`mktemp` || exit 1
 
 die() {
-    rm -f $tempfile
+    rm -f "$tempfile"
     exit 1
 }
 
 # Generate proxy CA key file.
 certtool --generate-privkey > proxy-ca-key.pem || die
 # Generate proxy CA.
-echo 'cn = tlsproxy CA' > $tempfile
-echo ca                >> $tempfile
-echo cert_signing_key  >> $tempfile
+echo 'cn = tlsproxy CA' > "$tempfile"
+echo ca                >> "$tempfile"
+echo cert_signing_key  >> "$tempfile"
 certtool --generate-self-signed \
          --load-privkey proxy-ca-key.pem \
-         --template $tempfile \
+         --template "$tempfile" \
          --outfile proxy-ca.pem || die
 
 # Generate proxy key file.
@@ -43,16 +43,16 @@ certtool --generate-privkey > proxy-key.pem || die
 
 # Generate proxy "invalid" server certificate. It's used for problematic
 # connections.
-echo 'organization = tlsproxy' > $tempfile
-echo 'cn = invalid'           >> $tempfile
-echo tls_www_server           >> $tempfile
-echo encryption_key           >> $tempfile
-echo signing_key              >> $tempfile
+echo 'organization = tlsproxy' > "$tempfile"
+echo 'cn = invalid'           >> "$tempfile"
+echo tls_www_server           >> "$tempfile"
+echo encryption_key           >> "$tempfile"
+echo signing_key              >> "$tempfile"
 certtool --generate-self-signed \
          --load-privkey proxy-key.pem \
-         --template $tempfile \
+         --template "$tempfile" \
          --outfile proxy-invalid.pem || die
 
-rm $tempfile
+rm "$tempfile"
 
 echo done
index 1d8f07bc8ef1e1ab752ae50560de68a8beb567bc..11c5eafd85d16457d104beaa81b41b505bb637db 100755 (executable)
 # Handle empty $srcdir.
 [ "x$srcdir" = x ] && srcdir=.
 
-. $srcdir/common.sh
+. "$srcdir/common.sh"
 
 
 # Create necessary files.
 cleanup
-$srcdir/../src/tlsproxy-setup >/dev/null 2>/dev/null
+"$srcdir/../src/tlsproxy-setup" >/dev/null 2>/dev/null
 
 # Normal tests.
 ../src/tlsproxy -d2 4711 >/dev/null &
-server --x509certfile $srcdir/server.pem \
-       --x509keyfile $srcdir/server-key.pem
+server --x509certfile "$srcdir/server.pem" \
+       --x509keyfile "$srcdir/server-key.pem"
 sleep 1
 
 
@@ -46,7 +46,7 @@ test_proxy_successful
 test_invalid_certificate
 
 # Create the proxy certificate.
-$srcdir/../src/tlsproxy-add localhost $srcdir/server.pem \
+"$srcdir/../src/tlsproxy-add" localhost "$srcdir/server.pem" \
     >/dev/null 2>/dev/null
 
 echo missing server certificate
@@ -73,8 +73,8 @@ test_no_invalid_certificate
 # Stop server and try a "MITM" with a bad certificate.
 echo
 pkill -n gnutls-serv
-server --x509certfile $srcdir/server-bad.pem \
-       --x509keyfile $srcdir/server-key.pem
+server --x509certfile "$srcdir/server-bad.pem" \
+       --x509keyfile "$srcdir/server-key.pem"
 sleep 1
 rm -f certificate-localhost-proxy.pem certificate-localhost-server.pem
 
@@ -90,7 +90,7 @@ test_proxy_successful
 test_invalid_certificate
 
 # Create the proxy certificate.
-$srcdir/../src/tlsproxy-add localhost $srcdir/server.pem \
+"$srcdir/../src/tlsproxy-add" localhost "$srcdir/server.pem" \
     >/dev/null 2>/dev/null
 
 echo mitm missing server certificate
index 253d160db376c1fbe7ee89d4eb94bc0608f8ab01..c93fbba2829ed66fbe9c8eee0cb6a77b15222f25 100755 (executable)
 # Handle empty $srcdir.
 [ "x$srcdir" = x ] && srcdir=.
 
-. $srcdir/common.sh
+. "$srcdir/common.sh"
 
 
 # Create necessary files.
 cleanup
-$srcdir/../src/tlsproxy-setup >/dev/null 2>/dev/null
+"$srcdir/../src/tlsproxy-setup" >/dev/null 2>/dev/null
 
 # Normal tests.
 ../src/tlsproxy -d2 -u 4711 >/dev/null &
-server --x509certfile $srcdir/server.pem \
-       --x509keyfile $srcdir/server-key.pem
+server --x509certfile "$srcdir/server.pem" \
+       --x509keyfile "$srcdir/server-key.pem"
 sleep 1
 
 
@@ -46,7 +46,7 @@ test_proxy_successful
 test_invalid_certificate
 
 # Create the proxy certificate.
-$srcdir/../src/tlsproxy-add localhost $srcdir/server.pem \
+"$srcdir/../src/tlsproxy-add" localhost "$srcdir/server.pem" \
     >/dev/null 2>/dev/null
 
 echo missing server certificate
@@ -75,8 +75,8 @@ test_no_invalid_certificate
 # Stop server and try a "MITM" with a bad certificate.
 echo
 pkill -n gnutls-serv
-server --x509certfile $srcdir/server-bad.pem \
-       --x509keyfile $srcdir/server-key.pem
+server --x509certfile "$srcdir/server-bad.pem" \
+       --x509keyfile "$srcdir/server-key.pem"
 sleep 1
 rm -f certificate-localhost-proxy.pem certificate-localhost-server.pem
 
@@ -92,7 +92,7 @@ test_proxy_successful
 test_invalid_certificate
 
 # Create the proxy certificate.
-$srcdir/../src/tlsproxy-add localhost $srcdir/server.pem \
+"$srcdir/../src/tlsproxy-add" localhost "$srcdir/server.pem" \
     >/dev/null 2>/dev/null
 
 echo mitm missing server certificate
index d831db34d23eefa9464639bb521f93b908013d9e..6a879575a9234fefa3eb665f477a267db3d1d593 100755 (executable)
@@ -22,9 +22,9 @@
 [ "x$srcdir" = x ] && srcdir=.
 
 echo "RUNNING NORMAL TESTS"
-$srcdir/tests-normal.sh || exit 1
+"$srcdir/tests-normal.sh" || exit 1
 
 echo
 
 echo "RUNNING PASSTHROUGH (-u) TESTS"
-$srcdir/tests-passthrough.sh || exit 1
+"$srcdir/tests-passthrough.sh" || exit 1