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
|
||||
return array(
|
||||
'privatekey' => '',
|
||||
'publickey' => '',
|
||||
'partialkey' => count($primes) == 1 ? '' : serialize(array(
|
||||
'primes' => array_slice($primes, 0, $i - 1),
|
||||
if (count($primes) > 1) {
|
||||
$partialkey = '';
|
||||
} else {
|
||||
array_pop($primes);
|
||||
$partialkey = serialize(array(
|
||||
'primes' => $primes,
|
||||
'coefficients' => $coefficients,
|
||||
'lcm' => $lcm,
|
||||
'exponents' => $exponents
|
||||
))
|
||||
));
|
||||
}
|
||||
|
||||
return array(
|
||||
'privatekey' => '',
|
||||
'publickey' => '',
|
||||
'partialkey' => $partialkey
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user