diff --git a/cryptext/passHash.go b/cryptext/passHash.go index be32661..015076c 100644 --- a/cryptext/passHash.go +++ b/cryptext/passHash.go @@ -150,9 +150,9 @@ func (ph PassHash) Verify(plainpass string, totp *string) bool { if version == 4 { if !hastotp { - return bcrypt.CompareHashAndPassword(payload, []byte(plainpass)) != nil + return bcrypt.CompareHashAndPassword(payload, []byte(plainpass)) == nil } else { - return bcrypt.CompareHashAndPassword(payload, []byte(plainpass)) != nil && totpext.Validate(totpsecret, *totp) + return bcrypt.CompareHashAndPassword(payload, []byte(plainpass)) == nil && totpext.Validate(totpsecret, *totp) } }