From 2dfe9c5de7e7d1a4c924197db73826c303f91d7f Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 3 Oct 2016 19:56:50 -0500 Subject: [PATCH 1/9] README: update download link to 1.0.4 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77629bbd..3f527547 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ MIT-licensed pure-PHP implementations of an arbitrary-precision integer arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael, AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509 -* [Download (1.0.3)](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.3.zip/download) +* [Download (1.0.4)](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.4.zip/download) * [Browse Git](https://github.com/phpseclib/phpseclib) * [Code Coverage Report](http://phpseclib.bantux.org/code_coverage/1.0/latest/) From d760d97fc87907b5a7d989e16bf1fe01481a5fbb Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 4 Oct 2016 08:26:52 -0500 Subject: [PATCH 2/9] CHANGELOG: add 1.0.4 release --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1354ab91..81c18d88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.0.4 - 2016-10-03 + +- fix E_DEPRECATED errors on PHP 7.0 and 7.1 (#1041) +- fix float to int conversions on 32-bit Linux pre-PHP 5.3 (#1038, #1034) +- SFTP: speed up downloads (#945) +- SFTP: fix infinite loop when uploading empty file (#995) +- ASN1: fix possible infinite loop in decode (#1027) + ## 1.0.3 - 2016-08-18 - BigInteger/RSA: don't compare openssl versions > 1.0 (#946) @@ -139,4 +147,4 @@ = add support for AES-128-CBC and DES-EDE3-CFB encrypted RSA private keys - add Net_SFTP::stat(), Net_SFTP::lstat() and Net_SFTP::rawlist() - logging was added to Net_SSH1 -- the license was changed to the less restrictive MIT license \ No newline at end of file +- the license was changed to the less restrictive MIT license From a478b13930f72d9a67897792ebd3c36ec0831044 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 17 Oct 2016 23:25:21 -0500 Subject: [PATCH 3/9] Composer: fix autoloading for 1.0 branch --- composer.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 7a2a2bbf..39cfa543 100644 --- a/composer.json +++ b/composer.json @@ -66,11 +66,16 @@ }, "include-path": ["phpseclib/"], "autoload": { + "psr-0": { + "Crypt": "phpseclib/", + "File": "phpseclib/", + "Math": "phpseclib/", + "Net": "phpseclib/", + "System": "phpseclib/" + }, "files": [ + "phpseclib/Crypt/Random.php", "phpseclib/bootstrap.php" - ], - "psr-4": { - "phpseclib\\": "phpseclib/" - } + ] } } From f5d8377cdbddbdd4107a789d2a700f42a95c2009 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 20 Oct 2016 21:29:55 +0200 Subject: [PATCH 4/9] Backport tests/bootstrap.php from 2.0 / master onto 1.0. --- tests/bootstrap.php | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 561b0a82..bb137e4d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -7,25 +7,13 @@ date_default_timezone_set('UTC'); -// Set up include path accordingly. This is especially required because some -// class files of phpseclib require() other dependencies. -set_include_path(implode(PATH_SEPARATOR, array( - dirname(__FILE__) . '/../phpseclib/', - dirname(__FILE__) . '/', - get_include_path(), -))); - -require_once 'Crypt/Random.php'; - -function phpseclib_autoload($class) -{ - $file = str_replace('_', '/', $class) . '.php'; - - if (phpseclib_resolve_include_path($file)) { - // @codingStandardsIgnoreStart - require $file; - // @codingStandardsIgnoreEnd - } +$loader_path = __DIR__ . '/../vendor/autoload.php'; +if (!file_exists($loader_path)) { + echo "Dependencies must be installed using composer:\n\n"; + echo "php composer.phar install\n\n"; + echo "See http://getcomposer.org for help with installing composer\n"; + exit(1); } -spl_autoload_register('phpseclib_autoload'); +$loader = include $loader_path; +$loader->add('', __DIR__); From 1fb9c812334a68f7c1687e6a84a6366930ccecdd Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 22 Oct 2016 11:13:01 -0500 Subject: [PATCH 5/9] Composer: include bootstrap before Crypt/Random --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 39cfa543..acec44de 100644 --- a/composer.json +++ b/composer.json @@ -74,8 +74,8 @@ "System": "phpseclib/" }, "files": [ - "phpseclib/Crypt/Random.php", - "phpseclib/bootstrap.php" + "phpseclib/bootstrap.php", + "phpseclib/Crypt/Random.php" ] } } From 38fa7332e96bcc546ce6eb5cbaa1168c96839393 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 22 Oct 2016 12:53:16 -0500 Subject: [PATCH 6/9] update for 1.0.5 release.. --- CHANGELOG.md | 4 ++++ README.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81c18d88..73b972fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.5 - 2016-10-22 + +- fix issue preventing installation of 1.0.x via Composer (#1048) + ## 1.0.4 - 2016-10-03 - fix E_DEPRECATED errors on PHP 7.0 and 7.1 (#1041) diff --git a/README.md b/README.md index 3f527547..75089a01 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ MIT-licensed pure-PHP implementations of an arbitrary-precision integer arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael, AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509 -* [Download (1.0.4)](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.4.zip/download) +* [Download (1.0.5)](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.5.zip/download) * [Browse Git](https://github.com/phpseclib/phpseclib) * [Code Coverage Report](http://phpseclib.bantux.org/code_coverage/1.0/latest/) From fd8f6e228dad3c037f65f689319090a630055364 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 22 Oct 2016 22:57:15 -0500 Subject: [PATCH 7/9] Composer: update lock file --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 2ca66739..dcab0811 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "ef3ada42c17aee960068e0a98b4de602", + "hash": "24648c5326ee237cd79bb0d311b16cb8", "content-hash": "cec0167a357df0f3da215133e2424a6c", "packages": [], "packages-dev": [ From e837cc2054c0f9961f65d142d79715828276fac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= Date: Wed, 2 Nov 2016 13:12:36 +0100 Subject: [PATCH 8/9] Incorrect namespace hint --- phpseclib/Net/SCP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 phpseclib/Net/SCP.php diff --git a/phpseclib/Net/SCP.php b/phpseclib/Net/SCP.php old mode 100644 new mode 100755 index 8784b543..b6219dda --- a/phpseclib/Net/SCP.php +++ b/phpseclib/Net/SCP.php @@ -99,7 +99,7 @@ class SCP * * Connects to an SSH server * - * @param \phpseclib\Net\SSH1|\phpseclin\Net\SSH2 $ssh + * @param \phpseclib\Net\SSH1|\phpseclib\Net\SSH2 $ssh * @return \phpseclib\Net\SCP * @access public */ From 535104cb842271eb9c76c3739c910477bf16ae75 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 8 Nov 2016 09:11:57 -0600 Subject: [PATCH 9/9] SSH2: send the identifier first, before reading it --- phpseclib/Net/SSH2.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 8281e73a..12741c73 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1056,6 +1056,10 @@ class Net_SSH2 } } + $this->identifier = $this->_generate_identifier(); + + fputs($this->fsock, $this->identifier . "\r\n"); + /* According to the SSH2 specs, "The server MAY send other lines of data before sending the version @@ -1099,8 +1103,6 @@ class Net_SSH2 return false; } - $this->identifier = $this->_generate_identifier(); - if (defined('NET_SSH2_LOGGING')) { $this->_append_log('<-', $extra . $temp); $this->_append_log('->', $this->identifier . "\r\n"); @@ -1116,8 +1118,6 @@ class Net_SSH2 return false; } - fputs($this->fsock, $this->identifier . "\r\n"); - $response = $this->_get_binary_packet(); if ($response === false) { user_error('Connection closed by server');