From:             [EMAIL PROTECTED]
Operating system: linux PLD
PHP version:      4.2.3
PHP Bug Type:     OpenSSL related
Bug description:  openssl_csr_sign

<?php
$dn = array(
        "countryName" => "UK",
        "stateOrProvinceName" => "Somerset",
        "localityName" => "Glastonbury",
        "organizationName" => "The Brain Room Limited",
        "organizationalUnitName" => "kontrahent",
        "commonName" => "Janusz Flak",
        "emailAddress" => "[EMAIL PROTECTED]"
);

$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 bug report at http://bugs.php.net/?id=19820&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=19820&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=19820&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=19820&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=19820&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=19820&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=19820&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=19820&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=19820&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=19820&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=19820&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=19820&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=19820&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=19820&r=isapi

Reply via email to