#19820 [Opn->Fbk]: openssl_csr_sign
| From: | iliaa@php.net | Date: | Sat, 07 Dec 2002 07:39:16 +0000 |
| Subject: | #19820 [Opn->Fbk]: openssl_csr_sign | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26950@lists.php.net to get a copy of this message | ||
ID: 19820
Updated by: iliaa@php.net
Reported By: satriani@intax.pl
-Status: Open
+Status: Feedback
Bug Type: OpenSSL related
Operating System: linux PLD
PHP Version: 4.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-10-08 12:41:22] satriani@intax.pl
<?php
$dn = array(
"countryName" => "UK",
"stateOrProvinceName" => "Somerset",
"localityName" => "Glastonbury",
"organizationName" => "The Brain Room Limited",
"organizationalUnitName" => "kontrahent",
"commonName" => "Janusz Flak",
"emailAddress" => "wez@thebrainroom.com"
);
$privkey = openssl_pkey_new();
$csr = openssl_csr_new( $dn, $privkey);
$CA_CERT = "file://cacert.pem";
$fp = fopen("cakey.pem", "r");
$priv_key = fread($fp, 8192);
fclose($fp);
$pass = 'abracadabra';
$pkeyid = openssl_get_privatekey($priv_key,$pass);
$sscert = openssl_csr_sign($csr, $CA_CERT, $pkeyid, 365);
?>
When $pass == ''
I have error
Warning: cannot get private key from parameter 3 in
/home/httpd/test.php on
line 32
error:0906A068:PEM routines:PEM_do_header:bad password read
WHEN strlen($pass) > 0 and pass is true
I have "Page not found" or delay.
WHEN strlen($pass) > 0 and pass is bad
I have
Warning: cannot get private key from parameter 3 in
/home/httpd/test.php on
line 32
error:06065064:digital envelope routines:EVP_DecryptFinal:bad decrypt
error:0906A065:PEM routines:PEM_do_header:bad decrypt
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19820&edit=1