mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
Attempt to add more entropy for key generation.
This commit is contained in:
parent
3591c3b8e9
commit
81c02040f0
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user