Attempt to add more entropy for key generation.

This commit is contained in:
Wez Furlong 2002-12-12 15:50:11 +00:00
parent 3591c3b8e9
commit 81c02040f0

View File

@ -9,6 +9,15 @@ include('skipif.inc'); ?>
<?php
echo "Creating private key\n";
/* stack up some entropy; performance is not critical,
* and being slow will most likely even help the test.
*/
for ($z = "", $i = 0; $i < 1024; $i++) {
$z .= $i * $i;
if (function_exists("usleep"))
usleep($i);
}
$privkey = openssl_pkey_new();
if ($privkey === false)