#20705 [Com]: openssl_pkey_new does not seem to generate a new key
| From: | Troublegum at woltlab dot de | Date: | Wed, 11 Dec 2002 00:31:32 +0000 |
| Subject: | #20705 [Com]: openssl_pkey_new does not seem to generate a new key | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-27299@lists.php.net to get a copy of this message | ||
ID: 20705
Comment by: Troublegum@woltlab.de
Reported By: Troublegum@woltlab.de
Status: Feedback
Bug Type: OpenSSL related
Operating System: Windows 2000 Professional
PHP Version: 4.2.3
New Comment:
openssl_error_string() returns different messages when I reload the
page. I used the following test script:
----------
<?php
$privkey = openssl_pkey_new();
if(empty($privkey))
{
echo "error: no key was generated by openssl_pkey_new()";
}
else
{
echo "a private key was generated by openssl_pkey_new()";
}
echo "<br>Error Message: ".openssl_error_string()."<br>";
exit;
?>
--------------------
These are the error messages openssl_error_string() returned:
1. request) error:02001003:system library:fopen:No such process
2. request) error:2006D002:BIO routines:BIO_new_file:system lib
3. request) error:02001003:system library:fopen:No such process
Thanks..
Previous Comments:
------------------------------------------------------------------------
[2002-12-10 13:30:05] wez@php.net
And what error messages does openssl_error_string() return?
------------------------------------------------------------------------
[2002-12-10 11:27:12] Troublegum@woltlab.de
Yes, you are right. But even with the correct variable and the latest
win32 snapshot (downloaded at 07/12/2002) it did not work for me.
The problem is the following:
<?php
/** generate key */
$privkey = openssl_pkey_new();
if(empty($privkey))
{
die("error: no key was generated by openssl_pkey_new()");
}
else
{
echo "a private key was generated by openssl_pkey_new()";
}
?>
produces
"error: no key was generated by openssl_pkey_new()".
------------------------------------------------------------------------
[2002-12-10 04:36:57] wez@php.net
Your test script is wrong:
/** read in key */
$loaded_key = openssl_pkey_get_private($key_content, $pass);
$pass is not set to anything; you meant $password, in which case this
works fine.
------------------------------------------------------------------------
[2002-12-07 01:17:40] iliaa@php.net
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
------------------------------------------------------------------------
[2002-11-28 14:27:08] Troublegum@woltlab.de
wrong email address entered..
correct one: troublegum@woltlab.de
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/20705
--
Edit this bug report at http://bugs.php.net/?id=20705&edit=1