cmd/tlsc/main.go | 2 +- conn.go | 2 -- go.mod | 2 +- diff --git a/cmd/tlsc/main.go b/cmd/tlsc/main.go index 0e23cbe91419569e7aadd19c5b4bc94d97f418769e5fd8e3fe5f4362d1b35b14..98bee7e9f76ea8068b91667a4083c0def31b626854626af83fb5d7107b08105d 100644 --- a/cmd/tlsc/main.go +++ b/cmd/tlsc/main.go @@ -95,7 +95,7 @@ } cfg.VerifyPeerCertificate = func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { spki := verifiedChains[0][0].RawSubjectPublicKeyInfo hshTheir := sha256.Sum256(spki) - if bytes.Compare(hshOur, hshTheir[:]) != 0 { + if !bytes.Equal(hshOur, hshTheir[:]) { return errors.New("server certificate's SPKI hash mismatch") } return nil diff --git a/conn.go b/conn.go index feac62becf359acd0c22e1a93281e3adef14033a212418bd1e5fcee25fec094d..eb3cd97797377f0e236888796d9e95b7433a536f578b23c24d57125febd34e99 100644 --- a/conn.go +++ b/conn.go @@ -24,8 +24,6 @@ "os" "time" ) -var aLongTimeAgo = time.Unix(1, 0) - type Addr struct { ip string port string diff --git a/go.mod b/go.mod index 020ea3f8bad0ef6562d301ba47125b7810ccc7530557fd8dee0330fa27717cc8..dba658700eeb7f5d9eee6635f2c592224b6c0ee250e732556fed18b36a18c157 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module go.cypherpunks.ru/ucspi -go 1.16 +go 1.20