From ab089ddb07adb26757e066ed63d9c03c17f3c888 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Tue, 23 Nov 2021 09:11:24 +0100 Subject: [PATCH] libgit2: use `bytes.Equal` instead of `.Compare` Signed-off-by: Hidde Beydals --- pkg/git/libgit2/transport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/git/libgit2/transport.go b/pkg/git/libgit2/transport.go index e609fcb3..ab36130b 100644 --- a/pkg/git/libgit2/transport.go +++ b/pkg/git/libgit2/transport.go @@ -266,7 +266,7 @@ func (k knownKey) matches(host string, hostkey git2go.HostkeyCertificate) bool { return false } hasher.Write(k.key.Marshal()) - return bytes.Compare(hasher.Sum(nil), fingerprint) == 0 + return bytes.Equal(hasher.Sum(nil), fingerprint) } func containsHost(hosts []string, host string) bool {