Uh oh!
There was an error while loading. Please reload this page.
Add Windows support for caching_sha2_password - #5129
Conversation
This requires OpenSSL to be linked to php*.dll. We also add an `alloca()` based fallback for MSVC (and potentially other compilers), which does not support variable length arrays.
Uh oh!
There was an error while loading. Please reload this page.
nikic
commented
Jan 29, 2020
LG from my side. |
andreyhristov
commented
Jan 29, 2020
LGTM |
cmb69
commented
Jan 29, 2020
Thanks for reviewing! I'm not absolutely sure regarding the dependency on OpenSSL (libcrypto.dll). |
KalleZ
commented
Jan 29, 2020
@cmb69 perhaps we should look at a builtin ext/openssl, but I do wonder about the binary size increase if we are do that but it would make cases like these a lot easier (similar to how we did with ext/hash) |
cmb69
commented
Jan 30, 2020
cmb69
commented
Jan 30, 2020
Closing and re-opening to trigger CI. |
nikic
commented
Jan 30, 2020
That would add a hard dependency on openssl, which is definitely not an option. This only worked for ext/hash because it has no dependencies. |
cmb69
commented
Jan 30, 2020
Ah, I see. |
cmb69
commented
Jan 31, 2020
So this PR is not an option as well. Building ext/mysqlnd statically is also likely not an option for BC reasons. So it seems for caching_sha2_password support on Windows, we have to use the CryptoAPI. I'll try to come up with a solution, but that is highly unlikely to make into PHP 7.4.3RC1. Sorry. |
nikic
commented
Jan 31, 2020
My comment was referring to making PHP have a hard dep on openssl in general. I don't really see an issue with having it as a dependency on our standard Windows builds, as long as you can still disable it if you really want to. We just shouldn't have any hard dependencies in a "minimal" PHP build, beyond libc. |
cmb69
commented
Feb 1, 2020
To disable it, you would have to build PHP yourself, and AFAIK, almost nobody does that. And anybody using a standard Windows build, would suddenly (in a revision release) have a hard dependency on OpenSSL, even if they don't use it (nor mysqlnd). I don't think we should go this way. Run-time linking (dl() etc.) might be an option, but that is somewhat brittle per se. |
SugarD-x
commented
Feb 24, 2020
Was this ever fixed? I noticed PHP 7.4.3 is out, but this is something that wasn't mentioned in the changelog. (The fix for the non-Windows version wasn't mentioned in the changelog in any of the previous releases either, so it is hard to tell). |
cmb69
commented
Feb 24, 2020
No, not yet fixed for Windows. See https://bugs.php.net/bug.php?id=79275 for progress. |
nikic
commented
Feb 24, 2020
@cmb69 Just to calibrate expectations, are there any plans to make this available on Windows in 7.4.x? |
cmb69
commented
Feb 24, 2020
@nikic, yes, at least if it's possible by using native Windows crypto APIs (which seems to be). |
SugarD-x
commented
Feb 24, 2020
I hope that is the case. I've been waiting for this since 7.2.8! :) |
cmb69
commented
Feb 25, 2020
See PR #5210. |
This requires OpenSSL to be linked to php*.dll. We also add an
alloca()based fallback for MSVC (and potentially other compilers),which does not support variable length arrays.