diff --git a/main.fnl b/main.fnl index 886cc69..21f0a82 100644 --- a/main.fnl +++ b/main.fnl @@ -94,10 +94,11 @@ (crt:toPEM))) (fn approve-request? [csr] - (let [attr (csr:getAttributes)] - (accumulate [found false - _ v (ipairs (. attr "challengePassword"))] - (or found (= v options.challenge-password))))) + (let [{ : challengePassword } (csr:getAttributes)] + (when challengePassword + (accumulate [found false + _ v (ipairs challengePassword)] + (or found (= v options.challenge-password)))))) (fn handle-sign-csr [out] (let [req (csr.new (out:get_body_as_string))]