diff options
Diffstat (limited to 'internal/manager/helpers.go')
-rw-r--r-- | internal/manager/helpers.go | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/internal/manager/helpers.go b/internal/manager/helpers.go deleted file mode 100644 index a9a2158..0000000 --- a/internal/manager/helpers.go +++ /dev/null @@ -1,52 +0,0 @@ -package manager - -import ( - "crypto/sha256" - "encoding/base64" - "fmt" - - ct "github.com/google/certificate-transparency-go" - "gitlab.torproject.org/rgdd/ct/pkg/metadata" - "rgdd.se/silent-ct/pkg/monitor" -) - -func selectLogs(m metadata.Metadata) []monitor.MessageLogConfig { - var logs []monitor.MessageLogConfig - for _, operator := range m.Operators { - for _, log := range operator.Logs { - if log.State == nil { - continue // ignore logs without a state (should not happen) - } - if log.State.Name == metadata.LogStatePending { - continue // log is not yet relevant - } - if log.State.Name == metadata.LogStateRetired { - continue // log is not expected to be reachable - } - if log.State.Name == metadata.LogStateRejected { - continue // log is not expected to be reachable - } - - // FIXME: remove me instead of hard coding Argon 2024 - id, _ := log.Key.ID() - got := fmt.Sprintf("%s", base64.StdEncoding.EncodeToString(id[:])) - want := "7s3QZNXbGs7FXLedtM0TojKHRny87N7DUUhZRnEftZs=" - if got != want { - continue - } - - logs = append(logs, monitor.MessageLogConfig{ - Metadata: log, - State: monitor.MonitorState{ - LogState: monitor.LogState{ct.SignedTreeHead{ - SHA256RootHash: [sha256.Size]byte{47, 66, 110, 15, 246, 154, 8, 100, 150, 140, 206, 208, 17, 57, 112, 116, 210, 3, 19, 55, 46, 63, 209, 12, 234, 130, 225, 124, 237, 2, 64, 228}, - TreeSize: 610650601, - Timestamp: 1702108968538, - }}, - NextIndex: 388452203, - }, - }) - } - } - return logs -} |