Bug #74378 [NEW]: Compilation with OPENSSL_API_COMPAT >= 0x10100000L fails
| From: | pgnet dot dev at gmail dot com | Date: | Wed, 05 Apr 2017 20:44:51 +0000 |
| Subject: | Bug #74378 [NEW]: Compilation with OPENSSL_API_COMPAT >= 0x10100000L fails | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-208349@lists.php.net to get a copy of this message | ||
From: pgnet dot dev at gmail dot com
Operating system: any
PHP version: master-Git-2017-04-05 (Git)
Package: OpenSSL related
Bug Type: Bug
Bug description:Compilation with OPENSSL_API_COMPAT >= 0x10100000L fails
Description:
------------
With php HEAD, build on linux64 + openssl 1.1 (./config --api=1.1.0 ...)
currently FAILS.
[referred from:
Bug #72360 ext/openssl build failure with OpenSSL 1.1.0
https://bugs.php.net/bug.php?id=72360&edit=2
]
Actual result:
--------------
[referred from:
Bug #72360 ext/openssl build failure with OpenSSL 1.1.0
https://bugs.php.net/bug.php?id=72360&edit=2
]
With php HEAD
cd /work/php-src
git clean -xfd
git reset --hard HEAD
git checkout master
git log | head
nominally *requires* this fix
perl -pi -e '\
s|SSLeay_version\(SSLEAY_VERSION\)|OpenSSL_version\(OPENSSL_VERSION\)|g'
\
/work/php-src/ext/openssl/openssl.c
then, with simple config
export PHP_RPATHS="/usr/local/openssl11/lib64"
./buildconf --force
./configure \
--disable-all \
--with-openssl=/usr/local/openssl11
builds, with lots of warnings, but no apparent errors
make V=1
/bin/sh /work/php-src/libtool --silent --preserve-dup-deps
--mode=compile /usr/bin/gcc-6 -Iext/openssl/
-I/work/php-src/ext/openssl/ -DPHP_ATOM_INC -I/work/php-src/include
-I/work/php-src/main -I/work/php-src -I/work/php-src/ext/date/lib
-I/usr/local/openssl11/include -I/work/php-src/TSRM -I/work/php-src/Zend
-O3 -Wall -fstack-protector -funwind-tables
-fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches
-march=native -mtune=native -fPIC -DPIC -D_GNU_SOURCE
-fno-strict-aliasing -fvisibility=hidden -DZEND_SIGNALS -c
/work/php-src/ext/openssl/openssl.c -o ext/openssl/openssl.lo
/work/php-src/ext/openssl/openssl.c: In function
âadd_assoc_name_entryâ:
/work/php-src/ext/openssl/openssl.c:859:13: warning: implicit
declaration of function âASN1_STRING_dataâ
[-Wimplicit-function-declaration]
to_add = ASN1_STRING_data(str);
^~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:859:11: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
to_add = ASN1_STRING_data(str);
^
/work/php-src/ext/openssl/openssl.c: In function
âasn1_time_to_time_tâ:
/work/php-src/ext/openssl/openssl.c:921:28: warning: cast to pointer
from integer of different size [-Wint-to-pointer-cast]
if (timestr_len != strlen((const char*)ASN1_STRING_data(timestr)))
{
^
In file included from /work/php-src/Zend/zend.h:31:0,
from /work/php-src/main/php.h:35,
from /work/php-src/ext/openssl/openssl.c:30:
/work/php-src/ext/openssl/openssl.c:936:19: warning: cast to pointer
from integer of different size [-Wint-to-pointer-cast]
strbuf = estrdup((char *)ASN1_STRING_data(timestr));
^
/work/php-src/Zend/zend_alloc.h:172:36: note: in definition of macro
âestrdupâ
#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC
ZEND_FILE_LINE_EMPTY_CC)
^
/work/php-src/ext/openssl/openssl.c: In function
âzm_startup_opensslâ:
/work/php-src/ext/openssl/openssl.c:1402:2: warning: implicit
declaration of function âSSL_library_initâ
[-Wimplicit-function-declaration]
SSL_library_init();
^~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:1403:2: warning: implicit
declaration of function âOpenSSL_add_all_ciphersâ
[-Wimplicit-function-declaration]
OpenSSL_add_all_ciphers();
^~~~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:1404:2: warning: implicit
declaration of function âOpenSSL_add_all_digestsâ
[-Wimplicit-function-declaration]
OpenSSL_add_all_digests();
^~~~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:1405:2: warning: implicit
declaration of function âOpenSSL_add_all_algorithmsâ
[-Wimplicit-function-declaration]
OpenSSL_add_all_algorithms();
^~~~~~~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:1413:2: warning: implicit
declaration of function âSSL_load_error_stringsâ
[-Wimplicit-function-declaration]
SSL_load_error_strings();
^~~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c: In function
âzm_shutdown_opensslâ:
/work/php-src/ext/openssl/openssl.c:1577:2: warning: implicit
declaration of function âEVP_cleanupâ
[-Wimplicit-function-declaration]
EVP_cleanup();
^~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:1580:2: warning: implicit
declaration of function âCRYPTO_set_locking_callbackâ
[-Wimplicit-function-declaration]
CRYPTO_set_locking_callback(NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:1582:2: warning: implicit
declaration of function âERR_free_stringsâ
[-Wimplicit-function-declaration]
ERR_free_strings();
^~~~~~~~~~~~~~~~
In file included from /work/php-src/main/php.h:39:0,
from /work/php-src/ext/openssl/openssl.c:30:
/work/php-src/ext/openssl/openssl.c: In function
âzif_openssl_spki_export_challengeâ:
/work/php-src/ext/openssl/openssl.c:2045:16: warning: cast to pointer
from integer of different size [-Wint-to-pointer-cast]
RETVAL_STRING((char *) ASN1_STRING_data(spki->spkac->challenge));
^
/work/php-src/Zend/zend_API.h:592:21: note: in definition of macro
âZVAL_STRINGâ
const char *_s = (s); \
^
/work/php-src/ext/openssl/openssl.c:2045:2: note: in expansion of
macro âRETVAL_STRINGâ
RETVAL_STRING((char *) ASN1_STRING_data(spki->spkac->challenge));
^~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c: In function
âopenssl_x509v3_subjectAltNameâ:
/work/php-src/ext/openssl/openssl.c:2236:20: warning: passing argument
2 of âBIO_writeâ makes pointer from integer without a cast
[-Wint-conversion]
BIO_write(bio, ASN1_STRING_data(as),
^~~~~~~~~~~~~~~~
In file included from
/usr/local/openssl11/include/openssl/err.h:21:0,
from /work/php-src/ext/openssl/php_openssl.h:49,
from /work/php-src/ext/openssl/openssl.c:32:
/usr/local/openssl11/include/openssl/bio.h:549:5: note: expected
âconst void *â but argument is of type âintâ
int BIO_write(BIO *b, const void *data, int len);
^~~~~~~~~
/work/php-src/ext/openssl/openssl.c:2242:20: warning: passing argument
2 of âBIO_writeâ makes pointer from integer without a cast
[-Wint-conversion]
BIO_write(bio, ASN1_STRING_data(as),
^~~~~~~~~~~~~~~~
In file included from
/usr/local/openssl11/include/openssl/err.h:21:0,
from /work/php-src/ext/openssl/php_openssl.h:49,
from /work/php-src/ext/openssl/openssl.c:32:
/usr/local/openssl11/include/openssl/bio.h:549:5: note: expected
âconst void *â but argument is of type âintâ
int BIO_write(BIO *b, const void *data, int len);
^~~~~~~~~
/work/php-src/ext/openssl/openssl.c:2248:20: warning: passing argument
2 of âBIO_writeâ makes pointer from integer without a cast
[-Wint-conversion]
BIO_write(bio, ASN1_STRING_data(as),
^~~~~~~~~~~~~~~~
In file included from
/usr/local/openssl11/include/openssl/err.h:21:0,
from /work/php-src/ext/openssl/php_openssl.h:49,
from /work/php-src/ext/openssl/openssl.c:32:
/usr/local/openssl11/include/openssl/bio.h:549:5: note: expected
âconst void *â but argument is of type âintâ
int BIO_write(BIO *b, const void *data, int len);
^~~~~~~~~
/work/php-src/ext/openssl/openssl.c: In function
âzif_openssl_x509_parseâ:
/work/php-src/ext/openssl/openssl.c:2340:52: warning: implicit
declaration of function âX509_get_notBeforeâ
[-Wimplicit-function-declaration]
add_assoc_asn1_string(return_value, "validFrom",
X509_get_notBefore(cert));
^~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:2340:52: warning: passing argument
3 of âadd_assoc_asn1_stringâ makes pointer from integer without a
cast [-Wint-conversion]
/work/php-src/ext/openssl/openssl.c:892:13: note: expected
âASN1_STRING * {aka struct asn1_string_st *}â but argument is of
type âintâ
static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING
* str) /* {{{ */
^~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:2341:51: warning: implicit
declaration of function âX509_get_notAfterâ
[-Wimplicit-function-declaration]
add_assoc_asn1_string(return_value, "validTo",
X509_get_notAfter(cert));
^~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:2341:51: warning: passing argument
3 of âadd_assoc_asn1_stringâ makes pointer from integer without a
cast [-Wint-conversion]
/work/php-src/ext/openssl/openssl.c:892:13: note: expected
âASN1_STRING * {aka struct asn1_string_st *}â but argument is of
type âintâ
static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING
* str) /* {{{ */
^~~~~~~~~~~~~~~~~~~~~
In file included from /work/php-src/main/php.h:39:0,
from /work/php-src/ext/openssl/openssl.c:30:
/work/php-src/ext/openssl/openssl.c:2343:72: warning: passing argument
1 of âasn1_time_to_time_tâ makes pointer from integer without a cast
[-Wint-conversion]
add_assoc_long(return_value, "validFrom_time_t",
asn1_time_to_time_t(X509_get_notBefore(cert)));
^
/work/php-src/Zend/zend_API.h:413:90: note: in definition of macro
âadd_assoc_longâ
define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg,
__key, strlen(__key), __n)
^~~
/work/php-src/ext/openssl/openssl.c:898:15: note: expected
âASN1_UTCTIME * {aka struct asn1_string_st *}â but argument is of
type âintâ
static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
^~~~~~~~~~~~~~~~~~~
In file included from /work/php-src/main/php.h:39:0,
from /work/php-src/ext/openssl/openssl.c:30:
/work/php-src/ext/openssl/openssl.c:2344:71: warning: passing argument
1 of âasn1_time_to_time_tâ makes pointer from integer without a cast
[-Wint-conversion]
add_assoc_long(return_value, "validTo_time_t",
asn1_time_to_time_t(X509_get_notAfter(cert)));
^
/work/php-src/Zend/zend_API.h:413:90: note: in definition of macro
âadd_assoc_longâ
define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg,
__key, strlen(__key), __n)
^~~
/work/php-src/ext/openssl/openssl.c:898:15: note: expected
âASN1_UTCTIME * {aka struct asn1_string_st *}â but argument is of
type âintâ
static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
^~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c: In function
âzif_openssl_csr_signâ:
/work/php-src/ext/openssl/openssl.c:3421:18: warning: passing argument
1 of âX509_gmtime_adjâ makes pointer from integer without a cast
[-Wint-conversion]
X509_gmtime_adj(X509_get_notBefore(new_cert), 0);
^~~~~~~~~~~~~~~~~~
In file included from /work/php-src/ext/openssl/openssl.c:50:0:
/usr/local/openssl11/include/openssl/x509.h:479:12: note: expected
âASN1_TIME * {aka struct asn1_string_st *}â but argument is of type
âintâ
ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);
^~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c:3422:18: warning: passing argument
1 of âX509_gmtime_adjâ makes pointer from integer without a cast
[-Wint-conversion]
X509_gmtime_adj(X509_get_notAfter(new_cert),
60*60*24*(long)num_days);
^~~~~~~~~~~~~~~~~
In file included from /work/php-src/ext/openssl/openssl.c:50:0:
/usr/local/openssl11/include/openssl/x509.h:479:12: note: expected
âASN1_TIME * {aka struct asn1_string_st *}â but argument is of type
âintâ
ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);
^~~~~~~~~~~~~~~
/work/php-src/ext/openssl/openssl.c: In function
âzif_openssl_sealâ:
/work/php-src/ext/openssl/openssl.c:5886:2: warning: implicit
declaration of function âEVP_CIPHER_CTX_cleanupâ
[-Wimplicit-function-declaration]
EVP_CIPHER_CTX_cleanup(ctx);
^~~~~~~~~~~~~~~~~~~~~~
/bin/sh /work/php-src/libtool --silent --preserve-dup-deps
--mode=compile /usr/bin/gcc-6 -Iext/openssl/
-I/work/php-src/ext/openssl/ -DPHP_ATOM_INC -I/work/php-src/include
-I/work/php-src/main -I/work/php-src -I/work/php-src/ext/date/lib
-I/usr/local/openssl11/include -I/work/php-src/TSRM -I/work/php-src/Zend
-O3 -Wall -fstack-protector -funwind-tables
-fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches
-march=native -mtune=native -fPIC -DPIC -D_GNU_SOURCE
-fno-strict-aliasing -fvisibility=hidden -DZEND_SIGNALS -c
/work/php-src/ext/openssl/xp_ssl.c -o ext/openssl/xp_ssl.lo
/work/php-src/ext/openssl/xp_ssl.c: In function
âphp_select_crypto_methodâ:
/work/php-src/ext/openssl/xp_ssl.c:946:22: warning: implicit
declaration of function âTLSv1_client_methodâ
[-Wimplicit-function-declaration]
return is_client ? TLSv1_client_method() : TLSv1_server_method();
^~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c:946:46: warning: implicit
declaration of function âTLSv1_server_methodâ
[-Wimplicit-function-declaration]
return is_client ? TLSv1_client_method() : TLSv1_server_method();
^~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c:946:44: warning: return makes
pointer from integer without a cast [-Wint-conversion]
return is_client ? TLSv1_client_method() : TLSv1_server_method();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c:949:22: warning: implicit
declaration of function âTLSv1_1_client_methodâ
[-Wimplicit-function-declaration]
return is_client ? TLSv1_1_client_method() :
TLSv1_1_server_method();
^~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c:949:48: warning: implicit
declaration of function âTLSv1_1_server_methodâ
[-Wimplicit-function-declaration]
return is_client ? TLSv1_1_client_method() :
TLSv1_1_server_method();
^~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c:949:46: warning: return makes
pointer from integer without a cast [-Wint-conversion]
return is_client ? TLSv1_1_client_method() :
TLSv1_1_server_method();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c:957:22: warning: implicit
declaration of function âTLSv1_2_client_methodâ
[-Wimplicit-function-declaration]
return is_client ? TLSv1_2_client_method() :
TLSv1_2_server_method();
^~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c:957:48: warning: implicit
declaration of function âTLSv1_2_server_methodâ
[-Wimplicit-function-declaration]
return is_client ? TLSv1_2_client_method() :
TLSv1_2_server_method();
^~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c:957:46: warning: return makes
pointer from integer without a cast [-Wint-conversion]
return is_client ? TLSv1_2_client_method() :
TLSv1_2_server_method();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c: In function
âphp_openssl_sockop_set_optionâ:
/work/php-src/ext/openssl/xp_ssl.c:1867:22: warning:
âcert_capturedâ may be used uninitialized in this function
[-Wmaybe-uninitialized]
if (n && peer_cert && cert_captured == 0) {
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/work/php-src/ext/openssl/xp_ssl.c:1737:6: note: âcert_capturedâ
was declared here
int cert_captured;
^~~~~~~~~~~~~
/bin/sh /work/php-src/libtool --silent --preserve-dup-deps --mode=link
/usr/bin/gcc
...
make install
ldd /usr/local/php-dev/bin/php | egrep "ssl|crypto"
libssl.so.1.1 => /usr/local/openssl11/lib64/libssl.so.1.1
(0x00007f8f58586000)
libcrypto.so.1.1 => /usr/local/openssl11/lib64/libcrypto.so.1.1
(0x00007f8f580dc000)
--
Edit bug report at https://bugs.php.net/bug.php?id=74378&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74378&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74378&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74378&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74378&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74378&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74378&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74378&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74378&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74378&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74378&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74378&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74378&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74378&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74378&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74378&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74378&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74378&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74378&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74378&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74378&r=mysqlcfg