From 918cc25d80790675f24d2dcf50b83da4bffcc61b Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 28 Jul 2010 07:19:51 +0000 Subject: [PATCH] --- .../gnunet-transport-certificate-creation | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/transport/gnunet-transport-certificate-creation b/src/transport/gnunet-transport-certificate-creation index 294f54a3d..cc10ca5d1 100755 --- a/src/transport/gnunet-transport-certificate-creation +++ b/src/transport/gnunet-transport-certificate-creation @@ -3,10 +3,25 @@ # GNUnet TLS certificate shell scricpt # Creates a TSL certificate to use with HTTPS transport plugin +if [ $# -ne 2 ]; then + exit 1 +fi + rm -f $1 $2 # Create RSA Private Key -openssl genrsa -out $1 1024 > /dev/null +openssl genrsa -out $1 1024 2> /dev/null +if [ $? -ne 0 ]; then + rm -f $1 $2 + exit 1 +fi # Create a self-signed certificate in batch mode using rsa key -openssl req -batch -days 365 -out $2 -new -x509 -key $1 > /dev/null -chmod 0400 $1 $2 \ No newline at end of file +openssl req -batch -days 365 -out $2 -new -x509 -key $1 2> /dev/null +if [ $? -ne 0 ]; then + rm -f $1 $2 + exit 1 +fi + +chmod 0400 $1 $2 + +exit 0 -- 2.25.1