From 22e072c19f2f76c2087f6f3aa6db7c92a3d84804 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Thu, 7 Apr 2016 20:29:48 +0000 Subject: [PATCH] Ignore zero-sized files --- server/modules/certclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/certclient.py b/server/modules/certclient.py index a8c4fdf..20505eb 100755 --- a/server/modules/certclient.py +++ b/server/modules/certclient.py @@ -110,7 +110,7 @@ script CERT="/systemid/$(hostname).%(tag)s.cert.pem" SUBJECT="$(echo '%(subject)s' | sed s/SYSTEMID/$(hostname)/g)" - if test ! -e "${KEY}"; then + if test ! -s "${KEY}"; then openssl ecparam -name secp384r1 -genkey | openssl ec -out "${KEY}" chmod 0400 "${KEY}" fi @@ -119,7 +119,7 @@ script /icon/iconograph/client/wait_for_service.py --host=%(host)s --service=%(service)s chvt 8 - if test ! -e "${CERT}"; then + if test ! -s "${CERT}"; then openssl req -new -key "${KEY}" -subj "${SUBJECT}" | /icon/certserver/certclient.py --ca-cert=/icon/config/ca.%(tag)s.certserver.cert.pem --client-cert=/icon/config/client.%(tag)s.certserver.cert.pem --client-key=/icon/config/client.%(tag)s.certserver.key.pem --server=%(server)s > "${CERT}" chmod 0444 "${CERT}" fi