From 9b38f5a034486c27eaf81062ecdd86a72667e2b0 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Fri, 23 Oct 2020 18:01:10 +0200 Subject: added basic trust-anchor code path Pretty much the bare minimum to load trust anchors from file and check that the submitter's certificate chains back to something valid. --- handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'handler.go') diff --git a/handler.go b/handler.go index 80d7726..27b2fd9 100644 --- a/handler.go +++ b/handler.go @@ -50,7 +50,7 @@ func addEntry(ctx context.Context, i *instance, w http.ResponseWriter, r *http.R return http.StatusBadRequest, err } // request can be decoded - leaf, err := VerifyAddEntryRequest(request) + leaf, err := VerifyAddEntryRequest(i.anchors, request) if err != nil { return http.StatusBadRequest, err } // leaf is valid, e.g., signed by a trust anchor @@ -65,7 +65,7 @@ func addEntry(ctx context.Context, i *instance, w http.ResponseWriter, r *http.R trillianResponse, err := i.client.QueueLeaf(ctx, &trillianRequest) if err != nil { return http.StatusInternalServerError, fmt.Errorf("backend QueueLeaf request failed: %v", err) - } // note: more detail could be provided here, see addChainInternal in ctfe + } // 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 -- cgit v1.2.3