mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-14 18:59:51 +00: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:
parent
029b61bc5e
commit
80bf62d6fc
@ -492,16 +492,16 @@ class Crypt_RSA {
|
|||||||
$timeout-= time() - $start;
|
$timeout-= time() - $start;
|
||||||
$start = time();
|
$start = time();
|
||||||
if ($timeout <= 0) {
|
if ($timeout <= 0) {
|
||||||
return serialize(array(
|
return array(
|
||||||
'privatekey' => '',
|
'privatekey' => '',
|
||||||
'publickey' => '',
|
'publickey' => '',
|
||||||
'partialkey' => array(
|
'partialkey' => serialize(array(
|
||||||
'primes' => $primes,
|
'primes' => $primes,
|
||||||
'coefficients' => $coefficients,
|
'coefficients' => $coefficients,
|
||||||
'lcm' => $lcm,
|
'lcm' => $lcm,
|
||||||
'exponents' => $exponents
|
'exponents' => $exponents
|
||||||
)
|
))
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -519,7 +519,7 @@ class Crypt_RSA {
|
|||||||
return array(
|
return array(
|
||||||
'privatekey' => '',
|
'privatekey' => '',
|
||||||
'publickey' => '',
|
'publickey' => '',
|
||||||
'partialkey' => empty($primes) ? '' : serialize(array(
|
'partialkey' => count($primes) == 1 ? '' : serialize(array(
|
||||||
'primes' => array_slice($primes, 0, $i - 1),
|
'primes' => array_slice($primes, 0, $i - 1),
|
||||||
'coefficients' => $coefficients,
|
'coefficients' => $coefficients,
|
||||||
'lcm' => $lcm,
|
'lcm' => $lcm,
|
||||||
|
Loading…
Reference in New Issue
Block a user