Skip to content

Commit

Permalink
allow OversizedGetEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
aditsachde committed Jul 22, 2024
1 parent 2c9fd6b commit 3fdad27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,16 @@ func TestCTHammer(t *testing.T) {
ClientPool: pool,
EPBias: bias,
MinGetEntries: 1,
MaxGetEntries: 1000, // TODO: actual max is 1000
OversizedGetEntries: false, // TODO: fix so this can be true
MaxGetEntries: 1000,
OversizedGetEntries: true,
Operations: 250,
Limiter: nil,
MaxParallelChains: 20,
IgnoreErrors: false, // TODO: fix so this can be false
IgnoreErrors: false,
MaxRetryDuration: time.Second * 10, // Doesn't matter since IgnoreErrors is false
RequestDeadline: time.Second * 5,
DuplicateChance: 10, // Default value from certificate-transparency-go
// TODO: This is set to true because although we can produce a valid consistency proof between any two STH values,
// This is set to true because although we can produce a valid consistency proof between any two STH values,
// this will result in failures at times. Consider a tree with a size of 250, but entires 240 to 250 were added
// together. Then, a partial tile for entry 245 would not have been stored. We could instead retrieve the tile for 250,
// but realistically we would rather just want to wait until 256 entries were stored and the full tile could be retrieved,
Expand Down
3 changes: 3 additions & 0 deletions internal/ctmonitor/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ func (f Fetch) get_proof_by_hash(ctx context.Context, reqBody io.ReadCloser, que
if err != nil {
return nil, 400, err
}
if len(hash) != 32 {
return nil, 400, fmt.Errorf("hash must be 32 bytes")
}

// Get and parse the tree_size parameter
treeSizeStr := query.Get("tree_size")
Expand Down

0 comments on commit 3fdad27

Please sign in to comment.