From 0cd966dd8405df6244db051faf5ebc112e1c5a1e Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Thu, 5 Nov 2020 19:23:40 +0100 Subject: fixed get-entries output and client-side verification --- reqres.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'reqres.go') diff --git a/reqres.go b/reqres.go index a5464ea..5013d95 100644 --- a/reqres.go +++ b/reqres.go @@ -39,13 +39,9 @@ type GetConsistencyProofRequest struct { Second int64 `json:"second"` // size of the newer Merkle tree } -// GetEntryResponse is an assembled log entry and its associated appendix -// TODO: fix GetEntryResponse and update doc: should have signature scheme -type GetEntryResponse struct { - Leaf []byte `json:"leaf"` // tls-serialized StItem - Signature []byte `json:"signature"` // Serialized signature using the log's signature scheme - Chain [][]byte `json:"chain"` // der-encoded certificates -} +// GetEntryResponse is an assembled log entry and its associated appendix. It +// is identical to the add-entry request that the log once accepted. +type GetEntryResponse AddEntryRequest // newAddEntryRequest parses and sanitizes the JSON-encoded add-entry // parameters from an incoming HTTP post. The serialized leaf value and @@ -158,7 +154,7 @@ func (lp *LogParameters) newGetEntryResponse(leaf, appendix []byte) (*GetEntryRe for _, c := range app.Chain { chain = append(chain, c.Data) } - return &GetEntryResponse{leaf, app.Signature, chain}, nil + return &GetEntryResponse{leaf, app.Signature, app.SignatureScheme, chain}, nil } // newGetEntriesResponse assembles a get-entries response -- cgit v1.2.3