(no commit message)
authorMatthias Wachs <wachs@net.in.tum.de>
Wed, 28 Jul 2010 07:19:51 +0000 (07:19 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Wed, 28 Jul 2010 07:19:51 +0000 (07:19 +0000)
src/transport/gnunet-transport-certificate-creation

index 294f54a3d52edeaabd0964c0bab0b1216e4fc3dd..cc10ca5d1547b0d1b0b3a9067598fbaeab916833 100755 (executable)
@@ -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