X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Ftlsproxy-setup;h=24f1e0d0767164333e102a9d0663e1589345d4d0;hb=118d7d263672c587a1e4268dbf35df3f913f4aeb;hp=9f17f0b75996a20281ec2d7e8bd439aea3263157;hpb=7c04a6ce058abc6819c046cbaec22b9db302f048;p=tlsproxy%2Ftlsproxy.git diff --git a/src/tlsproxy-setup b/src/tlsproxy-setup index 9f17f0b..24f1e0d 100755 --- a/src/tlsproxy-setup +++ b/src/tlsproxy-setup @@ -4,7 +4,7 @@ # # Requires certtool (from GnuTLS). # -# Copyright (C) 2011 Simon Ruderich +# Copyright (C) 2011-2012 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 @@ -23,19 +23,19 @@ 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,14 +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