Bug #77440 [Opn]: ldap_bind using ldaps or ldap_start_tls()=exception in libcrypto-1_1-x64.dll
| From: | tsimmons at gmail dot com | Date: | Fri, 11 Jan 2019 15:00:22 +0000 |
| Subject: | Bug #77440 [Opn]: ldap_bind using ldaps or ldap_start_tls()=exception in libcrypto-1_1-x64.dll | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-218912@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77440&edit=1
ID: 77440
User updated by: tsimmons at gmail dot com
Reported by: tsimmons at gmail dot com
Summary: ldap_bind using ldaps or ldap_start_tls()=exception
in libcrypto-1_1-x64.dll
Status: Open
Type: Bug
Package: OpenSSL related
Operating System: Windows 2008 R2, 64-bit
PHP Version: 7.2.14
Block user comment: N
Private report: N
New Comment:
Perhaps it's related to this OpenLDAP bug? http://www.openldap.org/lists/openldap-bugs/201810/msg00000.html
... seems similar.
Previous Comments:
------------------------------------------------------------------------
[2019-01-11 14:20:12] tsimmons at gmail dot com
Here is the backtrace running from command line:
>libcrypto-1_1-x64.dll!000007fee18a3708() Unknown
libssl-1_1-x64.dll!000007fee8e7a422() Unknown
php_ldap.dll!tlso_sb_setup(sockbuf_io_desc * sbiod, void * arg) Line 873 C
[External Code]
php_ldap.dll!tlso_sb_remove(sockbuf_io_desc * sbiod) Line 885 C
php_ldap.dll!ber_sockbuf_remove_io(sockbuf * sb, sockbuf_io * sbio, int layer) Line 229 C
php_ldap.dll!ldap_int_tls_connect(ldap * ld, ldap_conn * conn) Line 392 C
php_ldap.dll!ldap_int_tls_start(ldap * ld, ldap_conn * conn, ldap_url_desc * srv) Line 932 C
php_ldap.dll!ldap_int_open_connection(ldap * ld, ldap_conn * conn, ldap_url_desc * srv, int async)
Line 450 C
php_ldap.dll!ldap_new_connection(ldap * ld, ldap_url_desc * * srvlist, int use_ldsb, int connect,
ldapreqinfo * bind, int m_req, int m_res) Line 488 C
php_ldap.dll!ldap_open_defconn(ldap * ld) Line 41 C
php_ldap.dll!ldap_send_initial_request(ldap * ld, unsigned __int64 msgtype, const char * dn,
berelement * ber, int msgid) Line 130 C
php_ldap.dll!ldap_sasl_bind(ldap * ld, const char * dn, const char * mechanism, berval * cred,
ldapcontrol * * sctrls, ldapcontrol * * cctrls, int * msgidp) Line 164 C
php_ldap.dll!ldap_sasl_bind_s(ldap * ld, const char * dn, const char * mechanism, berval * cred,
ldapcontrol * * sctrls, ldapcontrol * * cctrls, berval * * servercredp) Line 200 C
php_ldap.dll!zif_ldap_bind(_zend_execute_data * execute_data, _zval_struct * return_value) Line 631
C
php7.dll!ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER(_zend_execute_data * execute_data) Line 627 C
php7.dll!execute_ex(_zend_execute_data * ex) Line 59739 C
php7.dll!zend_execute(_zend_op_array * op_array, _zval_struct * return_value) Line 63777 C
php7.dll!zend_execute_scripts(int type, _zval_struct * retval, int file_count, ...) Line 1503 C
php7.dll!php_execute_script(_zend_file_handle * primary_file) Line 2587 C
php.exe!do_cli(int argc, char * * argv) Line 1012 C
php.exe!main(int argc, char * * argv) Line 1403 C
[External Code]
------------------------------------------------------------------------
[2019-01-11 14:06:46] tsimmons at gmail dot com
If you revert just the two files:
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
to version 1.1.0i (distributed with PHP 7.2.13) or 1.1.0j (available from http://wiki.overbyte.eu/wiki/index.php/ICS_Download#Download_OpenSSL_Binaries_.28required_for_SSL-enabled_components.29)
it works fine. I tried downloading other 1.1.1? binaries from https://bintray.com/vszakats/generic/openssl
and http://wiki.overbyte.eu/wiki/index.php/ICS_Download#Download_OpenSSL_Binaries_.28required_for_SSL-enabled_components.29
but those didn't work either. Not sure if this is a PHP or OpenSSL issue.
------------------------------------------------------------------------
[2019-01-11 13:40:27] ab@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
------------------------------------------------------------------------
[2019-01-10 23:25:10] jbrady at sbccd dot org
Was just going to post this. I'm having this issue as well. Exact same setup.
------------------------------------------------------------------------
[2019-01-10 21:28:08] tsimmons at gmail dot com
Description:
------------
When trying to either ldap_bind() to a server that was connected using
ldap_connect("ldaps://ldapserver:636") syntax, or by using the ldap_start_tls() function,
you get an unhandled exception in libcrypto-1_1-x64.dll. Code works fine in PHP 7.2.13. This error
occurs with the downloaded PHP 7.2.14 NTS, x64.
Test script:
---------------
$server = "ldaps://ldapserver:636";
putenv('LDAPTLS_REQCERT=allow');
$con = ldap_connect($server);
if(!$con) {
ldap_get_option($con, LDAP_OPT_DIAGNOSTIC_MESSAGE, $err);
return(false);
}
ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($con, LDAP_OPT_REFERRALS, 0);
$ldaprdn = "ldapuser@domain.local";
$ldapbind = ldap_bind($con, $ldaprdn, $oldPassword); // THIS LINE CRASHES WITH: Unhandled exception
at 0x000007FEE4153708 (libcrypto-1_1-x64.dll) in php.exe: 0xC0000005: Access violation reading
location 0xFFFFFFFFFFFFFFFF.
Expected result:
----------------
Should bind without error.
Actual result:
--------------
Unhandled exception at 0x000007FEE4153708 (libcrypto-1_1-x64.dll) in php.exe: 0xC0000005: Access
violation reading location 0xFFFFFFFFFFFFFFFF.
Exception thrown at 0x000007FEE4153708 (libcrypto-1_1-x64.dll) in php.exe: 0xC0000005: Access
violation reading location 0xFFFFFFFFFFFFFFFF.
The program '[4264] php.exe' has exited with code 0 (0x0).
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77440&edit=1