summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd.c
diff options
context:
space:
mode:
authorandrey <andrey@php.net>2012-09-25 14:04:36 +0200
committerandrey <andrey@php.net>2012-09-25 14:04:36 +0200
commit571b46bff68925f15f578147278b43c6f88083f0 (patch)
tree101cf8e3f35f89acb3290e07ca5712b93a8aae09 /ext/mysqlnd/mysqlnd.c
parent8a930c93dd673b9f13350590a7b6e3a1a5ce4431 (diff)
downloadphp-git-571b46bff68925f15f578147278b43c6f88083f0.tar.gz
Add SHA256 authentication support - password hashing to mysqlnd
Automatic switchover to SSL with plain-text password is not part of this
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r--ext/mysqlnd/mysqlnd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index d7462f77a5..f7f3245a2c 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -581,12 +581,14 @@ mysqlnd_run_authentication(
}
memcpy(conn->auth_plugin_data, plugin_data, plugin_data_len);
- DBG_INF_FMT("salt=[%*.s]", plugin_data_len - 1, plugin_data);
+ DBG_INF_FMT("salt(%d)=[%.*s]", plugin_data_len, plugin_data_len, plugin_data);
/* The data should be allocated with malloc() */
scrambled_data =
auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
- plugin_data, plugin_data_len, options, mysql_flags TSRMLS_CC);
-
+ plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags TSRMLS_CC);
+ if (!scrambled_data || conn->error_info->error_no) {
+ goto end;
+ }
if (FALSE == is_change_user) {
ret = mysqlnd_auth_handshake(conn, user, passwd, passwd_len, db, db_len, options, mysql_flags,
charset_no,
@@ -1334,13 +1336,12 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
DBG_RETURN(FAIL);
}
- *dont_poll = mysqlnd_stream_array_check_for_readiness(r_array TSRMLS_CC);
-
FD_ZERO(&rfds);
FD_ZERO(&wfds);
FD_ZERO(&efds);
if (r_array != NULL) {
+ *dont_poll = mysqlnd_stream_array_check_for_readiness(r_array TSRMLS_CC);
set_count = mysqlnd_stream_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC);
if (set_count > max_set_count) {
max_set_count = set_count;