17 #include <my_global.h>
29 #define ORDINARY_QUESTION "\2"
30 #define LAST_QUESTION "\3"
31 #define LAST_PASSWORD "\4"
32 #define PASSWORD_QUESTION "\5"
39 int pkt_len, err=
CR_OK;
42 if (vio->
write_packet(vio, (
const unsigned char *) PASSWORD_QUESTION, 1))
56 if (strcmp(info->
user_name,
"qa_test_1_user")== 0)
79 else if (strcmp(info->
user_name,
"qa_test_2_user")== 0)
98 else if (strcmp(info->
user_name,
"qa_test_3_user")== 0)
102 strcpy((
char *)info->
auth_string,
"qa_test_3_dest");
109 else if (strcmp(info->
user_name,
"qa_test_4_user")== 0)
113 strcpy((
char *)info->
auth_string,
"qa_test_4_dest");
120 else if (strcmp(info->
user_name,
"qa_test_5_user")== 0)
139 else if (strcmp(info->
user_name,
"qa_test_6_user")== 0)
152 MYSQL_AUTHENTICATION_INTERFACE_VERSION,
157 mysql_declare_plugin(test_plugin)
159 MYSQL_AUTHENTICATION_PLUGIN,
160 &qa_auth_test_handler,
163 "plugin API test plugin",
173 mysql_declare_plugin_end;
199 unsigned char *pkt, cmd= 0;
221 reply= mysql->passwd;
228 if (cmd == 0 || cmd == 254)
235 if ((cmd == LAST_PASSWORD[0] || cmd == PASSWORD_QUESTION[0]) && *pkt == 0)
236 reply= mysql->passwd;
243 res= vio->
write_packet(vio, (
const unsigned char *) reply,
250 }
while (cmd != LAST_QUESTION[0] && cmd != PASSWORD_QUESTION[0]);
257 mysql_declare_client_plugin(AUTHENTICATION)
260 "Dialog Client Authentication Plugin",
268 mysql_end_client_plugin;