diff options
author | Wez Furlong <wez@php.net> | 2002-12-12 15:50:11 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-12-12 15:50:11 +0000 |
commit | 81c02040f06847ae9e145fdcee2bd39322e51b06 (patch) | |
tree | e7845924ad93f7f174bca7833161944e53d2fe47 /ext/openssl/tests/001.phpt | |
parent | 3591c3b8e964069e99fdc5ab44056980259c971d (diff) | |
download | php-git-81c02040f06847ae9e145fdcee2bd39322e51b06.tar.gz |
Attempt to add more entropy for key generation.
Diffstat (limited to 'ext/openssl/tests/001.phpt')
-rw-r--r-- | ext/openssl/tests/001.phpt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/openssl/tests/001.phpt b/ext/openssl/tests/001.phpt index b3f5602f7f..9b15e134a5 100644 --- a/ext/openssl/tests/001.phpt +++ b/ext/openssl/tests/001.phpt @@ -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) |