From: Mark Huang Date: Mon, 17 Jul 2006 21:28:55 +0000 (+0000) Subject: - If the CA certificate does not exist, assume that the certificate is self-signed. X-Git-Tag: planetlab-4_0-rc1~143 X-Git-Url: http://git.onelab.eu/?p=myplc.git;a=commitdiff_plain;h=e13b59aad08b480e3af2d4e9f814b05e29a86708 - If the CA certificate does not exist, assume that the certificate is self-signed. --- diff --git a/plc.d/ssl b/plc.d/ssl index a4afb7f..ec879dc 100755 --- a/plc.d/ssl +++ b/plc.d/ssl @@ -7,7 +7,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: ssl,v 1.7 2006/06/28 21:34:18 mlhuang Exp $ +# $Id: ssl,v 1.8 2006/07/10 21:05:17 mlhuang Exp $ # # Source function library and configuration @@ -40,6 +40,12 @@ verify_or_generate_certificate() { cname=$4 email=$5 + # If the CA certificate does not exist, assume that the + # certificate is self-signed. + if [ ! -f $ca ] ; then + cp -a $crt $ca + fi + if [ -f $crt ] ; then # Check if certificate is valid verify=$(openssl verify -CAfile $ca $crt) @@ -68,10 +74,8 @@ verify_or_generate_certificate() { -nodes -keyout $key -out $crt check chmod 644 $crt - fi - if [ ! -f $ca ] ; then - # The certificate it self-signed, so it is its own CA + # The certificate it self-signed, so it is its own CA cp -a $crt $ca fi }