Fix bug when fetching entries

This bug caused certspotter to always request 1000 entries even if
went beyond the size of the log.  This would have prevented
certspotter from downloading entries near the end of the log, if the log was
strict with get-entries bounds.

In practice, none of the active CT logs are strict with get-entries bounds,
and even if a log were strict, certspotter would have been able to successfully
download the entries later once the log grew.
This commit is contained in:
Andrew Ayer 2023-11-13 14:35:24 -05:00
parent b957791a5f
commit e2b5a8c8ea
1 changed files with 1 additions and 1 deletions

View File

@ -234,7 +234,7 @@ func monitorLog(ctx context.Context, config *Config, ctlog *loglist.Log, logClie
func downloadEntries(ctx context.Context, logClient *client.LogClient, entriesChan chan<- client.GetEntriesItem, begin, end uint64) error {
for begin < end && ctx.Err() == nil {
size := begin - end
size := end - begin
if size > maxGetEntriesSize {
size = maxGetEntriesSize
}