Skip to content

Commit

Permalink
fix: zero division error
Browse files Browse the repository at this point in the history
  • Loading branch information
akakou committed May 14, 2024
1 parent 72e8f50 commit b0f3f63
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ttp/ct/sslmatect.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ func (ct *SSLMateCT) Setup(e *echo.Echo, ttp *core.TTP) error {
fmt.Println("Now CT check running...")

if err != nil {
fmt.Printf("%v", err)
fmt.Printf("ct error: %v\n", err)
}

err = audit.AuditAll(ttp, certs)
if err != nil {
fmt.Printf("%v", err)
fmt.Printf("ct error: %v\n", err)
}

err = writeFile(index.Last)
if err != nil {
fmt.Printf("%v", err)
fmt.Printf("ct error: %v\n", err)
}

time.Sleep(ct.Sleep)
Expand Down Expand Up @@ -99,8 +99,13 @@ func (ct *SSLMateCT) SyncFromDB(ttp *core.TTP) error {
monitors = append(monitors, m)
}

if len(monitors) == 0 {
ct.Sleep = DEFAULT_MAX_SLEEP
} else {
ct.Sleep = DEFAULT_MAX_SLEEP / time.Duration(len(monitors))
}

ct.Monitors = monitors
ct.Sleep = DEFAULT_MAX_SLEEP / time.Duration(len(domains))

return nil
}
Expand Down

0 comments on commit b0f3f63

Please sign in to comment.