summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth/authentication.php2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/AES.php (renamed from libs/phpseclib-0.3.9/Crypt/AES.php)2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/Base.php (renamed from libs/phpseclib-0.3.9/Crypt/Base.php)2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/Blowfish.php (renamed from libs/phpseclib-0.3.9/Crypt/Blowfish.php)2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/DES.php (renamed from libs/phpseclib-0.3.9/Crypt/DES.php)2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/Hash.php (renamed from libs/phpseclib-0.3.9/Crypt/Hash.php)2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/RC2.php (renamed from libs/phpseclib-0.3.9/Crypt/RC2.php)0
-rw-r--r--libs/phpseclib-0.3.10/Crypt/RC4.php (renamed from libs/phpseclib-0.3.9/Crypt/RC4.php)2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/RSA.php (renamed from libs/phpseclib-0.3.9/Crypt/RSA.php)15
-rw-r--r--libs/phpseclib-0.3.10/Crypt/Random.php (renamed from libs/phpseclib-0.3.9/Crypt/Random.php)2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/Rijndael.php (renamed from libs/phpseclib-0.3.9/Crypt/Rijndael.php)2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/TripleDES.php (renamed from libs/phpseclib-0.3.9/Crypt/TripleDES.php)2
-rw-r--r--libs/phpseclib-0.3.10/Crypt/Twofish.php (renamed from libs/phpseclib-0.3.9/Crypt/Twofish.php)2
-rw-r--r--libs/phpseclib-0.3.10/File/ANSI.php (renamed from libs/phpseclib-0.3.9/File/ANSI.php)2
-rw-r--r--libs/phpseclib-0.3.10/File/ASN1.php (renamed from libs/phpseclib-0.3.9/File/ASN1.php)23
-rw-r--r--libs/phpseclib-0.3.10/File/X509.php (renamed from libs/phpseclib-0.3.9/File/X509.php)2
-rw-r--r--libs/phpseclib-0.3.10/Math/BigInteger.php (renamed from libs/phpseclib-0.3.9/Math/BigInteger.php)11
-rw-r--r--libs/phpseclib-0.3.10/Net/SCP.php (renamed from libs/phpseclib-0.3.9/Net/SCP.php)9
-rw-r--r--libs/phpseclib-0.3.10/Net/SFTP.php (renamed from libs/phpseclib-0.3.9/Net/SFTP.php)2
-rw-r--r--libs/phpseclib-0.3.10/Net/SFTP/Stream.php (renamed from libs/phpseclib-0.3.9/Net/SFTP/Stream.php)3
-rw-r--r--libs/phpseclib-0.3.10/Net/SSH1.php (renamed from libs/phpseclib-0.3.9/Net/SSH1.php)3
-rw-r--r--libs/phpseclib-0.3.10/Net/SSH2.php (renamed from libs/phpseclib-0.3.9/Net/SSH2.php)57
-rw-r--r--libs/phpseclib-0.3.10/System/SSH/Agent.php (renamed from libs/phpseclib-0.3.9/System/SSH/Agent.php)2
-rw-r--r--libs/phpseclib-0.3.10/System/SSH_Agent.php (renamed from libs/phpseclib-0.3.9/System/SSH_Agent.php)2
-rw-r--r--libs/phpseclib-0.3.10/openssl.cnf (renamed from libs/phpseclib-0.3.9/openssl.cnf)0
25 files changed, 78 insertions, 75 deletions
diff --git a/auth/authentication.php b/auth/authentication.php
index 2331727..6351681 100644
--- a/auth/authentication.php
+++ b/auth/authentication.php
@@ -19,7 +19,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-ini_set('include_path', ini_get('include_path').':./libs/phpseclib-0.3.9');
+ini_set('include_path', ini_get('include_path').':./libs/phpseclib-0.3.10');
require_once('ssh.php');
require_once('telnet.php');
diff --git a/libs/phpseclib-0.3.9/Crypt/AES.php b/libs/phpseclib-0.3.10/Crypt/AES.php
index 832be25..637a825 100644
--- a/libs/phpseclib-0.3.9/Crypt/AES.php
+++ b/libs/phpseclib-0.3.10/Crypt/AES.php
@@ -56,7 +56,7 @@
* @category Crypt
* @package Crypt_AES
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVIII Jim Wigginton
+ * @copyright 2008 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Crypt/Base.php b/libs/phpseclib-0.3.10/Crypt/Base.php
index ec1788f..7ba6134 100644
--- a/libs/phpseclib-0.3.9/Crypt/Base.php
+++ b/libs/phpseclib-0.3.10/Crypt/Base.php
@@ -47,7 +47,7 @@
* @package Crypt_Base
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Crypt/Blowfish.php b/libs/phpseclib-0.3.10/Crypt/Blowfish.php
index 7d4987c..9758490 100644
--- a/libs/phpseclib-0.3.9/Crypt/Blowfish.php
+++ b/libs/phpseclib-0.3.10/Crypt/Blowfish.php
@@ -48,7 +48,7 @@
* @package Crypt_Blowfish
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Crypt/DES.php b/libs/phpseclib-0.3.10/Crypt/DES.php
index f8e6a83..a52e5ff 100644
--- a/libs/phpseclib-0.3.9/Crypt/DES.php
+++ b/libs/phpseclib-0.3.10/Crypt/DES.php
@@ -53,7 +53,7 @@
* @category Crypt
* @package Crypt_DES
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Crypt/Hash.php b/libs/phpseclib-0.3.10/Crypt/Hash.php
index d6e81e8..fd7eaeb 100644
--- a/libs/phpseclib-0.3.9/Crypt/Hash.php
+++ b/libs/phpseclib-0.3.10/Crypt/Hash.php
@@ -49,7 +49,7 @@
* @category Crypt
* @package Crypt_Hash
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Crypt/RC2.php b/libs/phpseclib-0.3.10/Crypt/RC2.php
index f98dc2c..f98dc2c 100644
--- a/libs/phpseclib-0.3.9/Crypt/RC2.php
+++ b/libs/phpseclib-0.3.10/Crypt/RC2.php
diff --git a/libs/phpseclib-0.3.9/Crypt/RC4.php b/libs/phpseclib-0.3.10/Crypt/RC4.php
index 24ae0a9..b6b46d7 100644
--- a/libs/phpseclib-0.3.9/Crypt/RC4.php
+++ b/libs/phpseclib-0.3.10/Crypt/RC4.php
@@ -55,7 +55,7 @@
* @category Crypt
* @package Crypt_RC4
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Crypt/RSA.php b/libs/phpseclib-0.3.10/Crypt/RSA.php
index 823044b..754623c 100644
--- a/libs/phpseclib-0.3.9/Crypt/RSA.php
+++ b/libs/phpseclib-0.3.10/Crypt/RSA.php
@@ -62,7 +62,7 @@
* @category Crypt
* @package Crypt_RSA
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMIX Jim Wigginton
+ * @copyright 2009 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
@@ -515,9 +515,16 @@ class Crypt_RSA
$versions = array();
if (!empty($matches[1])) {
- for ($i = 0; $i < count($matches[1]); $i++) {
- $versions[$matches[1][$i]] = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
- }
+ for ($i = 0; $i < count($matches[1]); $i++) {
+ $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
+
+ // Remove letter part in OpenSSL version
+ if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
+ $versions[$matches[1][$i]] = $fullVersion;
+ } else {
+ $versions[$matches[1][$i]] = $m[0];
+ }
+ }
}
// it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+
diff --git a/libs/phpseclib-0.3.9/Crypt/Random.php b/libs/phpseclib-0.3.10/Crypt/Random.php
index 5a3d28c..9c07320 100644
--- a/libs/phpseclib-0.3.9/Crypt/Random.php
+++ b/libs/phpseclib-0.3.10/Crypt/Random.php
@@ -38,7 +38,7 @@
* @category Crypt
* @package Crypt_Random
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Crypt/Rijndael.php b/libs/phpseclib-0.3.10/Crypt/Rijndael.php
index 3631972..b216c67 100644
--- a/libs/phpseclib-0.3.9/Crypt/Rijndael.php
+++ b/libs/phpseclib-0.3.10/Crypt/Rijndael.php
@@ -65,7 +65,7 @@
* @category Crypt
* @package Crypt_Rijndael
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVIII Jim Wigginton
+ * @copyright 2008 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Crypt/TripleDES.php b/libs/phpseclib-0.3.10/Crypt/TripleDES.php
index 175b3ac..61625e4 100644
--- a/libs/phpseclib-0.3.9/Crypt/TripleDES.php
+++ b/libs/phpseclib-0.3.10/Crypt/TripleDES.php
@@ -47,7 +47,7 @@
* @category Crypt
* @package Crypt_TripleDES
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Crypt/Twofish.php b/libs/phpseclib-0.3.10/Crypt/Twofish.php
index 4099a01..71696c9 100644
--- a/libs/phpseclib-0.3.9/Crypt/Twofish.php
+++ b/libs/phpseclib-0.3.10/Crypt/Twofish.php
@@ -48,7 +48,7 @@
* @package Crypt_Twofish
* @author Jim Wigginton <terrafrost@php.net>
* @author Hans-Juergen Petrich <petrich@tronic-media.com>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/File/ANSI.php b/libs/phpseclib-0.3.10/File/ANSI.php
index ef2ccbe..7f8741c 100644
--- a/libs/phpseclib-0.3.9/File/ANSI.php
+++ b/libs/phpseclib-0.3.10/File/ANSI.php
@@ -31,7 +31,7 @@
* @category File
* @package File_ANSI
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMXII Jim Wigginton
+ * @copyright 2012 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/File/ASN1.php b/libs/phpseclib-0.3.10/File/ASN1.php
index 159a89c..ac95e7b 100644
--- a/libs/phpseclib-0.3.9/File/ASN1.php
+++ b/libs/phpseclib-0.3.10/File/ASN1.php
@@ -34,7 +34,7 @@
* @category File
* @package File_ASN1
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMXII Jim Wigginton
+ * @copyright 2012 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
@@ -347,24 +347,31 @@ class File_ASN1
case FILE_ASN1_CLASS_APPLICATION:
case FILE_ASN1_CLASS_PRIVATE:
case FILE_ASN1_CLASS_CONTEXT_SPECIFIC:
- if ($constructed) {
+ if (!$constructed) {
+ return array(
+ 'type' => $class,
+ 'constant' => $tag,
+ 'content' => $content,
+ 'length' => $length + $start - $current['start']
+ );
+ }
+
+ $newcontent = array();
+ if (strlen($content)) {
$newcontent = $this->_decode_ber($content, $start);
$length = $newcontent['length'];
if (substr($content, $length, 2) == "\0\0") {
$length+= 2;
}
-
- // the array encapsulation is for BC with the old format
- $content = array($newcontent);
+ $start+= $length;
+ $newcontent = array($newcontent);
}
- $start+= $length;
-
return array(
'type' => $class,
'constant' => $tag,
// the array encapsulation is for BC with the old format
- 'content' => $content,
+ 'content' => $newcontent,
// the only time when $content['headerlength'] isn't defined is when the length is indefinite.
// the absence of $content['headerlength'] is how we know if something is indefinite or not.
// technically, it could be defined to be 2 and then another indicator could be used but whatever.
diff --git a/libs/phpseclib-0.3.9/File/X509.php b/libs/phpseclib-0.3.10/File/X509.php
index 1d07f67..e515f98 100644
--- a/libs/phpseclib-0.3.9/File/X509.php
+++ b/libs/phpseclib-0.3.10/File/X509.php
@@ -37,7 +37,7 @@
* @category File
* @package File_X509
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMXII Jim Wigginton
+ * @copyright 2012 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Math/BigInteger.php b/libs/phpseclib-0.3.10/Math/BigInteger.php
index 64955bf..f4b7790 100644
--- a/libs/phpseclib-0.3.9/Math/BigInteger.php
+++ b/libs/phpseclib-0.3.10/Math/BigInteger.php
@@ -63,7 +63,7 @@
* @category Math
* @package Math_BigInteger
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVI Jim Wigginton
+ * @copyright 2006 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://pear.php.net/package/Math_BigInteger
*/
@@ -278,7 +278,14 @@ class Math_BigInteger
$versions = array();
if (!empty($matches[1])) {
for ($i = 0; $i < count($matches[1]); $i++) {
- $versions[$matches[1][$i]] = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
+ $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
+
+ // Remove letter part in OpenSSL version
+ if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
+ $versions[$matches[1][$i]] = $fullVersion;
+ } else {
+ $versions[$matches[1][$i]] = $m[0];
+ }
}
}
diff --git a/libs/phpseclib-0.3.9/Net/SCP.php b/libs/phpseclib-0.3.10/Net/SCP.php
index 2668164..1e14727 100644
--- a/libs/phpseclib-0.3.9/Net/SCP.php
+++ b/libs/phpseclib-0.3.10/Net/SCP.php
@@ -44,7 +44,7 @@
* @category Net
* @package Net_SCP
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMX Jim Wigginton
+ * @copyright 2010 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
@@ -129,7 +129,7 @@ class Net_SCP
}
switch (strtolower(get_class($ssh))) {
- case'net_ssh2':
+ case 'net_ssh2':
$this->mode = NET_SCP_SSH2;
break;
case 'net_ssh1':
@@ -170,7 +170,7 @@ class Net_SCP
return false;
}
- if (!$this->ssh->exec('scp -t "' . $remote_file . '"', false)) { // -t = to
+ if (!$this->ssh->exec('scp -t ' . escapeshellarg($remote_file), false)) { // -t = to
return false;
}
@@ -195,7 +195,6 @@ class Net_SCP
$fp = @fopen($data, 'rb');
if (!$fp) {
- fclose($fp);
return false;
}
$size = filesize($data);
@@ -245,7 +244,7 @@ class Net_SCP
return false;
}
- if (!$this->ssh->exec('scp -f "' . $remote_file . '"', false)) { // -f = from
+ if (!$this->ssh->exec('scp -f ' . escapeshellarg($remote_file), false)) { // -f = from
return false;
}
diff --git a/libs/phpseclib-0.3.9/Net/SFTP.php b/libs/phpseclib-0.3.10/Net/SFTP.php
index cc62705..68cec6e 100644
--- a/libs/phpseclib-0.3.9/Net/SFTP.php
+++ b/libs/phpseclib-0.3.10/Net/SFTP.php
@@ -48,7 +48,7 @@
* @category Net
* @package Net_SFTP
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMIX Jim Wigginton
+ * @copyright 2009 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
diff --git a/libs/phpseclib-0.3.9/Net/SFTP/Stream.php b/libs/phpseclib-0.3.10/Net/SFTP/Stream.php
index 0c84ab4..3366ede 100644
--- a/libs/phpseclib-0.3.9/Net/SFTP/Stream.php
+++ b/libs/phpseclib-0.3.10/Net/SFTP/Stream.php
@@ -28,7 +28,7 @@
* @category Net
* @package Net_SFTP_Stream
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMXIII Jim Wigginton
+ * @copyright 2013 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
@@ -48,7 +48,6 @@ class Net_SFTP_Stream
* Rather than re-create the connection we re-use instances if possible
*
* @var Array
- * @access static
*/
static $instances;
diff --git a/libs/phpseclib-0.3.9/Net/SSH1.php b/libs/phpseclib-0.3.10/Net/SSH1.php
index 35e6d5e..3979d28 100644
--- a/libs/phpseclib-0.3.9/Net/SSH1.php
+++ b/libs/phpseclib-0.3.10/Net/SSH1.php
@@ -59,7 +59,7 @@
* @category Net
* @package Net_SSH1
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
@@ -1128,6 +1128,7 @@ class Net_SSH1
$padding_length = 8 - ($temp['length'] & 7);
$length = $temp['length'] + $padding_length;
+ $raw = '';
while ($length > 0) {
$temp = fread($this->fsock, $length);
diff --git a/libs/phpseclib-0.3.9/Net/SSH2.php b/libs/phpseclib-0.3.10/Net/SSH2.php
index dfe0a79..3a388bf 100644
--- a/libs/phpseclib-0.3.9/Net/SSH2.php
+++ b/libs/phpseclib-0.3.10/Net/SSH2.php
@@ -61,7 +61,7 @@
* @category Net
* @package Net_SSH2
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMVII Jim Wigginton
+ * @copyright 2007 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
@@ -77,7 +77,7 @@ define('NET_SSH2_MASK_CONNECTED', 0x00000002);
define('NET_SSH2_MASK_LOGIN_REQ', 0x00000004);
define('NET_SSH2_MASK_LOGIN', 0x00000008);
define('NET_SSH2_MASK_SHELL', 0x00000010);
-define('NET_SSH2_MASK_WINDOW_ADJUST', 0X00000020);
+define('NET_SSH2_MASK_WINDOW_ADJUST', 0x00000020);
/**#@-*/
/**#@+
@@ -2261,7 +2261,7 @@ class Net_SSH2
/**
* Execute Command
*
- * If $block is set to false then Net_SSH2::_get_channel_packet(NET_SSH2_CHANNEL_EXEC) will need to be called manually.
+ * If $callback is set to false then Net_SSH2::_get_channel_packet(NET_SSH2_CHANNEL_EXEC) will need to be called manually.
* In all likelihood, this is not a feature you want to be taking advantage of.
*
* @param String $command
@@ -3275,27 +3275,23 @@ class Net_SSH2
*/
function _send_channel_packet($client_channel, $data)
{
- /* The maximum amount of data allowed is determined by the maximum
- packet size for the channel, and the current window size, whichever
- is smaller.
-
- -- http://tools.ietf.org/html/rfc4254#section-5.2 */
- $max_size = min(
- $this->packet_size_client_to_server[$client_channel],
- $this->window_size_client_to_server[$client_channel]
- );
- while (strlen($data) > $max_size) {
+ while (strlen($data)) {
if (!$this->window_size_client_to_server[$client_channel]) {
$this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST;
// using an invalid channel will let the buffers be built up for the valid channels
- $output = $this->_get_channel_packet(-1);
+ $this->_get_channel_packet(-1);
$this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST;
- $max_size = min(
- $this->packet_size_client_to_server[$client_channel],
- $this->window_size_client_to_server[$client_channel]
- );
}
+ /* The maximum amount of data allowed is determined by the maximum
+ packet size for the channel, and the current window size, whichever
+ is smaller.
+ -- http://tools.ietf.org/html/rfc4254#section-5.2 */
+ $max_size = min(
+ $this->packet_size_client_to_server[$client_channel],
+ $this->window_size_client_to_server[$client_channel]
+ );
+
$temp = $this->_string_shift($data, $max_size);
$packet = pack('CN2a*',
NET_SSH2_MSG_CHANNEL_DATA,
@@ -3303,27 +3299,13 @@ class Net_SSH2
strlen($temp),
$temp
);
-
$this->window_size_client_to_server[$client_channel]-= strlen($temp);
-
if (!$this->_send_binary_packet($packet)) {
return false;
}
}
- if (strlen($data) >= $this->window_size_client_to_server[$client_channel]) {
- $this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST;
- $this->_get_channel_packet(-1);
- $this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST;
- }
-
- $this->window_size_client_to_server[$client_channel]-= strlen($data);
-
- return $this->_send_binary_packet(pack('CN2a*',
- NET_SSH2_MSG_CHANNEL_DATA,
- $this->server_channels[$client_channel],
- strlen($data),
- $data));
+ return true;
}
/**
@@ -3372,7 +3354,7 @@ class Net_SSH2
*/
function _disconnect($reason)
{
- if ($this->bitmap) {
+ if ($this->bitmap & NET_SSH2_MASK_CONNECTED) {
$data = pack('CNNa*Na*', NET_SSH2_MSG_DISCONNECT, $reason, 0, '', 0, '');
$this->_send_binary_packet($data);
$this->bitmap = 0;
@@ -3769,8 +3751,9 @@ class Net_SSH2
$e = new Math_BigInteger($this->_string_shift($server_public_host_key, $temp['length']), -256);
$temp = unpack('Nlength', $this->_string_shift($server_public_host_key, 4));
- $n = new Math_BigInteger($this->_string_shift($server_public_host_key, $temp['length']), -256);
- $nLength = $temp['length'];
+ $rawN = $this->_string_shift($server_public_host_key, $temp['length']);
+ $n = new Math_BigInteger($rawN, -256);
+ $nLength = strlen(ltrim($rawN, "\0"));
/*
$temp = unpack('Nlength', $this->_string_shift($signature, 4));
@@ -3807,7 +3790,7 @@ class Net_SSH2
$s = $s->toBytes();
$h = pack('N4H*', 0x00302130, 0x0906052B, 0x0E03021A, 0x05000414, sha1($this->exchange_hash));
- $h = chr(0x01) . str_repeat(chr(0xFF), $nLength - 3 - strlen($h)) . $h;
+ $h = chr(0x01) . str_repeat(chr(0xFF), $nLength - 2 - strlen($h)) . $h;
if ($s != $h) {
user_error('Bad server signature');
diff --git a/libs/phpseclib-0.3.9/System/SSH/Agent.php b/libs/phpseclib-0.3.10/System/SSH/Agent.php
index d5088ba..6b1e527 100644
--- a/libs/phpseclib-0.3.9/System/SSH/Agent.php
+++ b/libs/phpseclib-0.3.10/System/SSH/Agent.php
@@ -43,7 +43,7 @@
* @category System
* @package System_SSH_Agent
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMXIV Jim Wigginton
+ * @copyright 2014 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
* @internal See http://api.libssh.org/rfc/PROTOCOL.agent
diff --git a/libs/phpseclib-0.3.9/System/SSH_Agent.php b/libs/phpseclib-0.3.10/System/SSH_Agent.php
index 0784179..2800ea0 100644
--- a/libs/phpseclib-0.3.9/System/SSH_Agent.php
+++ b/libs/phpseclib-0.3.10/System/SSH_Agent.php
@@ -30,7 +30,7 @@
* @category System
* @package System_SSH_Agent
* @author Jim Wigginton <terrafrost@php.net>
- * @copyright MMXIV Jim Wigginton
+ * @copyright 2014 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
* @internal See http://api.libssh.org/rfc/PROTOCOL.agent
diff --git a/libs/phpseclib-0.3.9/openssl.cnf b/libs/phpseclib-0.3.10/openssl.cnf
index 58a1261..58a1261 100644
--- a/libs/phpseclib-0.3.9/openssl.cnf
+++ b/libs/phpseclib-0.3.10/openssl.cnf