diff --git a/misc/CA.sh b/misc/CA.sh index 37ed4cfe..9803d881 100755 --- a/misc/CA.sh +++ b/misc/CA.sh @@ -50,11 +50,11 @@ case $1 in -selfsign -extensions v3_ca -infiles ${TOP_DIR}/${CAREQ} ;; "-newserver" ) + echo -e "${GREEN}Making the Server key and cert${COLOR_RST}" if ! [ -f ${TOP_DIR}/private/${CAKEY} ]; then echo -e "${RED}Can not found the CA's key${COLOR_RST}" exit 2 fi - echo -e "${GREEN}Making the Server key and cert${COLOR_RST}" sed -i 's/=.*#COMMONNAME/= FIC2014 Server #COMMONNAME/' $OPENSSL_CONF openssl req -batch -new -keyout server.key -out server.csr -days ${DAYS} echo -e "${GREEN}Signing the Server crt${COLOR_RST}" @@ -72,6 +72,10 @@ case $1 in [ $# -ne 2 ] && "Usage: $0 -newclient NAME" echo -e "${GREEN}Making the client key and csr${COLOR_RST}" + if ! [ -f ${TOP_DIR}/private/${CAKEY} ]; then + echo -e "${RED}Can not found the CA's key${COLOR_RST}" + exit 2 + fi sed -i "s/=.*#COMMONNAME/= $2#COMMONNAME/" $OPENSSL_CONF sed -i "s/=.*#CERTTYPE/= client #CERTTYPE/" $OPENSSL_CONF