@@ -70,11 +70,6 @@ func (m *Monitor) VerifyMutationsResponse(in *ktpb.GetMutationsResponse) []error
7070 m .trusted = in .GetLogRoot ()
7171 }
7272
73-
74- // TODO(ismail): pass in a (trillian) logverifier instead
75- // - create a set of fixed error messages so the caller can differentiate
76- // between different error types (like below)
77- // - also, create an equivalent map verifier (in trillian)
7873 if err := m .logVerifier .VerifyRoot (m .trusted , in .GetLogRoot (), in .GetLogConsistency ()); err != nil {
7974 // this could be one of ErrInvalidLogSignature, ErrInvalidLogConsistencyProof
8075 errList = append (errList , err )
@@ -85,7 +80,7 @@ func (m *Monitor) VerifyMutationsResponse(in *ktpb.GetMutationsResponse) []error
8580 b , err := json .Marshal (in .GetSmr ())
8681 if err != nil {
8782 glog .Errorf ("json.Marshal(): %v" , err )
88- // Encoding error
83+ errList = append ( errList , ErrInvalidMapSignature )
8984 }
9085 leafIndex := in .GetSmr ().GetMapRevision ()
9186 treeSize := in .GetLogRoot ().GetTreeSize ()
@@ -95,9 +90,7 @@ func (m *Monitor) VerifyMutationsResponse(in *ktpb.GetMutationsResponse) []error
9590 errList = append (errList , ErrInvalidLogInclusion )
9691 }
9792
98- //
9993 // map verification
100- //
10194
10295 // copy of singed map root
10396 smr := * in .GetSmr ()
@@ -109,9 +102,7 @@ func (m *Monitor) VerifyMutationsResponse(in *ktpb.GetMutationsResponse) []error
109102 errList = append (errList , ErrInvalidMapSignature )
110103 }
111104
112- //
113105 // mutations verification
114- //
115106
116107 // we need the old root for verifying the inclusion of the old leafs in the
117108 // previous epoch. Storage always stores the mutations response independent
@@ -128,9 +119,7 @@ func (m *Monitor) VerifyMutationsResponse(in *ktpb.GetMutationsResponse) []error
128119 in .GetSmr ().GetRootHash (), in .GetSmr ().GetMapId ()); len (err ) > 0 {
129120 errList = append (errList , err ... )
130121 }
131- } else {
132- // TODO oldRoot is the hash of the initial empty sparse merkle tree
133- }
122+ } // TODO else oldRoot is the hash of the initial empty sparse merkle tree
134123
135124 return errList
136125}
0 commit comments