#50293 [Opn->Fbk]: openssl_****_export_to_file
| From: | jani@php.net | Date: | Wed, 25 Nov 2009 16:51:11 +0000 |
| Subject: | #50293 [Opn->Fbk]: openssl_****_export_to_file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145073@lists.php.net to get a copy of this message | ||
ID: 50293
Updated by: jani@php.net
Reported By: gufophp at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: OpenSSL related
Operating System: win32 apache
PHP Version: 5.2.11
New Comment:
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2009-11-25 15:05:30] gufophp at gmail dot com
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 this bug report at http://bugs.php.net/?id=50293&edit=1