-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mysql/client: Add support for caching_sha2_password plugin
caching_sha2_password plugin, unlike mysql_native_password, is a multi step process. Client hashes the password using SHA2 algorithm and sends it to the server. Server responds with either an AUTH_MORE_DATA (0x01) packet or an Error packet. Error packet is sent when authentication fails during "fast" auth (more on this below). The second byte of AUTH_MORE_DATA packet will either be 0x03 or 0x04. 0x03 represents a successful "fast" auth meaning that the server has a cached hash of the password for the user and it matches the hash sent by the client. Server will send an OK packet next. Server sends 0x04 when the hash of the password is not yet cached. In this case, client has to do a "full" authentication by sending un-hashed password. If the client is connected using SSL or a Unix socket, client can write the password in clear text. If this is not the case, client has to request a public key from the server to encrypt the password. Client should obfuscate the password using xor operation before encrypting it with public key and sending it to the server. Server will respond with an OK packet if autentication is successful or Error packet otherwise. Signed-off-by: Vamsi Atluri <vamc19@gmail.com>
- Loading branch information
Showing
6 changed files
with
228 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.