Commit Graph

17 Commits

Author SHA1 Message Date
9409d54d81 expression: support builtin func password for GBK (#29202) 2021-11-05 12:17:02 +08:00
11b61738f3 parser: migrate test-infra to testify (#29191) 2021-10-28 12:30:49 +08:00
xhe
94e30df8e2 parser: fix compiling, add unit tests (#28700) 2021-10-11 23:15:25 +08:00
c95be4aaa6 [parser] auth: caching_sha2_password salt fix (#1249)
- a NUL or '$' could get replaced with another NUL or '$'
- Replacement characters didn't get their first bit set to 0 (`&^ 128`)
- The test case used the index number instead of the value of the rune.
2021-10-09 14:53:23 +08:00
4415136781 [parser] auth: check for NUL in caching_sha2_password salt (#1246) 2021-10-09 14:53:23 +08:00
768ee171c1 [parser] auth: Fix salt generation of caching_sha2_password (#1242)
This code intended to set the first bit of every byte of the salt
to 0 as the salt should not contain multi-byte UTF-8.

However it failed to do this. This changes the `^` with a `^&` to fix
that.

In addition to that this also avoids the '$' inside salts as that is
already used as delimiter in the authentication string.

Co-authored-by: tiancaiamao <tiancaiamao@gmail.com>
2021-10-09 14:53:23 +08:00
12d0a279c4 [parser] parser,ast: Support for authentication plugins (#1236) 2021-10-09 14:53:23 +08:00
8d23ad21c9 [parser] auth: add the caching sha2 algorithm for authentication (#1232)
This allows validating passwords against the `authentication_string`
data that MySQL stores for caching_sha2 passwords.

Related:
- https://github.com/pingcap/tidb/issues/9411
2021-10-09 14:53:23 +08:00
a276562af7 [parser] auth: fix CheckScrambledPassword() panic for invalid input (#1197)
* auth: fix CheckScrambledPassword() panic for invalid input

* fix CI

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2021-10-09 14:53:23 +08:00
d0d67ddb9e [parser] *: support GRANT PROXY (#1142) 2021-10-09 14:53:23 +08:00
6eb2909901 [parser] change all dot import, according to staticcheck (#730)
* change all dot import, according to staticcheck

* make staticcheck happy
2021-10-09 14:53:23 +08:00
989870f109 [parser] *: remove testleak (#676) 2021-10-09 14:53:23 +08:00
bee7de1fb7 [parser] parser, ast: add SET ROLE support (#228) 2021-10-09 14:53:23 +08:00
7e78a3671e [parser] use safe String() for UserIdentity (#227) 2021-10-09 14:53:23 +08:00
82847ebc2a [parser] parser: add gramma for RBAC (#213) 2021-10-09 14:53:23 +08:00
ac9b7fbb7a [parser] parser: implement Restore for CreateUserStmt, AlterUserStmt and DropUserStmt (#197) 2021-10-09 14:53:23 +08:00
c270f55405 [parser] *: move github.com/pingcap/tidb/parser here (#1) 2021-10-09 14:53:23 +08:00