Skip to content

Commit

Permalink
Merge pull request #757 from tirsen/auth-clear-password
Browse files Browse the repository at this point in the history
Support "mysql_clear_password" auth plugin
  • Loading branch information
lance6716 authored Dec 19, 2022
2 parents 392e4ca + dfdf3e6 commit 191e9d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ func (c *Conn) genAuthResponse(authData []byte) ([]byte, bool, error) {
return CalcPassword(authData[:20], []byte(c.password)), false, nil
case AUTH_CACHING_SHA2_PASSWORD:
return CalcCachingSha2Password(authData, c.password), false, nil
case AUTH_CLEAR_PASSWORD:
return []byte(c.password), true, nil
case AUTH_SHA256_PASSWORD:
if len(c.password) == 0 {
return nil, true, nil
Expand Down
1 change: 1 addition & 0 deletions mysql/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const (
const (
AUTH_MYSQL_OLD_PASSWORD = "mysql_old_password"
AUTH_NATIVE_PASSWORD = "mysql_native_password"
AUTH_CLEAR_PASSWORD = "mysql_clear_password"
AUTH_CACHING_SHA2_PASSWORD = "caching_sha2_password"
AUTH_SHA256_PASSWORD = "sha256_password"
)
Expand Down

0 comments on commit 191e9d7

Please sign in to comment.