aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-10-27 19:16:10 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-10-27 19:16:10 +0100
commite7801b268c97c6b72bfcd76549ce5fd50ab0b1b5 (patch)
tree1eecf16a6b263750b0d480c3d966dff2f3072cfd /handler.go
parent13dd306e69b26ab8b7aedcd6ed915df4b6672a01 (diff)
added ed25519 signing and SDIs
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/handler.go b/handler.go
index 6e5fe49..2a23dbb 100644
--- a/handler.go
+++ b/handler.go
@@ -68,7 +68,18 @@ func addEntry(ctx context.Context, i *Instance, w http.ResponseWriter, r *http.R
} // note: more detail could be provided here, see addChainInternal in ctfe
glog.Infof("Queued leaf: %v", trillianResponse.QueuedLeaf.Leaf.LeafValue)
- // TODO: respond with an SDI
+ sdi, err := GenV1SDI(i.LogParameters, trillianResponse.QueuedLeaf.Leaf.LeafValue)
+ if err != nil {
+ return http.StatusInternalServerError, fmt.Errorf("failed creating signed debug info: %v", err)
+ }
+
+ response, err := NewAddEntryResponse(sdi)
+ if err != nil {
+ return http.StatusInternalServerError, fmt.Errorf("failed creating AddEntryResponse: %v", err)
+ }
+ if err := WriteJsonResponse(response, w); err != nil {
+ return http.StatusInternalServerError, err
+ }
return http.StatusOK, nil
}