mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-16 18:11:25 +02:00
Test for case when challenge_altnames is empty (#321)
When all names in a cert have already been validated, the challenge_altnames array will be empty, causes an error in later code. This patch adds a test to handle that case.
This commit is contained in:
committed by
Lukas Schauer
parent
7f30826a6d
commit
636fa1a559
@@ -520,6 +520,7 @@ sign_csr() {
|
||||
# Respond to challenges
|
||||
reqstatus="valid"
|
||||
idx=0
|
||||
if [ ${#challenge_altnames[@]} -ne 0 ]; then
|
||||
for altname in "${challenge_altnames[@]:0}"; do
|
||||
challenge_token="${challenge_tokens[${idx}]}"
|
||||
keyauth="${keyauths[${idx}]}"
|
||||
@@ -555,6 +556,7 @@ sign_csr() {
|
||||
[[ -n "${HOOK}" ]] && [[ "${HOOK_CHAIN}" != "yes" ]] && "${HOOK}" "invalid_challenge" "${altname}" "${result}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Wait for hook script to clean the challenges if used
|
||||
# shellcheck disable=SC2068
|
||||
|
||||
Reference in New Issue
Block a user