mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
- array_slice() reindexes the array so we'll use array_pop() instead
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@143 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
parent
5eea5be210
commit
a4d39a9e66
@ -516,15 +516,22 @@ class Crypt_RSA {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($primes[$i] === false) { // if we've reached the timeout
|
if ($primes[$i] === false) { // if we've reached the timeout
|
||||||
return array(
|
if (count($primes) > 1) {
|
||||||
'privatekey' => '',
|
$partialkey = '';
|
||||||
'publickey' => '',
|
} else {
|
||||||
'partialkey' => count($primes) == 1 ? '' : serialize(array(
|
array_pop($primes);
|
||||||
'primes' => array_slice($primes, 0, $i - 1),
|
$partialkey = serialize(array(
|
||||||
|
'primes' => $primes,
|
||||||
'coefficients' => $coefficients,
|
'coefficients' => $coefficients,
|
||||||
'lcm' => $lcm,
|
'lcm' => $lcm,
|
||||||
'exponents' => $exponents
|
'exponents' => $exponents
|
||||||
))
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'privatekey' => '',
|
||||||
|
'publickey' => '',
|
||||||
|
'partialkey' => $partialkey
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user