From a56a9ba01373fae6da23d50e1aa6ed9a284363ea Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 29 Sep 2024 10:19:07 +0100 Subject: [PATCH] handle CSRs with no attributes --- main.fnl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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))]