From ef2a022b68db03ec5b2aa9fb16f23ca041ef338c Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 8 Aug 2023 23:00:29 +0300 Subject: [PATCH] Up to date Go --- cmd/tlsc/main.go | 2 +- conn.go | 2 -- go.mod | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/tlsc/main.go b/cmd/tlsc/main.go index efeeb99..21a63ec 100644 --- a/cmd/tlsc/main.go +++ b/cmd/tlsc/main.go @@ -95,7 +95,7 @@ func main() { 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 6b61da0..7076336 100644 --- a/conn.go +++ b/conn.go @@ -24,8 +24,6 @@ import ( "time" ) -var aLongTimeAgo = time.Unix(1, 0) - type Addr struct { ip string port string diff --git a/go.mod b/go.mod index 64c05b0..54474dc 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module go.cypherpunks.ru/ucspi -go 1.16 +go 1.20 -- 2.44.0