[PHP-BUG] Bug #55362 [NEW]: X509_PURPOSE_ANY is not supported

2011-08-04 Thread anders at ingemann dot de
From: 
Operating system: Windows 7
PHP version:  5.3.6
Package:  OpenSSL related
Bug Type: Bug
Bug description:X509_PURPOSE_ANY is not supported

Description:

On http://www.php.net/manual/en/function.openssl-x509-checkpurpose.php the
purpose 
check X509_PURPOSE_ANY is mentioned and the constant is defined as well.
openssl_x509_checkpurpose() however reports error:0B086079:x509
certificate 
routines:X509_STORE_CTX_purpose_inherit:unknown purpose id.
Checking up in the documentation i can see that this purpose is not
supported 
(http://www.openssl.org/docs/apps/verify.html#COMMAND_OPTIONS). This
constant 
should be removed, and a note should be put in the documentation,
specifying that 
this is not supported.

Test script:
---
openssl_x509_checkpurpose( mixed $x509cert , X509_PURPOSE_ANY );
while($error = openssl_error_string()) echo $error.\n;

Expected result:

With a valid certificate openssl_x509_checkpurpose($cert, X509_PURPOSE_ANY)

returns true.

Actual result:
--
With a valid certificate openssl_x509_checkpurpose($cert, X509_PURPOSE_ANY)

returns false.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=55362edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55362r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55362r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=55362r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55362r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55362r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55362r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=55362r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=55362r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=55362r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=55362r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=55362r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=55362r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=55362r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55362r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=55362r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=55362r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=55362r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=55362r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=55362r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=55362r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=55362r=mysqlcfg



Bug #55362 [Opn]: X509_PURPOSE_ANY is not recognized by openssl

2011-08-04 Thread anders at ingemann dot de
Edit report at https://bugs.php.net/bug.php?id=55362edit=1

 ID: 55362
 User updated by:anders at ingemann dot de
 Reported by:anders at ingemann dot de
-Summary:X509_PURPOSE_ANY is not supported
+Summary:X509_PURPOSE_ANY is not recognized by openssl
 Status: Open
 Type:   Bug
 Package:OpenSSL related
 Operating System:   Windows 7
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

I just found out that the any purpose IS actually supported, but it is simply 
not documented. It seems the constant is somehow referring to a wrong value.


Previous Comments:

[2011-08-04 12:14:53] anders at ingemann dot de

Description:

On http://www.php.net/manual/en/function.openssl-x509-checkpurpose.php the 
purpose 
check X509_PURPOSE_ANY is mentioned and the constant is defined as well.
openssl_x509_checkpurpose() however reports error:0B086079:x509 certificate 
routines:X509_STORE_CTX_purpose_inherit:unknown purpose id.
Checking up in the documentation i can see that this purpose is not supported 
(http://www.openssl.org/docs/apps/verify.html#COMMAND_OPTIONS). This constant 
should be removed, and a note should be put in the documentation, specifying 
that 
this is not supported.

Test script:
---
openssl_x509_checkpurpose( mixed $x509cert , X509_PURPOSE_ANY );
while($error = openssl_error_string()) echo $error.\n;

Expected result:

With a valid certificate openssl_x509_checkpurpose($cert, X509_PURPOSE_ANY) 
returns true.

Actual result:
--
With a valid certificate openssl_x509_checkpurpose($cert, X509_PURPOSE_ANY) 
returns false.






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55362edit=1


Bug #55362 [Fbk-Opn]: X509_PURPOSE_ANY is not recognized by openssl

2011-08-04 Thread anders at ingemann dot de
Edit report at https://bugs.php.net/bug.php?id=55362edit=1

 ID: 55362
 User updated by:anders at ingemann dot de
 Reported by:anders at ingemann dot de
 Summary:X509_PURPOSE_ANY is not recognized by openssl
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:OpenSSL related
 Operating System:   Windows 7
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

The constant is not the problem.
Somehow int(7) causes an error with the openssl api. It says that this purpose 
id 
is not known.


Previous Comments:

[2011-08-04 12:40:50] paj...@php.net

c:\test\php536ntsphp -n -d extension_dir=ext -d extension=php_openssl.dll -r 
print_r(get_defined_constants()); | FIND X509
[X509_PURPOSE_SSL_CLIENT] = 1
[X509_PURPOSE_SSL_SERVER] = 2
[X509_PURPOSE_NS_SSL_SERVER] = 3
[X509_PURPOSE_SMIME_SIGN] = 4
[X509_PURPOSE_SMIME_ENCRYPT] = 5
[X509_PURPOSE_CRL_SIGN] = 6
[X509_PURPOSE_ANY] = 7


and from the x509v3.h:
#define X509_PURPOSE_ANY 7

What do you mean then?


[2011-08-04 12:23:01] anders at ingemann dot de

I just found out that the any purpose IS actually supported, but it is simply 
not documented. It seems the constant is somehow referring to a wrong value.


[2011-08-04 12:14:53] anders at ingemann dot de

Description:

On http://www.php.net/manual/en/function.openssl-x509-checkpurpose.php the 
purpose 
check X509_PURPOSE_ANY is mentioned and the constant is defined as well.
openssl_x509_checkpurpose() however reports error:0B086079:x509 certificate 
routines:X509_STORE_CTX_purpose_inherit:unknown purpose id.
Checking up in the documentation i can see that this purpose is not supported 
(http://www.openssl.org/docs/apps/verify.html#COMMAND_OPTIONS). This constant 
should be removed, and a note should be put in the documentation, specifying 
that 
this is not supported.

Test script:
---
openssl_x509_checkpurpose( mixed $x509cert , X509_PURPOSE_ANY );
while($error = openssl_error_string()) echo $error.\n;

Expected result:

With a valid certificate openssl_x509_checkpurpose($cert, X509_PURPOSE_ANY) 
returns true.

Actual result:
--
With a valid certificate openssl_x509_checkpurpose($cert, X509_PURPOSE_ANY) 
returns false.






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55362edit=1


Bug #51079 [Com]: fsockopen will not work on 'localhost'

2010-05-11 Thread anders at ingemann dot de
Edit report at http://bugs.php.net/bug.php?id=51079edit=1

 ID:   51079
 Comment by:   anders at ingemann dot de
 Reported by:  tony at marston-home dot demon dot co dot uk
 Summary:  fsockopen will not work on 'localhost'
 Status:   Assigned
 Type: Bug
 Package:  Sockets related
 Operating System: win32 only - Windows XP
 PHP Version:  5.2.12
 Assigned To:  pajoye

 New Comment:

I can confirm this on Vista x86 with the precompiled 5.3.2 VC6 ts


Previous Comments:

[2010-04-28 00:03:32] jbphp at jlb dot nu

We recently upgraded to PHP 5.3.2 and can replicate this problem under
Windows 7 x64.



Luckily the workaround of using '127.0.0.1' in the fsockopen address
instead of 'localhost' is relatively easy but it broke a large volume of
our existing code. Very annoying.



Please fix this asap.


[2010-03-13 20:26:19] dontwantanyspam at mailinator dot com

Forgot to mention my operating system. Windows 7 x64.


[2010-03-13 20:22:24] dontwantanyspam at mailinator dot com

I can also confirm that this problem isn't there in PHP 5.3.0. Its there
since 

5.3.1.



Unlike PHP 5.3.0, a 64 bit version of PHP 5.3.1 wasn't available at 

http://windows.php.net/qa/, so I tried compiling it myself. After
compiling I 

noticed that a script that uses
file_get_contents(http://localhost/...;) 

wouldn't work until I change the localhost to 127.0.0.1. I didn't
care about 

it much at that time since it seemed like a small problem. But then I
noticed 

that none of the scripts that used mysql were working. I even tried to
log in to 

phpMyAdmin and even that didn't work (same problem described by
thijsputman). So 

I thought that it was probably a bug with the 64 bit binary and
continued using 

PHP 5.3.0. 



But after PHP 5.3.2 was released, I tried compiling it also and noticed
that the 

problem was still there. Thinking that it may be related to mysqlnd
since the 

version used by PHP 5.3.0 is 5.0.5-dev and the one used by PHP 5.3.2 is
5.0.7-

dev, I tried compiling the mysql, mysqli and pdo mysql extensions with
libmysql. 

I has success with the mysql extension only. The mysqli and pdo mysql
extension 

failed to compile with libmysql (there were a lot of build errors).
Anyway, I 

tried the mysql extension compiled with libmysql and noticed that it was
working 

fine! But I needed the mysqli extension to work also and since it failed
to 

compile with libmysql, I messed around some more and finally realized
that it 

was the same problem as with the file_get_contents. So I tried changing
all the 

localhost references to 127.0.0.1 and it worked!



Anyway, for whatever reason the mysql extension compiled with libmysql
works 

fine with localhost but the one compiled with mysqlnd doesn't. So, I
hope this 

helps you to find and squish the bug thats causing this. :D


[2010-03-10 12:31:15] thijsputman at gmail dot com

Fair enough :)



The reproduce code provided fails to connect to localhost with
fsockopen() in PHP 5.3.2. When using PHP 5.3.0 fsockopen() connects to
localhost without problems.


[2010-03-10 12:03:59] paj...@php.net

It does not depend on PHP only but libmysql or mysql server. Please keep
posting about the socket issue only here as the myslqIPv6 questions
have been covered numerous times in other reports. The one report per
issue rule is also a good way to do not get distracted, thanks for your
understanding :)




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=51079


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51079edit=1