From:             
Operating system: Ubuntu Linux 10.10 beta
PHP version:      5.3.3
Package:          Streams related
Bug Type:         Bug
Bug description:segfault when ssl stream option capture_peer_cert_chain used

Description:
------------
Bug http://bugs.php.net/bug.php?id=52945 says that the ssl stream context
option capture_peer_chain (http://www.php.net/manual/en/context.ssl.php)
was really implemented as capture_peer_cert_chain in the php project source
code.



Once this fact is realized, then I tried to use the option
capture_peer_cert_chain in an ssl stream context connection, and it
segfaults when I do a var_dump.











Test script:
---------------
$o = array("capture_peer_cert" => true,"capture_peer_cert_chain" =>
true,);

$g = stream_context_create (array("ssl" => $o));

$r = stream_socket_client("ssl://www.digicert.com:443", $errno, $errstr,
30, STREAM_CLIENT_CONNECT, $g);

$cont = stream_context_get_params($r);

var_dump($cont['options']['ssl']);

Expected result:
----------------
array(4) {

  ["capture_peer_cert"]=>

  bool(true)

  ["capture_peer_cert_chain"]=>

  bool(true)

  ["peer_certificate"]=>

  resource(6) of type (OpenSSL X.509)

  ["peer_certificate_chain"]

  -something other than a segfault-

}



--------------------

I hope the "peer_certificate_chain" would be an array of "resource(6) of
type (OpenSSL X.509)" but I'm not sure if that is the intended behavior or
not.



Actual result:
--------------
array(4) {

  ["capture_peer_cert"]=>

  bool(true)

  ["capture_peer_cert_chain"]=>

  bool(true)

  ["peer_certificate"]=>

  resource(6) of type (OpenSSL X.509)

  ["peer_certificate_chain"]

  Segmentation fault (core dumped)



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

Reply via email to