php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #79275 Support auth_plugin_caching_sha2_password on Windows
Submitted: 2020-02-14 11:55 UTC Modified: 2020-03-02 15:38 UTC
From: cmanplus at gmail dot com Assigned: cmb (profile)
Status: Closed Package: MySQL related
PHP Version: 7.4.2 OS: Windows 10 ver 1903
Private report: No CVE-ID: None
 [2020-02-14 11:55 UTC] cmanplus at gmail dot com
Description:
------------
Official PHP 7.4.2 Windows binaries do not support auth_plugin_caching_sha2_password, tried to compile locally and failed because of this: 

"The compiler must know the size of a type at compile time in order to allocate space for an instance of that type."

IDE: Visual Studio Community 2017 version 15.9.7
Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x86


> configure "--enable-snapshot-build" "--enable-com-dotnet=shared" "--without-analyzer" "--with-pgo"

> nmake

Actual result:
--------------
ext\mysqlnd\mysqlnd_auth.c(809): error C2057: expected constant expression
ext\mysqlnd\mysqlnd_auth.c(809): error C2466: cannot allocate an array of constant size 0
ext\mysqlnd\mysqlnd_auth.c(809): error C2133: 'xor_str': unknown size
ext\mysqlnd\mysqlnd_auth.c(1022): error C2057: expected constant expression
ext\mysqlnd\mysqlnd_auth.c(1022): error C2466: cannot allocate an array of constant size 0
ext\mysqlnd\mysqlnd_auth.c(1022): error C2133: 'xor_str': unknown size


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-02-14 15:23 UTC] cmb@php.net
-Summary: mysqlnd_auth compile fails: error C2057: expected constant expression +Summary: Support auth_plugin_caching_sha2_password on Windows -Type: Bug +Type: Feature/Change Request -Package: Compile Failure +Package: MySQL related
 [2020-02-14 15:23 UTC] cmb@php.net
> Official PHP 7.4.2 Windows binaries do not support
> auth_plugin_caching_sha2_password, […]

Indeed; see PR 5129[1] for an inapplicable attempt to support it.
Support might be added in PHP 7.4.4 or later.  We're currently
investigating.

> […] tried to compile locally and failed because of this:

That code is not supposed to be compiled, because MYSQLND_HAVE_SSL
is not supposed to be defined.

[1] <https://github.com/php/php-src/pull/5129>
 [2020-02-14 15:25 UTC] nikic@php.net
@cmb: You may want to land the VLA part of that PR independently, so at least custom compiles (linked against openssl) work.
 [2020-02-18 15:20 UTC] nikic@php.net
I've removed the VLA uses now, so it should be possible to do a custom build now.
 [2020-02-25 18:24 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Native Windows support for mysqlnd sha256 authentification
On GitHub:  https://github.com/php/php-src/pull/5210
Patch:      https://github.com/php/php-src/pull/5210.patch
 [2020-03-02 15:38 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-03-02 15:38 UTC] cmb@php.net
The PR has been merged; Windows support for sha256_password and
caching_sha2_password authentication is supposed to be available
as of PHP 7.4.4.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Mar 31 23:01:23 2020 UTC