MySQL 9.1.0
Source Code Documentation
|
Macros | |
#define | MYSQL_NATIVE_PASSWORD_PLUGIN_NAME "mysql_native_password" |
Functions | |
static void | my_crypt (char *to, const uchar *s1, const uchar *s2, uint len) |
void | compute_two_stage_sha1_hash (const char *password, size_t pass_len, uint8 *hash_stage1, uint8 *hash_stage2) |
Compute two stage SHA1 hash of the password : More... | |
void | scramble (char *to, const char *message, const char *password) |
Produce an obscure octet sequence from password and random string, received from the server. More... | |
static int | native_password_auth_client (MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) |
Client authentication plugin that does native MySQL authentication using a 20-byte (4.1+) scramble. More... | |
mysql_declare_client_plugin (AUTHENTICATION) MYSQL_NATIVE_PASSWORD_PLUGIN_NAME | |
Variables | |
MYSQL_CLIENT_PLUGIN_AUTHOR_ORACLE | |
MySQL Native Authentication | Client |
MySQL Native Authentication | GPL |
MySQL Native Authentication | nullptr |
MySQL Native Authentication | native_password_auth_client |
MySQL Native Authentication | mysql_end_client_plugin |
#define MYSQL_NATIVE_PASSWORD_PLUGIN_NAME "mysql_native_password" |
|
inline |
Compute two stage SHA1 hash of the password :
hash_stage1=sha1("password") hash_stage2=sha1(hash_stage1)
[in] | password | Password string. |
[in] | pass_len | Length of the password. |
[out] | hash_stage1 | sha1(password) |
[out] | hash_stage2 | sha1(hash_stage1) |
mysql_declare_client_plugin | ( | AUTHENTICATION | ) |
|
static |
Client authentication plugin that does native MySQL authentication using a 20-byte (4.1+) scramble.
vio | the channel to operate on |
mysql | the MYSQL structure to operate on |
-1 | CR_OK : Success |
1 | CR_ERROR : error reading |
2012 | CR_SERVER_HANDSHAKE_ERR : malformed handshake data |
void scramble | ( | char * | to, |
const char * | message, | ||
const char * | password | ||
) |
Produce an obscure octet sequence from password and random string, received from the server.
This sequence corresponds to the password, but password can not be easily restored from it. The sequence is then sent to the server for validation. Trailing zero is not stored in the buf as it is not needed. This function is used by client to create authenticated reply to the server's greeting.
[out] | to | store scrambled string here. The buf must be at least SHA1_HASH_SIZE bytes long. |
message | random message, must be exactly SCRAMBLE_LENGTH long and NULL-terminated. | |
password | users' password, NULL-terminated |
MySQL Native Authentication Client |
MySQL Native Authentication GPL |
MYSQL_CLIENT_PLUGIN_AUTHOR_ORACLE |
MySQL Native Authentication mysql_end_client_plugin |
MySQL Native Authentication native_password_auth_client |
MySQL Native Authentication nullptr |