From 531f63e5a9e82d86a6ee1f5d44bebee0bc51d828 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Sun, 31 Jul 2016 20:41:52 +0100 Subject: Use a KRL for revoked certs --- cmd/cashierd/main.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'cmd') diff --git a/cmd/cashierd/main.go b/cmd/cashierd/main.go index 2a649c2..8295c74 100644 --- a/cmd/cashierd/main.go +++ b/cmd/cashierd/main.go @@ -1,7 +1,6 @@ package main import ( - "bytes" "crypto/rand" "encoding/hex" "encoding/json" @@ -211,17 +210,16 @@ func rootHandler(a *appContext, w http.ResponseWriter, r *http.Request) (int, er } func listRevokedCertsHandler(a *appContext, w http.ResponseWriter, r *http.Request) (int, error) { - var out bytes.Buffer revoked, err := a.certstore.GetRevoked() if err != nil { return http.StatusInternalServerError, err } - for _, c := range revoked { - out.WriteString(c.Raw) - out.WriteString("\n") + rl, err := a.sshKeySigner.GenerateRevocationList(revoked) + if err != nil { + return http.StatusInternalServerError, err } - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - w.Write(out.Bytes()) + w.Header().Set("Content-Type", "application/octet-stream") + w.Write(rl) return http.StatusOK, nil } -- cgit v1.2.3