summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_auth.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-02-151-1/+5
|\ | | | | | | | | * PHP-7.4: Fix #78680: mysqlnd pam plugin missing terminating null
| * Fix #78680: mysqlnd pam plugin missing terminating nullDaniel Black2021-02-151-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PAM service requires the terminating null to be part of the communication. Tested with MariaDB-10.4(pam) and Percona Server 5.7.32(auth_pam_compat). Also changed MySQL Enterprise test to the server side plugin, authentication_pam as opposed to the client plugin mysql_clear_password. Add additional check for pamtest user and pam service file as all are required for the test. More importantly, test result should actually succeed. Thanks Geoff Montee for bug report. Closes GH-78680.
* | Fix MSVC level 1 (severe) warningsChristoph M. Becker2020-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We fix (hopefully) all instances of: * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312> `zend_llist_add_element()` and `zend_llist_prepend_element()` now explicitly expect a *const* pointer. We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress C4090; this should prevent accidential removal of the cast by clarifying the intention, and makes it easier to remove the casts if the issue[1] will be resolved sometime. [1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
* | Merge branch 'PHP-7.4'Nikita Popov2020-04-031-1/+1
|\ \ | |/ | | | | | | * PHP-7.4: Fix incorrect free for last_message
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-04-031-1/+1
| |\ | | | | | | | | | | | | * PHP-7.3: Fix incorrect free for last_message
| | * Fix incorrect free for last_messageQianqian Bu2020-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In commit a7305eb539596e175bd6c3ae9a20953358c5d677 the last_message field of the connection object was changed to be always non-persistent. But there is a place on change_user path that still treats it depending on conn->persistent flag. This will cause PHP crash after com_change_user success when there is last_message set
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-03-231-0/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix leak on Windows as well
| * | Fix leak on Windows as wellChristoph M. Becker2020-03-231-0/+5
| | | | | | | | | | | | Cf. <http://git.php.net/?p=php-src.git;a=commit;h=db08ef0d3274b239a6b9e68d71d02bb6acb71d82>
* | | Merge branch 'PHP-7.4'Nikita Popov2020-03-231-0/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix RSA memory leak in mysqlnd auth
| * | Fix RSA memory leak in mysqlnd authNikita Popov2020-03-231-0/+3
| | |
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-03-021-61/+206
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.4: Native Windows support for mysqlnd sha256 authentification Abstract over crypto operations
| * | Native Windows support for mysqlnd sha256 authentificationChristoph M. Becker2020-03-021-0/+129
| | | | | | | | | | | | We implement that on top of Cryptography API: Next Generation (CNG).
| * | Abstract over crypto operationsChristoph M. Becker2020-03-021-61/+77
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2020-02-181-2/+8
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Don't use VLA in mysqlnd auth
| * | Don't use VLA in mysqlnd authNikita Popov2020-02-181-2/+8
| | | | | | | | | | | | | | | We use alloca instead of VLA. This should also allow building this code on Windows.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-01-241-1/+7
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.4: Fixed bug #79011 Fix memory leaks in mysqlnd debug functionality
| * | Fixed bug #79011Nikita Popov2020-01-241-1/+7
| | | | | | | | | | | | | | | | | | auth_plugin_data_len here is 21, including the trailing null byte. Directly use SCRAMBLE_LENGTH instead. Also add a sanity check that the provided scramble is long enough.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-12-271-13/+60
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | * PHP-7.4: Handle empty password fast path in caching_sha2_password Handle error response during caching_sha2_password auth Add support for caching_sha2_password in change user authentication Fix unix socket check during caching_sha2_password Support auth switch request during caching sha2 auth
| * | Handle empty password fast path in caching_sha2_passwordNikita Popov2019-12-271-1/+6
| | | | | | | | | | | | | | | | | | If an empty password is used, no additional packets are exchanged during caching_sha2_password auth. We're only looking for an OK/ERR response.
| * | Handle error response during caching_sha2_password authNikita Popov2019-12-271-0/+7
| | | | | | | | | | | | In particular, this fixes handling of expired passwords.
| * | Add support for caching_sha2_password in change user authenticationNikita Popov2019-12-271-0/+13
| | | | | | | | | | | | Same as for connection handshakes.
| * | Fix unix socket check during caching_sha2_passwordNikita Popov2019-12-271-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | The fact that conn->unix_socket is set does not mean that a Unix socket is actually in use -- this member is set in a default configuration. Instead check whether a unix_socket stream ops is used.
| * | Support auth switch request during caching sha2 authNikita Popov2019-12-271-9/+23
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2019-12-111-0/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Free RSA public key in mysqlnd sha256 auth
| * | Free RSA public key in mysqlnd sha256 authNikita Popov2019-12-111-0/+1
| | | | | | | | | | | | Not sure why this only started showing up as a leak now.
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
|/ / | | | | | | Closes GH-4732.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-08-201-0/+3
|\ \ | |/ | | | | | | * PHP-7.3: fix the problem for connect_attr, set db condition, and add a new attribute _server_host
| * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-08-201-0/+3
| |\ | | | | | | | | | | | | * PHP-7.2: fix the problem for connect_attr, set db condition, and add a new attribute _server_host
| | * fix the problem for connect_attr, set db condition, and add a new attribute ↵Qianqian Bu2019-08-201-0/+3
| | | | | | | | | | | | _server_host
* | | Fix typo in error messageFabien Villepinte2019-02-211-1/+1
| | |
* | | Update and fix remaining year ranges (2019)Peter Kokot2019-02-081-2/+2
| | | | | | | | | | | | | | | | | | This patch follows previous license year ranges updates. With new approach source code files now have simplified headers with license information without year ranges.
* | | Remove local variablesPeter Kokot2019-02-031-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | | Simplify the command factoryAndrey Hristov2019-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since more than an year it not possible to create commands in the heap but they are allocated on the stack and directly run. In this regard, it doesn't make sense to have all the vararg stuff. Commands made sense to be created and pushed onto a stack then a general executor will run thru the stack and execute/handle the commands.
* | | Mark const what should not be changedAndrey Hristov2019-01-071-36/+36
| | |
* | | Re-commit MySQL 8 cached SHA auth supportNikita Popov2018-11-211-7/+276
|/ / | | | | | | | | | | | | | | | | With changes to (hopefully) correctly fall back if OpenSSL support is missing. Furthermore the hard-coded dependency on ext/hash is no longer an issue, as this extension is required in master. This reverts commit 63072e9c0ebbb676cd39d0f867d873737c676add, reversing changes made to 4cbabb6852d2a7d966fb78a53d9d4c1cac18f10b.
* | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2018-09-041-282/+7
|\ \ | |/
| * Revert all MySQL auth related changesNikita Popov2018-09-041-286/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per bug #76651 these changes do not appear to work correctly in some cases. As no immediate fix seems to be forthcoming, I'm reverting these changes. Revert "Fixed invalid free introduced by d6e81f0bfd0cb90586dd83d4fd47a4302605261a (avoid keeping "invalid" pointer)" This reverts commit 11507c0e1bfa17a96480f3648397f6975c31551e. Revert "Fix mysqlnd build without openssl" This reverts commit 6c9db02ff7812c298d1e7e292ba731d9d3a66790. Revert "Fix VC compilation as variable size array is not supported" This reverts commit f96df64cb2219fda42ca875483f874cf3052647c. Revert "Fix MySQL 8 auth" This reverts commit d6e81f0bfd0cb90586dd83d4fd47a4302605261a.
| * Fix mysqlnd build without opensslNikita Popov2018-06-101-0/+1
| | | | | | | | | | Cherry-pick of 968eb0b38cc9095d418beb8f0df08c4b9abdb079, as these changes were also introduced in lower branches.
* | Fix typos in codePeter Kokot2018-07-271-1/+1
| |
* | Fix mysqlnd build without opensslNikita Popov2018-06-091-0/+1
| |
* | Merge branch 'master' of git.php.net:/php-srcJohannes Schlüter2018-06-061-1/+1
|\ \
| * | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-1/+1
| | | | | | | | | | | | where we sure about string persistence.
* | | Merge branch 'PHP-7.1'Johannes Schlüter2018-06-061-7/+281
|\ \ \ | |/ / |/| / | |/
| * Fix MySQL 8 authJohannes Schlüter2018-06-061-7/+285
| |
* | Merge branch 'PHP-7.2'Johannes Schlüter2018-02-201-1/+1
|\ \ | |/
| * Fix a memleak with mysqlnd and SSLJohannes Schlüter2018-02-201-1/+1
| |
* | Merge branch 'PHP-7.2'Johannes Schlüter2018-02-201-8/+15
|\ \ | |/
| * Merge branch 'PHP-7.0' into PHP-7.1Johannes Schlüter2018-02-201-8/+15
| |\
| | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
| * | year++Xinchen Hui2018-01-021-1/+1
| | |