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_wireprotocol.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_wireprotocol.h')
-rw-r--r-- | ext/mysqlnd/mysqlnd_wireprotocol.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h index 39645cb08c..0f3f73e788 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.h +++ b/ext/mysqlnd/mysqlnd_wireprotocol.h @@ -70,17 +70,20 @@ typedef struct st_mysqlnd_packet_greet { uint8_t protocol_version; char *server_version; uint32_t thread_id; - zend_uchar scramble_buf[SCRAMBLE_LENGTH]; + zend_uchar intern_scramble_buf[SCRAMBLE_LENGTH]; + zend_uchar * scramble_buf; + size_t scramble_buf_len; /* 1 byte pad */ - uint16_t server_capabilities; + uint32_t server_capabilities; uint8_t charset_no; uint16_t server_status; - /* 13 byte pad*/ + /* 13 byte pad, in 5.5 first 2 bytes are more capabilities followed by 1 byte scramble_length */ zend_bool pre41; /* If error packet, we use these */ char error[MYSQLND_ERRMSG_SIZE+1]; char sqlstate[MYSQLND_SQLSTATE_LENGTH + 1]; unsigned int error_no; + char *auth_protocol; } MYSQLND_PACKET_GREET; @@ -100,6 +103,7 @@ typedef struct st_mysqlnd_packet_auth { const char *password; /* +1 for \0 because of scramble() */ unsigned char *server_scramble_buf; + size_t server_scramble_buf_len; size_t db_len; zend_bool send_auth_data; zend_bool is_change_user_packet; |