- accommodate new Math_BigInteger updates

- fix a typo in Crypt_Rijndael's comments


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@54 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
Jim Wigginton 2009-11-03 22:03:43 +00:00
parent 839ea8c18b
commit f50e880c41
2 changed files with 6 additions and 5 deletions

View File

@ -64,7 +64,7 @@
* @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVIII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt
* @version $Id: Rijndael.php,v 1.6 2009-10-07 20:53:19 terrafrost Exp $
* @version $Id: Rijndael.php,v 1.7 2009-11-03 22:03:43 terrafrost Exp $
* @link http://phpseclib.sourceforge.net
*/
@ -458,7 +458,7 @@ class Crypt_Rijndael {
*
* Keys can be of any length. Rijndael, itself, requires the use of a key that's between 128-bits and 256-bits long and
* whose length is a multiple of 32. If the key is less than 256-bits and the key length isn't set, we round the length
* up to the closest valid key length, padding $key with null bytes. If the key is more tan 256-bits, we trim the
* up to the closest valid key length, padding $key with null bytes. If the key is more than 256-bits, we trim the
* excess bits.
*
* If the key is not explicitly set, it'll be assumed to be all null bytes.

View File

@ -41,7 +41,7 @@
* @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt
* @version $Id: SSH2.php,v 1.24 2009-10-17 03:49:16 terrafrost Exp $
* @version $Id: SSH2.php,v 1.25 2009-11-03 22:03:43 terrafrost Exp $
* @link http://phpseclib.sourceforge.net
*/
@ -823,7 +823,8 @@ class Net_SSH2 {
$g = new Math_BigInteger(2);
$x = new Math_BigInteger();
$x = $x->random(new Math_BigInteger(1), $q, 'crypt_random');
$x->setRandomGenerator('crypt_random');
$x = $x->random(new Math_BigInteger(1), $q);
$e = $g->modPow($x, $p);
$eBytes = $e->toBytes(true);
@ -940,7 +941,7 @@ class Net_SSH2 {
list(, $v) = $v->divide($p);
list(, $v) = $v->divide($q);
if ($v->compare($r) != 0) {
if (!$v->equals($r)) {
user_error('Invalid signature', E_USER_NOTICE);
return $this->_disconnect(NET_SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE);
}