X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Ftlsproxy-add;h=be8cb8a002b392d1795c2d39f1da5037601d6e6e;hb=a64101800c79c852cc4ab9d445c35aad0a6457eb;hp=92e20864b68614d7b8ba483095cea314751bf1a8;hpb=c231c86212589d66ec19f359d216ea2b302706c7;p=tlsproxy%2Ftlsproxy.git diff --git a/src/tlsproxy-add b/src/tlsproxy-add index 92e2086..be8cb8a 100755 --- a/src/tlsproxy-add +++ b/src/tlsproxy-add @@ -4,7 +4,7 @@ # # Requires certtool (from GnuTLS). # -# Copyright (C) 2011 Simon Ruderich +# Copyright (C) 2011-2013 Simon Ruderich # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -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