commit a56a9ba01373fae6da23d50e1aa6ed9a284363ea parent e4410323cf593f4873543e4fb85000980879583e Author: Daniel Barlow <dan@telent.net> Date: Sun, 29 Sep 2024 10:19:07 +0100 handle CSRs with no attributes Diffstat:
| M | main.fnl | | | 9 | +++++---- |
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git 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))]