]> Cypherpunks.ru repositories - ucspi.git/commitdiff
Up to date Go v0.1.0
authorSergey Matveev <stargrave@stargrave.org>
Tue, 8 Aug 2023 20:00:29 +0000 (23:00 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 8 Aug 2023 20:00:29 +0000 (23:00 +0300)
cmd/tlsc/main.go
conn.go
go.mod

index efeeb99e0f55a71f1ef7df059da4f45d93a014aa..21a63ec712cdab46c0655ab08f255a9aeccff2fd 100644 (file)
@@ -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 6b61da0009ceb486f87b2ca30b787f6c054362de..7076336a2cabb56a671d63189fb88cd26f5d210e 100644 (file)
--- 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 64c05b0b159700b0702c7a3e14dfda8b2a889d1b..54474dca43ca4bbbe0b9ba71a7b97e2fdae55f39 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,3 @@
 module go.cypherpunks.ru/ucspi
 
-go 1.16
+go 1.20