From b3d1b793c1cb4869396111d2ed4b1630d54105e1 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Sat, 21 Jan 2023 17:20:39 -0500 Subject: [PATCH] Remove unused helper functions --- helpers.go | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/helpers.go b/helpers.go index 0641ccf..7bf175a 100644 --- a/helpers.go +++ b/helpers.go @@ -13,10 +13,8 @@ import ( "bytes" "crypto/sha256" "encoding/hex" - "encoding/json" "fmt" "io" - "io/ioutil" "math/big" "os" "os/exec" @@ -27,41 +25,6 @@ import ( "software.sslmate.com/src/certspotter/ct" ) -func ReadSTHFile(path string) (*ct.SignedTreeHead, error) { - content, err := ioutil.ReadFile(path) - if err != nil { - if os.IsNotExist(err) { - return nil, nil - } - return nil, err - } - - var sth ct.SignedTreeHead - if err := json.Unmarshal(content, &sth); err != nil { - return nil, err - } - - return &sth, nil -} - -func WriteSTHFile(path string, sth *ct.SignedTreeHead) error { - sthJson, err := json.MarshalIndent(sth, "", "\t") - if err != nil { - return err - } - sthJson = append(sthJson, byte('\n')) - return ioutil.WriteFile(path, sthJson, 0666) -} - -func WriteProofFile(path string, proof ct.ConsistencyProof) error { - proofJson, err := json.MarshalIndent(proof, "", "\t") - if err != nil { - return err - } - proofJson = append(proofJson, byte('\n')) - return ioutil.WriteFile(path, proofJson, 0666) -} - func IsPrecert(entry *ct.LogEntry) bool { return entry.Leaf.TimestampedEntry.EntryType == ct.PrecertLogEntryType }