From: gufophp at gmail dot com
Operating system: win32 apache
PHP version: 5.2.11
PHP Bug Type: OpenSSL related
Bug description: openssl_****_export_to_file
Description:
------------
incorrect path save export file
Reproduce code:
---------------
<pre>
kpe1.php
<?
set_time_limit(0);
$ssl_configargs = array("digest_alg" => "OPENSSL_ALGO_SHA1",
"private_key_bits" => 384,"encrypt_key" => false,"basicConstraints" =>
"CA:true","keyUsage" => "cRLSign, keyCertSign",
"nsCertType" => "sslCA, emailCA");
$dn = array("countryName" => 'IT',"stateOrProvinceName" => 'Italy',
"localityName" => 'city',"organizationName" => 'org',
"organizationalUnitName" => 'unit',"commonName" => 'name' ,"emailAddress"
=> 'mail' );
$numberofdays = '365';
$pkey = openssl_pkey_new( $ssl_configargs );
$csr = openssl_csr_new( $dn, $privkey, $ssl_configargs );
$sscert = openssl_csr_sign( $csr, null, $privkey, $numberofdays );
openssl_csr_export( $csr, $csrout );
openssl_x509_export( $sscert, $certout );
openssl_x509_export_to_file ($sscert ,'crt_509_sk.crt',false);
openssl_pkey_export( $privkey, $pkeyout, $configargs['licence_pwd' ]);
openssl_pkey_export_to_file($privkey,'crt_509_pk.pem');
Expected result:
----------------
[dir]
kpe1.php
crt_509_sk.crt
crt_509_pk.pem
Actual result:
--------------
C:\Programmi\Apache Software Foundation\Apache2.2
.....
crt_509_sk.crt
crt_509_pk.pem
.....
--
Edit bug report at http://bugs.php.net/?id=50293&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50293&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50293&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50293&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50293&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50293&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50293&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50293&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50293&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50293&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50293&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50293&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50293&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50293&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50293&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50293&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50293&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50293&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50293&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50293&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50293&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50293&r=mysqlcfg