Bug #2250

PHP OpenSSL CRL patch is missing from PHP 5.3, doesn't apply/build

Added by Jim P over 1 year ago. Updated 12 months ago.

Status:Resolved Start date:03/01/2012
Priority:Normal Due date:
Assignee:Jim P % Done:

0%

Category:-
Target version:-
Affected version:2.1 Affected Architecture:

Description

The OpenSSL CRL patch we have in pfPorts:
pfSense-tools/pfPorts/php52-openssl/patch-openssl.c

Does not apply cleanly to PHP 5.3, but we need that patch for CRL operations. I can fix the patch easy enough (attached) but it fails to compile, with the below error:

===>  Building for php5-openssl-5.3.10
/bin/sh /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/libtool --mode=compile cc  -I. -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -DPHP_ATOM_INC -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/include -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/main -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -O2 -pipe -fno-strict-aliasing   -c /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c -o openssl.lo
/bin/sh /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/libtool --mode=compile cc  -I. -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -DPHP_ATOM_INC -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/include -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/main -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -O2 -pipe -fno-strict-aliasing   -c /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/xp_ssl.c -o xp_ssl.lo
mkdir .libs
 cc -I. -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -DPHP_ATOM_INC -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/include -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/main -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c  -fPIC -DPIC -o .libs/openssl.o
 cc -I. -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -DPHP_ATOM_INC -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/include -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/main -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/xp_ssl.c  -fPIC -DPIC -o .libs/xp_ssl.o
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:436: error: 'second_arg_force_ref' undeclared here (not in a function)
*** Error code 1
1 error
*** Error code 1

Stop in /usr/ports/security/php5-openssl.

Guessing there is more that changed in PHP 5.3... There seems to be a PHP6 patch here: https://bugs.php.net/bug.php?id=40046
But I don't see an updated one for PHP 5.3

patch-openssl.c Magnifier (15.9 kB) Jim P, 03/01/2012 11:03 am

patch-openssl.c Magnifier (22.2 kB) Cyrill B, 03/03/2012 10:48 am

patch-php_openssl.h Magnifier (754 Bytes) Cyrill B, 03/03/2012 10:48 am

History

#1 Updated by Cyrill B over 1 year ago

I modified the patch but I don't have a build system to try if everything works.

#2 Updated by Cyrill B about 1 year ago

Applied in ac0fbb51

#3 Updated by Jim P about 1 year ago

Patch applies but does not build on i386 or amd64.

===>  Building for php5-openssl-5.3.10_1
/bin/sh /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/libtool --mode=compile cc  -I. -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -DPHP_ATOM_INC -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/include -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/main -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -O2 -pipe -fno-strict-aliasing   -c /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/xp_ssl.c -o xp_ssl.lo
/bin/sh /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/libtool --mode=compile cc  -I. -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -DPHP_ATOM_INC -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/include -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/main -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -O2 -pipe -fno-strict-aliasing   -c /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c -o openssl.lo
mkdir .libs
 cc -I. -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -DPHP_ATOM_INC -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/include -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/main -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c  -fPIC -DPIC -o .libs/openssl.o
 cc -I. -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -DPHP_ATOM_INC -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/include -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/main -I/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/xp_ssl.c  -fPIC -DPIC -o .libs/xp_ssl.o
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:538: error: expected identifier or '(' before '+' token
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:570: error: expected identifier or '(' before '+' token
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: In function 'zm_startup_openssl':
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:1068: error: 'php_crl_free' undeclared (first use in this function)
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:1068: error: (Each undeclared identifier is reported only once
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:1068: error: for each function it appears in.)
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: In function 'zif_openssl_crl_new':
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4493: error: invalid application of 'sizeof' to incomplete type 'struct php_x509_crl' 
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4494: error: invalid application of 'sizeof' to incomplete type 'struct php_x509_crl' 
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4495: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4498: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4499: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4506: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4508: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4509: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4516: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4516: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4518: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4519: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4529: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4532: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4533: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4537: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: At top level:
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4547: warning: 'struct php_x509_crl' declared inside parameter list
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4547: warning: its scope is only this definition or declaration, which is probably not what you want
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: In function 'php_crl_revoke_serial':
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4597: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4627: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: In function 'zif_openssl_crl_revoke_cert_by_serial':
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4669: warning: passing argument 1 of 'php_crl_revoke_serial' from incompatible pointer type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: In function 'zif_openssl_crl_revoke_cert':
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4715: warning: passing argument 1 of 'php_crl_revoke_serial' from incompatible pointer type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: At top level:
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4726: warning: 'struct php_x509_crl' declared inside parameter list
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: In function 'php_crl_generate':
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4740: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4741: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4742: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4756: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4759: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4760: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4767: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4779: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4785: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: In function 'zif_openssl_crl_export':
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4830: warning: passing argument 1 of 'php_crl_generate' from incompatible pointer type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4837: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4840: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c: In function 'zif_openssl_crl_export_file':
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4895: warning: passing argument 1 of 'php_crl_generate' from incompatible pointer type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4913: error: dereferencing pointer to incomplete type
/usr/ports/security/php5-openssl/work/php-5.3.10/ext/openssl/openssl.c:4916: error: dereferencing pointer to incomplete type
*** Error code 1
1 error
*** Error code 1

#4 Updated by Cyrill B about 1 year ago

There were some unnecessary plus signs. I made a new pull request.

#5 Updated by Jim P about 1 year ago

For some reason github isn't loading for me, I managed to push an update reverting the old commit because it wouldn't build, and building would have been broken had I left it. That was right before your fix came in. I can't get to github to see/approve the new pull request, but you might check it to make sure it will still apply. You may have to re-do it since the previous one was reverted.

#6 Updated by Cyrill B about 1 year ago

Ok, made a new patch and pull request.

#7 Updated by Jim P about 1 year ago

OK, the new one applies and builds. New snapshots is going now, we'll see what happens when it comes out.

#8 Updated by Jim P 12 months ago

  • Status changed from New to Feedback
  • Assignee set to Jim P

This is probably working but some tests to confirm wouldn't hurt.

#9 Updated by Jim P 12 months ago

  • Status changed from Feedback to Resolved

This is working now - Client connects OK, add to CRL, client is rejected. Remove from CRL, client can connect again.

Also available in: Atom PDF