Bug #50293 [Asn->Opn]: openssl_****_export_to_file
| From: | kalle@php.net | Date: | Tue, 24 Oct 2017 07:32:05 +0000 |
| Subject: | Bug #50293 [Asn->Opn]: openssl_****_export_to_file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212093@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=50293&edit=1
ID: 50293
Updated by: kalle@php.net
Reported by: gufophp at gmail dot com
Summary: openssl_****_export_to_file
-Status: Assigned
+Status: Open
Type: Bug
Package: OpenSSL related
Operating System: win32 only - apache
PHP Version: 5.2.11
-Assigned To: pajoye
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2010-08-12 03:31:52] kalle@php.net
I added a roughly untested patch for this, as I have some issues getting openssl to work in my build
env, so the patch is more a theory of how it could be fixed.
------------------------------------------------------------------------
[2010-08-12 03:31:03] kalle@php.net
The following patch has been added/updated:
Patch Name: bug-50293
Revision: 1281576663
URL: http://bugs.php.net/patch-display.php?bug=50293&patch=bug-50293&revision=1281576663
------------------------------------------------------------------------
[2009-11-25 18:28:03] pajoye@php.net
I think the case is clear, it looks like we do not use VCWD or php stream's api and it fails to
get the actual CWD.
I will take a look at it asap.
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=50293&edit=1