Skip to content

Commit

Permalink
update revoke.sh
Browse files Browse the repository at this point in the history
add crl validation
  • Loading branch information
acavella committed Dec 28, 2023
1 parent 1edb1c4 commit d991531
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion revoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ copy_to_run_log() {
chmod 644 "${log}"
}

check_config(){
check_config() {
if [ ! -e $config ]
then
printf "$(date '+%Y-%m-%dT%H:%M:%S') [error] unable to locate configuration ${config}\n"
exit 1
fi
}

check_network() {
commands
}


fix_permissions() {
printf "$(date '+%Y-%m-%dT%H:%M:%S') [info] fixing permissions on ${wwwdir}\n"
chown apache:apache ${wwwdir} -R
Expand All @@ -78,6 +83,12 @@ download_crl() {
printf "$(date '+%Y-%m-%dT%H:%M:%S') [error] download failed ${crlID} zero byte file ${tempfile}\n"
exit 1
fi
openssl crl -inform DER -text -noout -in ${tempfile} | grep 'Certificate Revocation List' &> /dev/null
if [ $? == 1 ]
then
printf "$(date '+%Y-%m-%dT%H:%M:%S') [error] download failed ${crlID} invalid crl ${tempfile}\n"
exit 1
fi
printf "$(date '+%Y-%m-%dT%H:%M:%S') [info] copying ${tempfile} to ${wwwdir}/${crlID}.crl\n"
mv ${tempfile} ${wwwdir}/${crlID}.crl
let counterA=counterA+1
Expand Down

0 comments on commit d991531

Please sign in to comment.