-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix Auth Resnponse packet when cleartext is used #887
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
Conversation
One problem is what should be returned for empty password: empty string or one byte NUL. Whan I tested with sha256_password (which returns cleartext when secure connection), one byte NUL is required. I suppose cleartext password plugin is same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the addNUL?
It's there to avoid an allocation for a return value which is just copied again afterwards anyway.
Because I thought it's there to add NUL after I think both of Anyway, code around |
I can confirm that the fixes in 369b5d6 fix the issue I was having. |
Trailing NUL char should be in `string[n] auth-response`. But NUL was after auth-response.
Fixes #884
Description
NUL shouldn't be after
string[n] auth-response
. It breaks followingstring[NUL] database
.https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse41
So
n
should contain trailing NUL byte.I confirmed cleartext is used in sha256_password. I can't confirm cleartext password.
Especially, there are no way to enable fast cleartext password in MySQL 5.7 and 8.0.
(default-authenticate-plugin can't be "cleartext_password".)
Checklist