Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove last 0 byte for mysql_old_password when password is empty #1133

Merged
merged 1 commit into from
Aug 18, 2020

Conversation

rainingmaster
Copy link
Contributor

@rainingmaster rainingmaster commented Jun 22, 2020

Description

When I create a user with mysql_old_password as auth plugin but without password, and use this user to login(refer this test: https://github.com/rainingmaster/go-mysql-test), it will failed, as my test here, and report Error 1043: Bad handshake.

After my investigation, I have compared the login data from mysql client(which is successful), I found client do not need to send the last 0' byte for the auth switch, if we append last 0` byte even empty password, the hand shake will be broken.

For maradb:5.5 to maradb:10.3, it wont response auth switch by response ok straightly.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

@rainingmaster
Copy link
Contributor Author

@methane @julienschmidt Hi both, could you help me review this PR? So thx

Copy link
Member

@julienschmidt julienschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rainingmaster,
thank you for this PR. In general it looks good to me.

However, kindly add your details to the AUTHORS file, or indicate which existing entry applies.

@julienschmidt julienschmidt added this to the v1.6.0 milestone Aug 14, 2020
@rainingmaster
Copy link
Contributor Author

rainingmaster commented Aug 16, 2020

@julienschmidt Hi

thanks for your review, and I have updated the AUTHORS

Copy link
Member

@julienschmidt julienschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks!

@julienschmidt julienschmidt merged commit 46351a8 into go-sql-driver:master Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants