X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=cmd%2Ftlsc%2Fmain.go;fp=cmd%2Ftlsc%2Fmain.go;h=21a63ec712cdab46c0655ab08f255a9aeccff2fd;hb=ef2a022b68db03ec5b2aa9fb16f23ca041ef338c;hp=efeeb99e0f55a71f1ef7df059da4f45d93a014aa;hpb=90ef9ebd205c8ddb4961126cac264239ebad33f2;p=ucspi.git 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