Skip to content

Commit

Permalink
chore: use bytes.Equal instead bytes.Compare
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Jul 14, 2023
1 parent 0bcd1f3 commit cc2ac5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/cloud/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (ch *Handshake) handleV1AuthReply(buffer []byte, handshake *handshakeDetail
}

digest := GenDigest(handshake.hash, []byte(message.Node), []byte(ch.options.Cluster), handshake.cookieHash)
if bytes.Compare(message.Digest, digest) != 0 {
if bytes.Equal(message.Digest, digest) == false {
return fmt.Errorf("authorization failed")
}
handshake.digestRemote = digest
Expand Down

0 comments on commit cc2ac5b

Please sign in to comment.