diff options
author | Andrey Hristov <andrey@php.net> | 2011-01-12 21:40:05 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2011-01-12 21:40:05 +0000 |
commit | 429e07bba242e99799300fa61b517af7cac24267 (patch) | |
tree | 36fd89941a21f712a200d589aaeef2632c440c74 /ext/mysqlnd/mysqlnd_structs.h | |
parent | 8e73b7080614b4e82177aa6faedb16b028f71937 (diff) | |
download | php-git-429e07bba242e99799300fa61b517af7cac24267.tar.gz |
grok the MySQL 5.5 extended handshake.
Move the authentication routines, the native ones, to
separate file and encapsulate them in a plugin.
Depending on the server version and what the server
requests (or doesn't in old versions) load the authentication
plugin to handle it.
Currently only the 4.1+ authentication is supported. More to come
Diffstat (limited to 'ext/mysqlnd/mysqlnd_structs.h')
-rw-r--r-- | ext/mysqlnd/mysqlnd_structs.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index 4a28f17ae2..5ba2f4c68f 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -151,12 +151,12 @@ typedef struct st_mysqlnd_options char *cfg_file; char *cfg_section; + char *auth_protocol; /* We need to keep these because otherwise st_mysqlnd_conn will be changed. The ABI will be broken and the methods structure will be somewhere else in the memory which can crash external code. Feel free to reuse these. */ - char * unused1; char * unused2; char * unused3; char * unused4; @@ -963,4 +963,21 @@ struct st_mysqlnd_typeii_plugin_example unsigned int counter; }; +struct st_mysqlnd_packet_greet; + +struct st_mysqlnd_authentication_plugin +{ + struct st_mysqlnd_plugin_header plugin_header; + struct { + enum_func_status (*auth_handshake)(MYSQLND * conn, const char * const user, const char * const passwd, const char * const db, + const size_t db_len, const struct st_mysqlnd_packet_greet * const greet_packet, + const MYSQLND_OPTIONS * const options, unsigned long mysql_flags, + char ** switch_to_auth_protocol TSRMLS_DC); + + enum_func_status (*auth_change_user)(MYSQLND * const conn, const char * const user, const size_t user_len, const char * const passwd, + const char * const db, const size_t db_len, const zend_bool silent, + char ** switch_to_auth_protocol TSRMLS_DC); + } methods; +}; + #endif /* MYSQLND_STRUCTS_H */ |