php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #76238 Warning when compiling with latest OpenSSL and XML libraries
Submitted: 2018-04-18 17:05 UTC Modified: 2021-09-19 04:22 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: dev dot dertin at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: Compile Warning
PHP Version: 7.2.4 OS: Debian 9
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dev dot dertin at gmail dot com
New email:
PHP Version: OS:

 

 [2018-04-18 17:05 UTC] dev dot dertin at gmail dot com
Description:
------------
PHP 7.2.4
- OpenSSL 1.1.0h
- LibXML2 2.9.8
- Libxslt 1.1.33-rc1

I wonder if you can avoid these warning by creating a patch. Those related to OpenSSL don't worry me so much, but the XML library I don't know which impact it has, and if this can cause a problem.

Test script:
---------------
https://travis-ci.org/dertin/lemp-stack-debian

Actual result:
--------------
/var/tmp/php_build/php_src/ext/openssl/xp_ssl.c: In function 'php_openssl_select_crypto_method':
/var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:963:3: warning: 'TLSv1_client_method' is deprecated [-Wdeprecated-declarations]
   return is_client ? TLSv1_client_method() : TLSv1_server_method();
   ^~~~~~
In file included from /usr/local/include/openssl/ct.h:13:0,
                 from /usr/local/include/openssl/ssl.h:61,
                 from /var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:34:
/usr/local/include/openssl/ssl.h:1629:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_client_method(void)) /* TLSv1.0 */
 ^
/var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:963:3: warning: 'TLSv1_server_method' is deprecated [-Wdeprecated-declarations]
   return is_client ? TLSv1_client_method() : TLSv1_server_method();
   ^~~~~~
In file included from /usr/local/include/openssl/ct.h:13:0,
                 from /usr/local/include/openssl/ssl.h:61,
                 from /var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:34:
/usr/local/include/openssl/ssl.h:1628:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_server_method(void)) /* TLSv1.0 */
 36m^
/var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:966:3: warning: 'TLSv1_1_client_method' is deprecated [-Wdeprecated-declarations]
   return is_client ? TLSv1_1_client_method() : TLSv1_1_server_method();
   ^~~~~~
In file included from /usr/local/include/openssl/ct.h:13:0,
                 from /usr/local/include/openssl/ssl.h:61,
                 from /var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:34:
/usr/local/include/openssl/ssl.h:1635:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_client_method(void)) /* TLSv1.1 */
 ^
/var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:966:3: warning: 'TLSv1_1_server_method' is deprecated [-Wdeprecated-declarations]
   return is_client ? TLSv1_1_client_method() : TLSv1_1_server_method();
   ^~~~~~
In file included from /usr/local/include/openssl/ct.h:13:0,
                 from /usr/local/include/openssl/ssl.h:61,
                 from /var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:34:
/usr/local/include/openssl/ssl.h:1634:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_server_method(void)) /* TLSv1.1 */
 ^
/var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:974:3: Kwarning: 'TLSv1_2_client_method' is deprecated [-Wdeprecated-declarations]
   return is_client ? TLSv1_2_client_method() : TLSv1_2_server_method();
   ^~~~~~
In file included from /usr/local/include/openssl/ct.h:13:0,
                 from /usr/local/include/openssl/ssl.h:61,
                 from /var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:34:
/usr/local/include/openssl/ssl.h:1641:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_client_method(void)) /* TLSv1.2 */
 ^
/var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:974:3: warning: 'TLSv1_2_server_method' is deprecated [-Wdeprecated-declarations]
   return is_client ? TLSv1_2_client_method() : TLSv1_2_server_method();
   ^~~~~~
In file included from /usr/local/include/openssl/ct.h:13:0,
                 from /usr/local/include/openssl/ssl.h:61,
                 from /var/tmp/php_build/php_src/ext/openssl/xp_ssl.c:34:
/usr/local/include/openssl/ssl.h:1640:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_server_method(void)) /* TLSv1.2 */
 ^
/var/tmp/php_build/php_src/ext/dom/dom_iterators.c: In function 'php_dom_libxml_hash_iter':
/var/tmp/php_build/php_src/ext/dom/dom_iterators.c:94:19: warning: passing argument 2 of 'xmlHashScan' from incompatible pointer type [-Wincompatible-pointer-types]
   xmlHashScan(ht, itemHashScanner, iter);
                   ^~~~~~~~~~~~~~~
In file included from /usr/local/include/libxml2/libxml/parser.h:18:0,
                 from /var/tmp/php_build/php_src/ext/dom/php_dom.h:33,
                 from /var/tmp/php_build/php_src/ext/dom/dom_iterators.c:28:
