Merge pull request #16 from elithrar/patch-1
Removed redundant calls to len()
This commit is contained in:
commit
1dea542d12
1 changed files with 1 additions and 1 deletions
|
@ -271,7 +271,7 @@ func createMac(h hash.Hash, value []byte) []byte {
|
|||
// verifyMac verifies that a message authentication code (MAC) is valid.
|
||||
func verifyMac(h hash.Hash, value []byte, mac []byte) error {
|
||||
mac2 := createMac(h, value)
|
||||
if len(mac) == len(mac2) && subtle.ConstantTimeCompare(mac, mac2) == 1 {
|
||||
if subtle.ConstantTimeCompare(mac, mac2) == 1 {
|
||||
return nil
|
||||
}
|
||||
return ErrMacInvalid
|
||||
|
|
Loading…
Reference in a new issue