1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-27 04:34:45 +01:00

- fix issues with partially generated RSA keys (thanks, Ben!)

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@141 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
Jim Wigginton 2011-02-06 00:04:07 +00:00
parent 029b61bc5e
commit 80bf62d6fc

View File

@ -492,16 +492,16 @@ class Crypt_RSA {
$timeout-= time() - $start;
$start = time();
if ($timeout <= 0) {
return serialize(array(
return array(
'privatekey' => '',
'publickey' => '',
'partialkey' => array(
'partialkey' => serialize(array(
'primes' => $primes,
'coefficients' => $coefficients,
'lcm' => $lcm,
'exponents' => $exponents
)
));
))
);
}
}
@ -519,7 +519,7 @@ class Crypt_RSA {
return array(
'privatekey' => '',
'publickey' => '',
'partialkey' => empty($primes) ? '' : serialize(array(
'partialkey' => count($primes) == 1 ? '' : serialize(array(
'primes' => array_slice($primes, 0, $i - 1),
'coefficients' => $coefficients,
'lcm' => $lcm,