/usr/local/include/libxml2/libxml/hash.h:212:4: note: expected 'xmlHashScanner {aka void (*)(void *, void *, const unsigned char *)}' but argument is of type 'void (*)(void *, void *, xmlChar *) {aka void (*)(void *, void *, unsigned char *)}'
    xmlHashScan (xmlHashTablePtr table,
    ^~~~~~~~~~~
/var/tmp/php_build/php_src/ext/dom/dom_iterators.c: In function 'php_dom_libxml_notation_iter':
/var/tmp/php_build/php_src/ext/dom/dom_iterators.c:115:19: warning: passing argument 2 of 'xmlHashScan' from incompatible pointer type [-Wincompatible-pointer-types]
   xmlHashScan(ht, itemHashScanner, iter);
                   ^~~~~~~~~~~~~~~
In file included from /usr/local/include/libxml2/libxml/parser.h:18:0,
                 from /var/tmp/php_build/php_src/ext/dom/php_dom.h:33,
                 from /var/tmp/php_build/php_src/ext/dom/dom_iterators.c:28:
/usr/local/include/libxml2/libxml/hash.h:212:4: note: expected 'xmlHashScanner {aka void (*)(void *, void *, const unsigned char *)}' but argument is of type 'void (*)(void *, void *, xmlChar *) {aka void (*)(void *, void *, unsigned char *)}'
    xmlHashScan (xmlHashTablePtr table,
    ^~~~~~~~~~~
/var/tmp/php_build/php_src/ext/intl/idn/idn.c: In function 'php_intl_idn_to':
/var/tmp/php_build/php_src/ext/intl/idn/idn.c:227:4: warning: 'uidna_IDNToASCII_57' is deprecated [-Wdeprecated-declarations]
    converted_ret_len = uidna_IDNToASCII(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
    ^~~~~~~~~~~~~~~~~
In file included from /usr/include/unicode/platform.h:23:0,
                 from /usr/include/unicode/ptypes.h:50,
                 from /usr/include/unicode/umachine.h:44,
                 from /usr/include/unicode/utypes.h:36,
                 from /usr/include/unicode/uidna.h:20,
                 from /var/tmp/php_build/php_src/ext/intl/idn/idn.c:28:
/usr/include/unicode/uidna.h:673:1: note: declared here
 uidna_IDNToASCII(  const UChar* src, int32_t srcLength,
 ^
/var/tmp/php_build/php_src/ext/intl/idn/idn.c:229:4: warning: 'uidna_IDNToUnicode_57' is deprecated [-Wdeprecated-declarations]
    converted_ret_len = uidna_IDNToUnicode(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
    ^~~~~~~~~~~~~~~~~
In file included from /usr/include/unicode/platform.h:23:0,
                 from /usr/include/unicode/umachine.h:44,
                 from /usr/include/unicode/utypes.h:36,
                 from /usr/include/unicode/uidna.h:20,
                 from /var/tmp/php_build/php_src/ext/intl/idn/idn.c:28:
/usr/include/unicode/uidna.h:720:1: note: declared here
 uidna_IDNToUnicode(  const UChar* src, int32_t srcLength,
 ^
/var/tmp/php_build/php_src/ext/session/mod_files.c: In function 'ps_files_cleanup_dir':
/var/tmp/php_build/php_src/ext/session/mod_files.c:315:2: warning: 'readdir_r' is deprecated [-Wdeprecated-declarations]
  while (php_readdir_r(dir, (struct dirent *) dentry, &entry) == 0 && entry) {
  ^~~~~
In file included from /var/tmp/php_build/php_src/Zend/zend_virtual_cwd.h:78:0,
                 from /var/tmp/php_build/php_src/main/php.h:470,
                 from /var/tmp/php_build/php_src/ext/session/mod_files.c:55:
/usr/include/dirent.h:183:12: note: declared here
 extern int readdir_r (DIR *__restrict __dirp,
            ^~~~~~~~~
/var/tmp/php_build/php_src/main/streams/plain_wrapper.c: In function 'php_plain_files_dirstream_read':
/var/tmp/php_build/php_src/main/streams/plain_wrapper.c:908:2: warning: 'readdir_r' is deprecated [-Wdeprecated-declarations]
  if (php_readdir_r(dir, (struct dirent *)entry, &result) == 0 && result) {
  ^~
In file included from /var/tmp/php_build/php_src/Zend/zend_virtual_cwd.h:78:0,
                 from /var/tmp/php_build/php_src/main/php.h:470,
                 from /var/tmp/php_build/php_src/main/streams/plain_wrapper.c:21:
/usr/include/dirent.h:183:12: note: declared here
 extern int readdir_r (DIR *__restrict __dirp,
            ^~~~~~~~~

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-18 22:14 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2018-04-18 22:14 UTC] cmb@php.net
Thanks for reporting this issue!  Unless I've overlooked
something, there are acutally four issues:

  (1) TLSv(1|)_(client|server)_method are deprecated
  (2) passing argument 2 of 'xmlHashScan' from incompatible pointer type
  (3) uidna_IDNTo(ASCII|Unicode) are deprecated
  (4) readdir_r is deprecated

(2) does not appear to be a problem, since itemHashScanner[1] does
not even use the name parameter, so declaring that as `const
xmlChar *name` should cure the compiler warning.  (It seems that
the documentation of xmlHashScanner [2] does not fit the
implementation; a distro issue?)

(3) can easily be resolved when INTL_IDNA_VARIANT_2003 will be
removed[3].  Until then there may not be the need to take any
action from our side.

[1] <https://github.com/php/php-src/blob/PHP-7.2.5/ext/dom/dom_iterators.c#L45>
[2] <http://xmlsoft.org/html/libxml-hash.html#xmlHashScanner>
[3] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
 [2018-04-19 16:15 UTC] cmb@php.net
> It seems that the documentation of xmlHashScanner does not fit
> the implementation; a distro issue?

FTR: the prototype has been changed as of libxml 2.9.8[1].

[1] <https://github.com/GNOME/libxml2/commit/e03f0a199a67017b2f8052354cf732b2b4cae787#diff-7eff597457d578c6e602a3b6dc3d2f03R88>
 [2018-05-02 12:46 UTC] r1d3r at abv dot bg
on ubuntu 18.04 curl which has certificate stopped working for me. I am hoping that those openssl warnings are going to be resolved and curl_setopt($ch, CURLOPT_SSLCERT, $pemfile);  will start working again
 [2021-09-10 13:50 UTC] cmb@php.net
-Status: Verified +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-09-10 13:50 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-09-19 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 06:01:29 2024 UTC