aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-07-31 20:41:52 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-07-31 21:18:55 +0100
commit531f63e5a9e82d86a6ee1f5d44bebee0bc51d828 (patch)
tree882b6dfb10c4db96b9e983fd6112a29d227a416a /cmd
parent44fef1c2a163bdfd781ef08a06e3cf5cf9b7d5da (diff)
Use a KRL for revoked certs
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cashierd/main.go12
1 files changed, 5 insertions, 7 deletions
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
}