From 3ec7bdfcba25012f9688a03e247d2e3130ca1af4 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Thu, 21 Jan 2010 07:33:05 +0000 Subject: [PATCH] - fixed a PHP5.3 warning in Net/SSH2.php - fixed a bug introduced in the rewritten addition function git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@77 21d32557-59b3-4da0-833f-c5933fad653e --- phpseclib/Math/BigInteger.php | 16 ++++++++-------- phpseclib/Net/SSH2.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index 75dd263a..ec7843a9 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -1,4 +1,5 @@ * @copyright MMVI Jim Wigginton * @license http://www.gnu.org/licenses/lgpl.txt - * @version $Id: BigInteger.php,v 1.24 2010-01-21 00:52:11 terrafrost Exp $ + * @version $Id: BigInteger.php,v 1.25 2010-01-21 07:33:04 terrafrost Exp $ * @link http://pear.php.net/package/Math_BigInteger */ @@ -836,9 +837,10 @@ class Math_BigInteger { MATH_BIGINTEGER_SIGN => false ); } - $temp = $this->_subtract($x_value, $x_negative, $y_value, $y_negative); - $temp[MATH_BIGINTEGER_SIGN] = $this->_compare($x_value, $x_negative, $y_value, $y_negative) > 0 ? - !$y_negative : $y_negative; + + $temp = $this->_subtract($x_value, false, $y_value, false); + $temp[MATH_BIGINTEGER_SIGN] = $this->_compare($x_value, false, $y_value, false) > 0 ? + $x_negative : $y_negative; return $temp; } @@ -966,7 +968,7 @@ class Math_BigInteger { return $temp; } - $diff = $this->_compare($x_value, $x_negative, $y_value, $x_negative); + $diff = $this->_compare($x_value, $x_negative, $y_value, $y_negative); if ( !$diff ) { return array( @@ -981,9 +983,7 @@ class Math_BigInteger { $x_value = $y_value; $y_value = $temp; - $temp = $x_negative; - $x_negative = $y_negative; - $y_negative = $temp; + $x_negative = !$x_negative; $x_size = count($x_value); $y_size = count($y_value); diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 626c24ea..e5e02d4d 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -60,7 +60,7 @@ * @author Jim Wigginton * @copyright MMVII Jim Wigginton * @license http://www.gnu.org/licenses/lgpl.txt - * @version $Id: SSH2.php,v 1.33 2009-12-31 06:11:07 terrafrost Exp $ + * @version $Id: SSH2.php,v 1.34 2010-01-21 07:33:05 terrafrost Exp $ * @link http://phpseclib.sourceforge.net */ @@ -1273,7 +1273,7 @@ class Net_SSH2 { } // although PHP5's get_class() preserves the case, PHP4's does not - if (strtolower(get_class($password)) == 'crypt_rsa') { + if (is_object($password) && strtolower(get_class($password)) == 'crypt_rsa') { return $this->_privatekey_login($username, $password); }