Skip to content

Commit c9169bb

Browse files
committed
explicit error handling for strict decoding
1 parent 5775e83 commit c9169bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hmac/hmac.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ func (v *Verifier) VerifyLoginAndPassword(login, password []byte) bool {
5252

5353
v.ensureBufferSize(v.dec.DecodedLen(len(password)))
5454
buf := v.buf
55-
n, _ := v.dec.Decode(buf, password)
55+
n, err := v.dec.Decode(buf, password)
56+
if v.strict && err != nil {
57+
return false
58+
}
5659
buf = buf[:n]
5760

5861
var expire int64

0 commit comments

Comments
 (0)