From 933367d31ec0664a6011446cfcccc914fc0cb36b Mon Sep 17 00:00:00 2001 From: Arjan H Date: Sat, 31 Aug 2024 16:22:40 +0200 Subject: [PATCH] Update certificate revoke command and reasons (#134) --- commander | 4 ++-- gui/main.go | 8 ++------ gui/templates/views/revoke-partial.tmpl | 14 +++++--------- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/commander b/commander index 44cbdc2..587a24d 100755 --- a/commander +++ b/commander @@ -162,9 +162,9 @@ case $txt in ;; "revoke-cert") read serial - read reasonCode + read reason cd /opt/boulder - docker compose exec boulder bin/admin-revoker serial-revoke --config labca/config/admin-revoker.json $serial $reasonCode 2>&1 + docker compose exec boulder bin/admin -config labca/config/admin.json revoke-cert -serial $serial -reason $reason -dry-run=false 2>&1 ;; "test-email") read recipient diff --git a/gui/main.go b/gui/main.go index 22ac88b..4f8618e 100644 --- a/gui/main.go +++ b/gui/main.go @@ -3043,13 +3043,9 @@ func certRevokeHandler(w http.ResponseWriter, r *http.Request) { } serial := r.Form.Get("serial") - reason, err := strconv.Atoi(r.Form.Get("reason")) - if err != nil { - errorHandler(w, r, err, http.StatusBadRequest) - return - } + reason := r.Form.Get("reason") - if !_hostCommand(w, r, "revoke-cert", serial, strconv.Itoa(reason)) { + if !_hostCommand(w, r, "revoke-cert", serial, reason) { return } } diff --git a/gui/templates/views/revoke-partial.tmpl b/gui/templates/views/revoke-partial.tmpl index 1c78b9c..5685c53 100644 --- a/gui/templates/views/revoke-partial.tmpl +++ b/gui/templates/views/revoke-partial.tmpl @@ -12,15 +12,11 @@ Pick a reason for revoking this certificate:

NOTE that revoking a certificate can NOT be reversed!