Commit Graph

649 Commits

Author SHA1 Message Date
terrafrost
024ac81d04 Merge branch '1.0' into 2.0 2016-11-29 19:26:11 -06:00
terrafrost
d0cb855bbc Merge branch '1.0-suppress-unpack-errors' into 1.0 2016-11-29 19:16:16 -06:00
terrafrost
81bae5ce8b Merge pull request #1061 from terrafrost/pkcs18-rewrite
RSA: refactor PKCS1/PKCS8 to facilitate re-use
2016-11-29 19:15:21 -06:00
terrafrost
6807791d42 Merge branch '2.0' 2016-11-20 11:14:48 -06:00
terrafrost
abf3899e1f Merge branch '1.0' into 2.0 2016-11-20 11:14:35 -06:00
terrafrost
7cb66ea56e SSH2: don't use timeout value of 0 for fsockopen 2016-11-20 11:08:53 -06:00
terrafrost
48cf16599b suppress unpack() PHP warnings 2016-11-19 22:39:36 -06:00
terrafrost
272ae9c64c Merge branch 'master' into pkcs18-rewrite 2016-11-17 08:10:55 -06:00
terrafrost
863ff6789b RSA: refactor PKCS1/PKCS8 to facilitate re-use 2016-11-17 08:09:10 -06:00
terrafrost
2d2bf2990e Merge branch '2.0' 2016-11-08 09:23:53 -06:00
terrafrost
a47eccf6f9 Merge branch '1.0' into 2.0 2016-11-08 09:22:05 -06:00
terrafrost
535104cb84 SSH2: send the identifier first, before reading it 2016-11-08 09:11:57 -06:00
terrafrost
8019baee62 BigInteger: add randomRange / randomPrimeRange
...and redo random / randomPrime such that they take the byte size
as the parameter instead of the range.
2016-09-17 19:48:51 -07:00
terrafrost
c17a2604a0 Merge branch 'master-reorg' 2016-09-17 09:15:11 -07:00
terrafrost
845135f887 add PHP5-style constructors along side PHP4-style ones 2016-09-10 10:41:05 -07:00
terrafrost
da0c41ddac Merge branch '2.0' 2016-08-11 23:10:43 -05:00
terrafrost
c20b661a44 SSH2: don't check for carriage return in version id string 2016-08-11 23:09:38 -05:00
klemens
dd23d91d41 spelling fixes 2016-08-04 00:47:52 -05:00
terrafrost
c547ee16c7 Merge branch '1.0' into 2.0 2016-08-04 00:31:15 -05:00
klemens
dca95ac662 spelling fixes 2016-08-04 00:19:27 -05:00
terrafrost
c509909004 Organizational Revamp
- rename \phpseclib\Crypt\Base to \phpseclib\Crypt\Common\SymmetricKey
- create BlockCipher and StreamCipher to extend SymmetricKey
- replace _string_shift with \phpseclib\Common\Functions\Strings::shift
2016-07-30 22:18:06 -05:00
terrafrost
3c1985a619 Merge branch '2.0' 2016-07-10 12:56:12 -05:00
terrafrost
97f0b37bd5 Merge branch '1.0' into 2.0 2016-07-10 12:55:56 -05:00
terrafrost
7bc0e61c1d SSH2: fix "Expected SSH_FXP_STATUS or ..." error 2016-06-29 00:30:28 -05:00
terrafrost
68a09b8af0 SSH2: i incorrectly thought i had saved when i did git commit -a 2016-06-11 19:38:23 -05:00
terrafrost
414b980b83 Merge branch '2.0' 2016-06-11 19:16:25 -05:00
terrafrost
8bb4592225 Merge branch 'stream-get-contents-1.0' into 2.0 2016-06-06 23:05:15 -05:00
terrafrost
2550301678 SSH2: use stream_get_* instead of fread() / fgets() 2016-05-23 00:46:41 -05:00
Paragon Initiative Enterprises
0e8fa93676 Use paragonie/constant_time_encoding 2016-05-12 16:28:40 -04:00
terrafrost
1b92fd84f9 Merge branch '2.0' 2016-05-06 11:50:26 -05:00
terrafrost
c76b18b869 Merge branch '1.0' into 2.0 2016-05-06 11:50:15 -05:00
artyhedgehog
0dd04d1e9b Fixed confusing SSH2::getErrors return type 2016-05-06 11:49:24 -05:00
terrafrost
398a795e1f Revert "undo merging of master to 2.0 branch"
This reverts commit 8fb4c3363d.
2016-04-30 16:23:35 -05:00
terrafrost
8fb4c3363d undo merging of master to 2.0 branch 2016-04-28 15:34:10 -05:00
terrafrost
b3171cc63f SFTP: fix logging constants 2016-04-11 19:30:45 -05:00
terrafrost
b4cf10fc94 Revert "Merge branch '2.0'"
This reverts commit be5f4ef6b19c82f6c898708cc8e1828b05e3d4e8, reversing
changes made to 638fe6971c.
2016-04-10 11:30:59 -05:00
terrafrost
4b69dcb1ca Revert "Merge remote-tracking branch 'bantu/bootstrap'"
This reverts commit ef04c870e9, reversing
changes made to cd57bf31ae.
2016-04-10 11:25:31 -05:00
terrafrost
574d36fb7d Merge branch 'cipher-revamp' 2016-03-14 23:00:21 -05:00
terrafrost
ea7d647612 Merge branch 'cipher-revamp' 2016-03-14 22:42:51 -05:00
terrafrost
54deb16da8 Merge branch '2.0' 2016-03-08 16:58:15 -06:00
terrafrost
9e586e79f1 SSH2: update libsodium calls to use 1.0.0 convention 2016-03-08 16:57:16 -06:00
terrafrost
ae1e5c13f9 Merge branch 'master' into cipher-revamp 2016-02-20 21:44:00 -06:00
terrafrost
5c78bf4c06 Merge branch 'ssh-fix-publickey' 2016-02-20 14:19:31 -06:00
Scott
fc4599985a Correct Sodium check
PECL Libsodium 1.0.x uses `\Sodium\function_name` instead of `\Sodium::method_name`.
2016-02-16 09:29:25 -06:00
Scott
fee6431bad Correct Sodium check
PECL Libsodium 1.0.x uses `\Sodium\function_name` instead of `\Sodium::method_name`.
2016-02-11 15:54:27 -05:00
terrafrost
c2110f68a0 SSH: fix broken public key auth 2016-02-06 15:59:34 -06:00
terrafrost
e74841477f Crypt: become a lot less tolerant of bad parameters 2016-02-03 08:56:25 -06:00
terrafrost
73a4221988 Crypt: become a lot less tolerant of bad parameters 2016-01-31 12:37:38 -06:00
terrafrost
ad4c3670d3 Merge branch 'biginteger-revamp' 2016-01-16 22:59:19 -06:00
terrafrost
a0d21b6321 BigInteger: make select methods static, add type hinting, etc 2015-12-27 10:24:17 -06:00
terrafrost
806249c7e9 RSA: changes to how encryption / signatures work 2015-12-25 11:28:24 -06:00
terrafrost
94fdbba2aa Merge branch '2.0' 2015-12-23 23:42:23 -06:00
terrafrost
600f9c4e4b SSH2: update isAuthenticated to work with 2.0 / master branches 2015-12-16 09:21:37 -06:00
terrafrost
d17aeffc04 Merge branch 'authenticated-1.0' into authenticated-2.0 2015-12-16 09:20:27 -06:00
terrafrost
57063f3604 SSH2: add isAuthenticated() method 2015-12-15 23:19:05 -06:00
terrafrost
ee0f45fea6 update identifier to current version 2015-12-05 10:33:28 -06:00
Andreas Fischer
18cc8eb1c3 Merge branch '2.0'
* 2.0:
  Fix PHP invalid index warning
2015-11-24 09:28:00 +01:00
Andreas Fischer
d80651738f Merge branch '1.0' into 2.0
* 1.0:
  Fix PHP invalid index warning
2015-11-24 09:28:00 +01:00
splitice
77d5f8da20 Fix PHP invalid index warning 2015-11-24 09:13:30 +01:00
terrafrost
43165d976c RSA: changes to OpenSSH and PuTTY plugins 2015-10-24 15:54:34 -05:00
terrafrost
a9705fdba7 Merge branch 'master' into rsa-plugins
Conflicts:
	phpseclib/Crypt/RSA.php
2015-10-16 10:01:18 -05:00
terrafrost
8686ced6d3 Merge branch 'phpdoc-2.0' into phpdoc-master
Conflicts:
	phpseclib/Crypt/Hash.php
	phpseclib/Crypt/RSA.php
2015-10-12 21:37:44 -05:00
terrafrost
33ea01f1ac Merge branch 'phpdoc-1.0' into phpdoc-2.0
Conflicts:
	phpseclib/Crypt/AES.php
	phpseclib/Crypt/Base.php
	phpseclib/Crypt/Blowfish.php
	phpseclib/Crypt/DES.php
	phpseclib/Crypt/Hash.php
	phpseclib/Crypt/RC2.php
	phpseclib/Crypt/RC4.php
	phpseclib/Crypt/RSA.php
	phpseclib/Crypt/Rijndael.php
	phpseclib/Crypt/TripleDES.php
	phpseclib/Crypt/Twofish.php
	phpseclib/File/ASN1.php
	phpseclib/File/X509.php
	phpseclib/Math/BigInteger.php
	phpseclib/Net/SCP.php
	phpseclib/Net/SFTP.php
	phpseclib/Net/SSH1.php
	phpseclib/Net/SSH2.php
	phpseclib/System/SSH/Agent.php
2015-10-12 14:10:26 -05:00
terrafrost
2048a49aac use self:: in phpdoc comments to reduce merge conflicts 2015-10-11 12:22:07 -05:00
terrafrost
19229ed224 phpDoc changes 2015-10-05 13:22:51 -05:00
terrafrost
91887c957d Merge remote-tracking branch 'upstream/master' into rsa-plugins
Conflicts:
	phpseclib/Crypt/RSA.php
	phpseclib/Net/SSH2.php
2015-10-01 15:57:31 -05:00
terrafrost
ec3fe7277b RSA: move key format handling to plugins 2015-10-01 15:41:11 -05:00
Andreas Fischer
70f55bd156 Merge pull request #825 from terrafrost/rsa-revamp
RSA: make createKey static and make it return RSA objects

* terrafrost/rsa-revamp:
  RSA: make createKey static and make it return RSA objects
2015-09-25 13:16:56 +02:00
terrafrost
fab5a66fe5 RSA: make createKey static and make it return RSA objects 2015-09-24 09:43:19 -05:00
Andreas Fischer
ccd18552e5 Merge branch '2.0'
* 2.0:
  Fixed phpdoc

Conflicts:
	phpseclib/Crypt/Hash.php
2015-09-16 13:36:04 +02:00
Graham Campbell
7f1bbfe216 Fixed phpdoc 2015-09-14 16:30:31 +01:00
Andreas Fischer
3342eb6d09 Merge branch '2.0'
* 2.0:
  Fixed another case
  Minor tweaks
  Fixed error
  More fixes
  PHPDoc fixes
2015-09-14 01:27:11 +02:00
Andreas Fischer
4387b64426 Merge branch '1.0' into 2.0
* 1.0:
  Fixed another case
  Minor tweaks
  Fixed error
  More fixes
  PHPDoc fixes

Conflicts:
	phpseclib/Crypt/Random.php
	phpseclib/Math/BigInteger.php
	phpseclib/Net/SSH2.php
	tests/Functional/Net/SFTPUserStoryTest.php
2015-09-14 01:27:04 +02:00
Graham Campbell
dd031a1702 PHPDoc fixes 2015-09-06 12:28:08 +01:00
Andreas Fischer
ed6f754137 Merge pull request #803 from GrahamForks/phpdoc
[3.0] PHPDoc Fixes

* GrahamForks/phpdoc:
  Fixed lots of phpdoc typos
  Fixed invalid param phpdoc
2015-09-02 20:49:05 +02:00
Andreas Fischer
6433a10fa5 Merge pull request #787 from torinaki/remove-global-and-earn-25$
Connection reuse refactoring to rid of globals

* torinaki/remove-global-and-earn-25$:
  Connection reuse refactoring to rid of globals
2015-09-02 15:04:52 +02:00
Graham Campbell
7cd45e5e1b Fixed lots of phpdoc typos 2015-09-02 00:44:55 +01:00
Graham Campbell
2be0506514 Fixed invalid param phpdoc 2015-09-02 00:44:39 +01:00
Graham Campbell
634c1c2a18 Fixed lots of phpdoc typos 2015-09-02 00:42:15 +01:00
Graham Campbell
c08c099c56 Fixed invalid param phpdoc 2015-09-02 00:41:38 +01:00
Graham Campbell
cd0e10cf9d Fixed lots of phpdoc typos 2015-09-02 00:37:54 +01:00
Graham Campbell
5890f3da98 Fixed invalid param phpdoc 2015-09-02 00:22:30 +01:00
Dmitry Balabka
70dd67c4d9 Connection reuse refactoring to rid of globals 2015-09-01 21:50:30 +03:00
terrafrost
2a8da097ae Merge branch 'master' into exceptions-v1
Conflicts:
	phpseclib/Net/SSH2.php
2015-08-31 23:47:12 -05:00
terrafrost
724ba7ccc9 SSH2: missed a few user_error's 2015-08-31 23:34:33 -05:00
Andreas Fischer
f29805e394 Merge pull request #759 from bantu/ssh2-function-key_exchange-no-static
[2.0] SSH2: Remove all static variables as loadable classes may change at runtime.

* bantu/ssh2-function-key_exchange-no-static:
  SSH2: Remove all static variables as loadable classes may change at runtime.
2015-08-13 14:25:21 -04:00
terrafrost
f300e825b0 SSH2: replace user_error's with exceptions 2015-08-01 08:01:43 -05:00
Andreas Fischer
fe5671fef7 SSH2: Remove all static variables as loadable classes may change at runtime. 2015-07-28 12:05:19 +02:00
Andreas Fischer
4244576104 [2.0] Add _encryption_algorithm_to_crypt_instance method. 2015-07-28 11:44:39 +02:00
Andreas Fischer
58f8affcad SSH2: Add support for curve25519-sha256@libssh.org.txt via libsodium-php. 2015-07-27 22:58:59 +02:00
Andreas Fischer
27be192189 Merge branch '1.0' into 2.0
* 1.0:
  Add encryption_algorithm_to_key_size method.
2015-07-27 22:08:06 +02:00
Andreas Fischer
65010d08e6 Add encryption_algorithm_to_key_size method. 2015-07-24 12:31:50 +02:00
Andreas Fischer
650a4ce266 Merge pull request #748 from terrafrost/ssh-custom-socket-2.0
SSH2: make it so you can connect using open sockets / 2.0 branch

* terrafrost/ssh-custom-socket-2.0:
  SSH2: move where $host is defined
  SSH2: make it so you can connect using open sockets
2015-07-21 12:53:32 +02:00
Andreas Fischer
06ec04e3fe Merge pull request #746 from terrafrost/ssh-custom-socket-1.0
SSH2: make it so you can connect using open sockets / 1.0 branch

* terrafrost/ssh-custom-socket-1.0:
  SSH2: move where $host is defined
  SSH2: make it so you can connect using open sockets
2015-07-21 12:53:24 +02:00
Andreas Fischer
713a9c7ccf Merge branch '1.0' into 2.0
* 1.0:
  SSH2: Introduce _array_intersect_first function.

Conflicts:
	phpseclib/Net/SSH2.php
2015-07-18 01:06:09 +02:00
Andreas Fischer
1473da35e6 SSH2: Introduce _array_intersect_first function.
+ No more empty for-loop bodies
+ No more counting variables $i leaked into outer context
+ No more unintuitive $i == count(...) comparisons
+ No more array / hash table access of the form $kex_algorithms[$i]
- Function call overhead; not in the performance critical path, though.
2015-07-17 22:28:32 +02:00
terrafrost
690704d36e Merge branch 'ssh-custom-socket-1.0' into ssh-custom-socket-2.0
Conflicts:
	phpseclib/Net/SSH2.php
2015-07-17 13:11:57 -05:00
terrafrost
a19e2a0d21 SSH2: move where $host is defined 2015-07-17 13:08:24 -05:00
terrafrost
4d086bee86 Merge branch 'ssh-custom-socket-1.0' into ssh-custom-socket-2.0
Conflicts:
	phpseclib/Net/SSH2.php
2015-07-17 12:43:50 -05:00
terrafrost
33a97391bc SSH2: make it so you can connect using open sockets 2015-07-17 12:30:44 -05:00
Andreas Fischer
d9e9504fba Merge branch 'PSR2-1.0' into PSR2-2.0
* PSR2-1.0:
  Fix indentation phpcbf did not fix.
  Remove PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket exception.
  Use phpcbf to fix PHP code to ruleset.
  Ignore coding guidelines in ANSI switch block.
  Base code sniffer ruleset on PSR2 rather than PEAR.
  Update PHP Code Sniffer to 2.3.3

Conflicts:
	build/code-sniffer-ruleset-tests.xml
	build/code-sniffer-ruleset.xml
	composer.lock
	phpseclib/Crypt/DES.php
	phpseclib/Crypt/Hash.php
	phpseclib/Crypt/RSA.php
	phpseclib/File/X509.php
	phpseclib/Math/BigInteger.php
	phpseclib/Net/SFTP.php
	phpseclib/Net/SSH1.php
	phpseclib/Net/SSH2.php
	tests/Functional/Net/SFTPUserStoryTest.php
	tests/Unit/Crypt/TwofishTest.php
2015-07-17 13:41:59 +02:00
Andreas Fischer
2013a31ecd Use phpcbf to fix PHP code to ruleset. 2015-07-17 12:57:41 +02:00
Andreas Fischer
6cbe537ba6 Merge branch '1.0' into 2.0
* 1.0:
  SSH2: limit the size of data that expect() looks at

Conflicts:
	phpseclib/Net/SSH2.php
2015-07-17 11:17:32 +02:00
terrafrost
4dc79b96ed SSH2: limit the size of data that expect() looks at 2015-07-14 19:05:52 -05:00
Andreas Fischer
f2773847a2 Merge branch '1.0' into 2.0
* 1.0:
  Add support for RFC 4419: diffie-hellman-group-exchange-sha{1,256}

Conflicts:
	phpseclib/Net/SSH2.php
2015-07-08 15:45:53 +02:00
Andreas Fischer
cdda621903 Merge pull request #714 from bantu/diffie-hellman-group-exchange-sha256
Add support for RFC 4419: diffie-hellman-group-exchange-sha{1,256}

* bantu/diffie-hellman-group-exchange-sha256:
  Add support for RFC 4419: diffie-hellman-group-exchange-sha{1,256}
2015-07-08 15:43:46 +02:00
Andreas Fischer
abeda5237f Add support for RFC 4419: diffie-hellman-group-exchange-sha{1,256} 2015-07-08 00:00:40 +02:00
Andreas Fischer
89cf423c58 Merge branch '1.0' into 2.0
* 1.0:
  SSH2: fix for window sizes > 2,147,483,648
2015-06-27 21:58:45 +02:00
terrafrost
c0555581e7 SSH2: fix for window sizes > 2,147,483,648 2015-06-24 23:45:14 -05:00
Andreas Fischer
8e2f694129 Merge branch '1.0' into 2.0
* 1.0:
  SSH2: string shift by 4 instead of by 1
  SSH2: fix E_NOTICE involving global requests
2015-05-05 16:14:12 +02:00
Andreas Fischer
5bd7a73a71 Merge pull request #674 from terrafrost/ssh2-global-request
fix E_NOTICE with SSH2 global requests

* terrafrost/ssh2-global-request:
  SSH2: string shift by 4 instead of by 1
  SSH2: fix E_NOTICE involving global requests
2015-05-05 16:14:12 +02:00
terrafrost
684d6eed0e SSH2: string shift by 4 instead of by 1 2015-05-04 08:22:27 -05:00
Andreas Fischer
661f3ce3b9 Merge branch '1.0' into 2.0
* 1.0:
  Replace ; with : in case statement.

Conflicts:
	phpseclib/Net/SFTP.php
	phpseclib/Net/SSH2.php
2015-05-03 14:13:56 +02:00
Andreas Fischer
5d2590feb0 Replace ; with : in case statement. 2015-05-03 13:18:23 +02:00
terrafrost
b59d821bbe SSH2: fix E_NOTICE involving global requests 2015-04-30 21:34:07 -05:00
terrafrost
047a75a636 Merge branch '2.0' of https://github.com/phpseclib/phpseclib into openssl-support-2.0 2015-04-10 23:08:08 -05:00
terrafrost
0b1d3aa7e9 SSH2: NET_SSH2_MASK_* -> self::MASK_* 2015-04-10 17:48:58 -05:00
terrafrost
d75f703c0a rm PHP v4 compatability claim 2015-04-02 05:57:52 -05:00
terrafrost
e510dc878b Merge branch '1.0' of https://github.com/phpseclib/phpseclib into openssl-support
Conflicts:
	phpseclib/Net/SSH2.php
2015-04-02 05:40:14 -05:00
terrafrost
023fef8d8b Merge branch '2.0' of https://github.com/phpseclib/phpseclib into openssl-support-2.0
Conflicts:
	phpseclib/Net/SSH2.php
2015-04-02 05:37:04 -05:00
terrafrost
ebcb3130b7 Merge branch 'openssl-support' into 2.0
Conflicts:
	phpseclib/Crypt/AES.php
	phpseclib/Crypt/Base.php
	phpseclib/Crypt/Blowfish.php
	phpseclib/Crypt/DES.php
	phpseclib/Crypt/RC2.php
	phpseclib/Crypt/RC4.php
	phpseclib/Crypt/Rijndael.php
	phpseclib/Crypt/TripleDES.php
	phpseclib/Crypt/Twofish.php
	phpseclib/Net/SSH2.php
	tests/Functional/Net/SFTPLargeFileTest.php
	tests/Unit/Crypt/AES/InternalTest.php
	tests/Unit/Crypt/AES/McryptTest.php
	tests/Unit/Crypt/AES/TestCase.php
2015-04-02 05:32:31 -05:00
Andreas Fischer
8101772ab4 Merge branch '1.0' into 2.0
* 1.0:
  SSH2: rm unused $connectionTimeout variable
  SSH2: rm redundant code and make php4 compatable
  SSH2: timeout improvements

Conflicts:
	phpseclib/Net/SSH2.php
2015-03-30 12:46:54 +02:00
Andreas Fischer
c0370ee91d Merge pull request #639 from terrafrost/banner-timeout
improve error handling with protocol version exchange

* terrafrost/banner-timeout:
  SSH2: rm unused $connectionTimeout variable
  SSH2: rm redundant code and make php4 compatable
  SSH2: timeout improvements
2015-03-30 12:37:46 +02:00
terrafrost
33645f5297 SSH2: missed a file in the merge 2015-03-29 10:58:05 -05:00
terrafrost
a8e702b34f Merge branch 'agentforwarding-1.0' into agentforwarding-2.0
Conflicts:
	phpseclib/Net/SSH2.php
	phpseclib/System/SSH/Agent.php
2015-03-29 10:32:30 -05:00
terrafrost
bb01002233 Merge remote-tracking branch 'agentforwarding/feature/ssh_agent_forwarding' into agentforwarding-1.0 2015-03-28 21:03:17 -05:00
terrafrost
1294b08675 SSH2: rm unused $connectionTimeout variable 2015-03-27 22:32:38 -05:00
montdidier
9723acc885 preference isset over array_key_exists, return false on failure, break after return channel opened 2015-03-24 13:38:56 +08:00
terrafrost
dfd57dfb89 SSH2: rm redundant code and make php4 compatable 2015-03-19 22:39:43 -05:00
terrafrost
23c65c3839 SSH2: timeout improvements
make it so that the timeout in the constructor behaves in the same
way that timeout's set via setTimeout() do. eg. isTimeout() tells
you if a timeout was thrown etc.
2015-03-19 07:53:19 -05:00
montdidier
1803bcac0b moved agent forwarding channel handling to filter method and reusing existing open channels to request forwarding 2015-02-06 11:28:23 +08:00
terrafrost
009d883d4c Merge branch 'master' of https://github.com/phpseclib/phpseclib into openssl-support 2015-01-14 20:13:08 -06:00
montdidier
dd0b3e6bd5 addresses low hanging fruit comments from terrafrost and bantu 2015-01-12 17:13:33 +08:00
Andreas Fischer
3c99773184 Merge pull request #588 from terrafrost/disconnect-fix
SSH2: update conditions under which _disconnect's code is executed

* terrafrost/disconnect-fix:
  SSH2: update conditions under which _disconnect's code is executed
2015-01-04 11:57:52 +01:00
Andreas Fischer
1c923576c6 NET_SSH2_ -> self:: 2015-01-04 11:38:03 +01:00
Andreas Fischer
ec21aa23f1 Merge pull request #588 from terrafrost/disconnect-fix
SSH2: update conditions under which _disconnect's code is executed

* terrafrost/disconnect-fix:
  SSH2: update conditions under which _disconnect's code is executed
2015-01-04 11:36:14 +01:00
terrafrost
be168e262f Crypt/Base: stream ciphers cannot be run in continuous mode with OpenSSL 2014-12-31 14:10:53 -06:00
terrafrost
5a91539148 SSH2: rm unsupported algorithms if OpenSSL is being used 2014-12-29 22:10:26 -06:00
montdidier
aca4ba3286 SSH agent forwarding implementation 2014-12-30 10:44:31 +08:00
terrafrost
472e006b6c SSH2: update conditions under which _disconnect's code is executed 2014-12-29 08:37:44 -06:00
Clint Nelissen
f3565346fa Replaced get_class() calls with instanceof operators 2014-12-24 13:07:14 -08:00
Clint Nelissen
fe742e18d7 Namespaced Crypt Package 2014-12-16 16:16:54 -08:00
Clint Nelissen
dfb8d52806 Temporary constant fix 2014-12-15 14:29:34 -08:00
Clint Nelissen
628949fb73 Namespaced classes 2014-12-15 14:29:20 -08:00
Clint Nelissen
fddf20f89c Namespaced classes 2014-12-15 09:25:46 -08:00
terrafrost
c5f74eb3a3 Merge branch 'master' of https://github.com/phpseclib/phpseclib into openssl-support 2014-12-13 14:15:34 -06:00
Andreas Fischer
c4b103468c Merge pull request #549 from bantu/fix-547
Change copyright years from roman numeral to decimal numbers.

* bantu/fix-547:
  Change copyright years from roman numeral to decimal numbers.

Conflicts:
	phpseclib/System/SSH_Agent.php
2014-12-10 00:06:08 +01:00
Andreas Fischer
0efae5a91e Change copyright years from roman numeral to decimal numbers. 2014-12-10 00:04:08 +01:00
Clint Nelissen
0305a4827c Moved globally defined constants to class constants 2014-12-09 10:46:30 -08:00
Clint Nelissen
ecb9c32f02 Merge branch 'php5' of https://github.com/phpseclib/phpseclib into NetPackageConstantsFix
Conflicts:
	phpseclib/Net/SSH2.php
2014-12-08 10:40:57 -08:00
Andreas Fischer
e52a3aff5a Merge branch 'master' into php5
* master:
  SSH2: simplify _send_channel_packet
2014-12-06 12:25:16 +01:00
terrafrost
96eb1f3797 SSH2: simplify _send_channel_packet
the last _send_channel_packet was unnecessarily complex. this lead
to a number of problems. for example,

the window size was checked for adjustments in two places. in the
second place it receives a window adjustment packet and just assumes
that the window adjustment packet was big enough for the rest of the
data.

(thanks, pixall!)
2014-12-05 22:01:39 -06:00
Clint Nelissen
99b9cc477d Moved global constants to class constants 2014-12-04 13:45:13 -08:00
Andreas Fischer
638e62d60a Remove LICENSE text from source code files. 2014-12-03 18:49:33 +01:00
Clint Nelissen
d6029bdb6a Removed includes for Random.php and fixed up user_error message 2014-12-02 09:34:15 -08:00
Clint Nelissen
f5ed86e385 Renamed Random::crypt_random_string to Random::string 2014-12-02 09:20:40 -08:00
Clint Nelissen
c70702afbb Namespaced Crypt\Random 2014-12-02 08:41:30 -08:00
Clint Nelissen
9c0c3faeb7 Initial commit 2014-12-01 18:54:44 -08:00
terrafrost
8fc4f4b70c Merge branch 'master' of https://github.com/phpseclib/phpseclib into openssl-support 2014-11-29 07:46:06 -06:00
Andreas Fischer
43d2e9ef68 Merge branch 'master' into php5
* master:
  SSH2: clarify exec() docblock comment
2014-11-20 10:58:33 +01:00
terrafrost
b1e6643032 SSH2: clarify exec() docblock comment 2014-11-19 22:38:19 -06:00
Andreas Fischer
10e5653324 Merge branch 'master' into php5
* master:
  SSH2: fix issues with RSA key verification

Conflicts:
	phpseclib/Net/SSH2.php
2014-11-07 13:13:38 +01:00
terrafrost
3eac2582d6 SSH2: fix issues with RSA key verification
Sometimes SSH servers will null pad their RSA keys. this null padding
broke Net/SSH2.php's RSA implementation (Crypt/RSA.php's implementation
works just fine). Also, the -3 was counting the initial "\0" of $h
twice so adjust it to -2.
2014-11-06 11:58:03 -06:00
terrafrost
361b59fff9 SSH2: make setCryptoEngine() less cumbersome 2014-10-11 23:40:56 -05:00
terrafrost
959c0cefae SSH2: add setCryptoEngine() function 2014-10-11 23:26:46 -05:00
terrafrost
ff4d563f4f SSH2: CS adjustments 2014-10-11 23:20:44 -05:00
Andreas Fischer
92c3127448 Merge branch 'master' into php5
* master:
  SSH2: removed redundant rtrim
2014-09-28 12:43:54 +02:00
Cezary Kluczyński
0692a1ea7d SSH2: removed redundant rtrim 2014-09-28 12:39:54 +02:00
Andreas Fischer
cf921a347a Merge branch 'master' into php5
* master:
  SSH2: rm unused constant
2014-09-07 12:43:27 +02:00
terrafrost
67279d7811 SSH2: rm unused constant
it doesn't need to be defined since the strlen($this->last_interactive_response)
check in _login_helper serves the same purpose that NET_SSH_MASK_LOGIN_INTERACTIVE
was intended to serve
2014-09-06 20:30:01 -05:00
Andreas Fischer
42e05a6714 Merge branch 'master' into php5
* master:
  SSH2: don't count data length against window size
2014-09-03 20:44:53 +02:00
terrafrost
9e71e0bce8 SSH2: don't count data length against window size
it is my hope that the issues 8c9e7a890e
and ccb1c3e2bd sought to resolve were
fixed 9f8d8a7bf6 and
7a2c7a414c.
2014-08-30 15:26:23 -05:00
Andreas Fischer
9dc92a82a4 Merge branch 'master' into php5
* master:
  SSH2: white space adjustment
  SSH: update getServerPublicHostKey() to use new _connect() method
  SSH2: fix if statement for conditional _connect() call
  simplify calls to $this->_connect()
  SSH2: make it so negotiated algorithms can be seen before login
2014-08-10 12:10:11 +02:00
Andreas Fischer
1de939fb4a Merge pull request #427 from terrafrost/ssh2-show-methods-before-login
SSH2: make it so negotiated algorithms can be seen before login

* terrafrost/ssh2-show-methods-before-login:
  SSH2: white space adjustment
  SSH: update getServerPublicHostKey() to use new _connect() method
  SSH2: fix if statement for conditional _connect() call
  simplify calls to $this->_connect()
  SSH2: make it so negotiated algorithms can be seen before login
2014-08-10 12:10:04 +02:00
terrafrost
04e263bb8c SSH2: white space adjustment 2014-08-10 02:09:28 -05:00
terrafrost
085fb0ebb8 SSH: update getServerPublicHostKey() to use new _connect() method 2014-08-06 14:42:08 -05:00
terrafrost
5b019b22d9 SSH2: fix if statement for conditional _connect() call 2014-08-05 19:30:14 -05:00
terrafrost
dffef50838 simplify calls to $this->_connect() 2014-08-04 20:11:34 -05:00
Andreas Fischer
e4516fb453 Merge branch 'master' into php5
* master:
  Add some test cases for SHA512.
  Use toBits() as there is no bits property.
  SSH2: Disallow the none MAC.
2014-07-26 17:20:09 +02:00
Andreas Fischer
2ccb301c4c Merge pull request #425 from bantu/ssh-remove-none-mac
SSH2: Disallow the none MAC.

* bantu/ssh-remove-none-mac:
  SSH2: Disallow the none MAC.
2014-07-26 13:14:39 +02:00
Andreas Fischer
fed60fe8ac Merge branch 'master' into php5
* master:
  ssh-hmac-sha2-256: Remove whitespace at end of line.
  Added RFC6668
  Add hmac-sha2-256 MAC support
2014-07-26 13:11:29 +02:00
Andreas Fischer
4be4533a6e ssh-hmac-sha2-256: Remove whitespace at end of line. 2014-07-26 13:02:52 +02:00
terrafrost
49079fa1b4 SSH2: make it so negotiated algorithms can be seen before login 2014-07-25 10:03:31 -05:00
Dag Wieers
1a330b68e2 Added RFC6668
Added the requested changed.
2014-07-25 14:10:01 +02:00
Dag Wieers
86d17c6989 Add hmac-sha2-256 MAC support
This small patch adds hmac-sha2-256 support separately as requested in #423.

Some security standards now recommend to disable MD5 and SHA1, and use SHA2 instead. This change was tested using SHA2 against RHEL6's OpenSSH v5.3p1 and Solaris 11. And was also tested with RHEL5's OpenSSH 4.3p2 which doesn't include SHA2.
2014-07-25 12:28:08 +02:00
Andreas Fischer
1aecc5e3d8 SSH2: Disallow the none MAC. 2014-07-25 12:18:11 +02:00
Andreas Fischer
f0d0158c2b Merge branch 'master' into php5
* master:
  Comment out (potentially) insecure ciphers arcfour and none.
2014-07-22 16:09:16 +02:00
Andreas Fischer
a0a23cbaf1 Merge pull request #406 from bantu/remove-ssh-arcfour
Remove the arcfour and none ciphers from SSH2.

* bantu/remove-ssh-arcfour:
  Comment out (potentially) insecure ciphers arcfour and none.
2014-07-22 16:09:14 +02:00
Andreas Fischer
ae913d64c3 Merge branch 'master' into php5
* master:
  SSH2: don't remove old $this->bitmap values
2014-07-21 23:53:34 +02:00
terrafrost
9dd3db4a49 SSH2: don't remove old $this->bitmap values 2014-07-21 16:41:39 -05:00
Andreas Fischer
84ac305704 Comment out (potentially) insecure ciphers arcfour and none. 2014-07-21 12:16:49 +02:00
Andreas Fischer
025a637053 Merge branch 'master' into php5
* master:
  Make Net_SSH2::isConnected() return a boolean instead of int.
2014-07-20 23:31:30 +02:00
Andreas Fischer
678d0cc792 Make Net_SSH2::isConnected() return a boolean instead of int. 2014-07-20 23:03:06 +02:00
Andreas Fischer
c2f2f4a764 Merge branch 'master' into php5
* master:
  SSH2: make isConnected return true if even if we're not logged in
2014-07-20 23:00:32 +02:00
terrafrost
ac2fc96263 SSH2: make isConnected return true if even if we're not logged in 2014-07-20 11:24:16 -05:00
Andreas Fischer
ca4f6a21eb Merge branch 'master' into php5
* master:
  Removed white-spaces from line ends
  Allow setting the terminal window size
2014-06-23 16:36:23 +02:00
liutec
10597aed64 Removed white-spaces from line ends 2014-06-22 22:30:52 +03:00
liutec
8e1df6e3c3 Allow setting the terminal window size 2014-06-20 13:04:17 +03:00
Andreas Fischer
b50ef2dc64 Replace phpseclib_resolve_include_path with stream_resolve_include_path. 2014-06-19 16:14:15 +02:00
Andreas Fischer
f85d333912 Merge branch 'master' into php5
* master:
  phpseclib_is_includable() -> phpseclib_resolve_include_path()
  Drop Net_SSH2::_is_includable() method.
  Random: a few changes to the stream_resolve_include_path_function
  Replace stream_resolve_include_path with phpseclib_is_includable.
  Random: add explanatory comment
  SSH2: replace _is_includable() with stream_resolve_include_path
  Random: include the Crypt_* classes if they're available

Conflicts:
	tests/bootstrap.php
2014-06-19 16:09:23 +02:00
Andreas Fischer
709c7c4d48 Merge pull request #385 from bantu/a-random-change
Random: include the Crypt_* classes if they're available

* bantu/a-random-change:
  phpseclib_is_includable() -> phpseclib_resolve_include_path()
  Drop Net_SSH2::_is_includable() method.
  Random: a few changes to the stream_resolve_include_path_function
  Replace stream_resolve_include_path with phpseclib_is_includable.
  Random: add explanatory comment
  SSH2: replace _is_includable() with stream_resolve_include_path
  Random: include the Crypt_* classes if they're available
2014-06-19 16:08:59 +02:00
Andreas Fischer
fd65c55720 phpseclib_is_includable() -> phpseclib_resolve_include_path() 2014-06-19 14:57:09 +02:00
Andreas Fischer
1afbea613d Drop Net_SSH2::_is_includable() method. 2014-06-18 23:41:26 +02:00
Andreas Fischer
9c90beaf82 Replace stream_resolve_include_path with phpseclib_is_includable. 2014-06-17 14:38:24 +02:00
Andreas Fischer
563b8af6ce Merge branch 'master' into php5
* master:
  SSH2: rm redundant part of SSH2 unit test
  SSH2: add unit test for getServerPublicHostKey
  SSH2: make it so you can verify server public host key without logging on
2014-06-17 11:37:37 +02:00
terrafrost
5f56781261 SSH2: make it so you can verify server public host key without logging on 2014-06-16 10:19:34 -05:00
Andreas Fischer
67aedc240b Change constructors from class name to __construct().
This has been produced as follows:
<?php
$replace = $files = [];
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($argv[1]));
foreach ($it as $fileinfo) {
    if ($fileinfo->getExtension() === 'php') {
        $file = $fileinfo->getPathname();
        $content = file_get_contents($file);
        $files[$file] = $content;
        $tokens = token_get_all($content);
        foreach ($tokens as $key => $value) {
            if ($value[0] === T_CLASS) {
                $class = $tokens[$key + 2][1];
                $replace += array(
                    "$class::$class(" => "$class::__construct(",
                    "parent::$class(" => "parent::__construct(",
                    "function $class(" => "function __construct(",
                );
            }
        }
    }
}
foreach ($files as $file => $content) {
    file_put_contents(
        $file,
        str_replace(
            array_keys($replace),
            array_values($replace),
            $content
        )
    );
}
2014-06-16 17:06:34 +02:00
terrafrost
4401b7e21e SSH2: replace _is_includable() with stream_resolve_include_path 2014-06-16 09:47:13 -05:00
Andreas Fischer
14ba37c539 Merge branch 'master' into php5
* master:
  SSH2: make $mac_algorithms non-static
2014-06-11 07:49:02 +02:00
terrafrost
246e9e154f SSH2: make $mac_algorithms non-static
none of the other statically defined variables have the potential
to change as multiple Net_SSH2 objects are created but this one does.

ie. if you connect to one SSH-2.0-SSHD server then no subsequent server
will use hmac-sha1-96 even if it could
2014-06-10 23:08:56 -05:00
Andreas Fischer
f2f5fcd70a Update users of Math_BigInteger. 2014-06-02 20:19:00 +02:00
Andreas Fischer
6f4a873cad Merge branch 'master' into php5
* master:
  Adjust documentation to coding guidelines: No () around include.
2014-06-02 12:51:24 +02:00
Andreas Fischer
e6f87318f5 Adjust documentation to coding guidelines: No () around include. 2014-06-01 23:28:49 +02:00
Andreas Fischer
712f820a26 Merge branch 'master' into php5
* master:
  SSH2: 0x7FFFFFFF -> $this->window_size in one more place
  SSH2: make it so callback functions can make exec() return early
2014-05-28 00:39:40 +02:00
terrafrost
db32efb276 SSH2: 0x7FFFFFFF -> $this->window_size in one more place 2014-05-26 17:57:14 -05:00
terrafrost
0dd929341b SSH2: make it so callback functions can make exec() return early 2014-05-26 17:37:32 -05:00
Andreas Fischer
b3081f2a61 Merge branch 'master' into php5
* master:
  SSH2: improve handling of incomplete packets
2014-04-19 15:46:56 +02:00
terrafrost
efd3b96dc8 SSH2: improve handling of incomplete packets 2014-04-18 16:58:00 -05:00
Andreas Fischer
a7da467819 Merge branch 'master' into php5
* master:
  Added some simple Net_SSH2 tests
2014-04-18 16:55:42 +02:00
Andreas Fischer
b676cc2690 Merge pull request #241 from mpscholten/ssh2-tests
Added some simple Net_SSH2 tests

* mpscholten/ssh2-tests:
  Added some simple Net_SSH2 tests

Conflicts:
	tests/Net/SSH2Test.php
2014-04-18 16:54:24 +02:00
Andreas Fischer
58cdf692f8 Merge branch 'master' into php5
* master:
  SSH2: move _connect() call to _login() from login()
  SSH2: phpdoc updates
  SSH: clarify role of constructor / connection timeout
  SSH1: do fsockopen() call when login has been called
  SSH2: != -> |=
  SSH2: phpdoc changes
  SSH2: syntax error
  SSH2: timeout set in constructor != timeout set by setTimeout()
  SSH2: add phpdoc header
  SSH2: connect to server in login() function

Conflicts:
	phpseclib/Net/SSH2.php
2014-04-10 18:00:38 +02:00
terrafrost
79719e8f74 SSH2: move _connect() call to _login() from login()
Per bantu, this is required for it to work with Net/SFTP.php
2014-04-08 08:48:12 -05:00
terrafrost
0ad0bb4c37 SSH2: phpdoc updates 2014-04-07 15:43:31 -05:00
terrafrost
677a291cb3 SSH: clarify role of constructor / connection timeout
Also, in Net_SSH2::_connect() $host is used in multiple places. Rather than changing all references to {$this->host}:{$this->port} preserve existing $host reference and update it accordingly
2014-04-07 10:26:46 -05:00
terrafrost
6fcfe5c885 SSH2: != -> |= 2014-04-07 00:25:38 -05:00
terrafrost
8f08301744 SSH2: phpdoc changes 2014-04-07 00:19:35 -05:00
terrafrost
ab341df973 SSH2: syntax error 2014-04-07 00:16:54 -05:00
terrafrost
f27a49299e SSH2: timeout set in constructor != timeout set by setTimeout() 2014-04-07 00:02:03 -05:00
terrafrost
fc748346fc SSH2: add phpdoc header 2014-04-06 23:56:21 -05:00
terrafrost
a14e71f38b SSH2: connect to server in login() function
this change will make it so some parameters can be set after the
Net_SSH2 object has been created. eg. instead of doing
define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX) one can now do
$ssh->setLogging(...) or something.
2014-04-06 23:45:25 -05:00
Andreas Fischer
483b8a7d3c Merge branch 'master' into php5
* master:
  fix more ssh channel issues
2014-03-21 18:27:13 +01:00
terrafrost
7a2c7a414c fix more ssh channel issues
In logs that were provided to me phpseclib sent a packet that was 2536 bytes long (excluding the bytes denoting the channel and data length) but the length packet said it was 32764 bytes long (ie. $max_size).

So when $max_size is less than the data being sent and has to be adjusted by a new window adjust message from the server and the adjustment makes $max_Size bigger than the data being sent over problems arise.

SSH's window size has caused issues before. Overall I don't think the SSH specs really explain the window size very well. I opened up an errata on SSH's RFC a while back about the issue.
2014-03-21 02:53:43 -05:00
Andreas Fischer
aecf89c031 Merge branch 'master' into php5
* master:
  Drop meaningless, outdated, inconsistent version tags in doc blocks.
2014-03-13 00:03:38 +01:00
Andreas Fischer
fb1296bbec Drop meaningless, outdated, inconsistent version tags in doc blocks.
find phpseclib -type f -name "*.php" -exec sed -i '/@version/d' {} \;
2014-03-11 15:58:33 +01:00
Andreas Fischer
cb56e676dc Merge branch 'master' into php5
* master:
  Tests for bug280.
  Also replace this with call_user_func
  Use call_user_func, as this will work on PHP < 5.4, whereas $callback() does not
2014-03-06 12:05:17 +01:00
Nicky Gerritsen
97d1e75a51 Use call_user_func, as this will work on PHP < 5.4, whereas $callback() does not 2014-03-05 15:44:17 +01:00
Andreas Fischer
88e6eef90f Merge branch 'master' into php5
* master:
  Add newline at EOF to phpseclib/System/SSH_Agent.php.
  SSH_Agent: phpdoc updates
  SSH_Agent: misc updates
  SSH2: add ssh-agent support
2014-02-21 19:42:36 +01:00
terrafrost
e90648c7a5 SSH2: add ssh-agent support 2014-02-10 00:04:16 -06:00
Andreas Fischer
addd2ac320 Merge branch 'master' into php5
* master:
  SSH2: ignore exit_status channel requests
2014-02-03 16:56:46 +01:00
terrafrost
cd9801db8a SSH2: ignore exit_status channel requests
Fixes #258
2014-02-02 23:42:06 -06:00
Marc Philip Scholten
b7092ebc21 Added some simple Net_SSH2 tests
Placed helper at top again in my test

Removed a whitespace
2013-12-28 21:29:52 +01:00
terrafrost
05077cf0f3 Merge branch 'ssh2-identifier' into php5 2013-12-28 13:50:05 -06:00
terrafrost
268ec2e5d1 Merge branch 'ssh2-identifier' 2013-12-28 13:49:05 -06:00
terrafrost
0ccac2c998 SSH2: add new line in docblock comment 2013-12-28 13:47:24 -06:00
Marc Philip Scholten
19be15c4c4 Fixed typos 2013-12-28 18:16:09 +01:00
terrafrost
a1b749a0a0 Merge branch 'master' into php5 2013-12-27 10:25:19 -06:00
Marc Philip Scholten
ad0c7c52bd Fixed cs 2013-12-26 21:02:18 +01:00
Marc Philip Scholten
b0de383f95 Replaced else { if ()...} with elseif() {} 2013-12-26 21:02:17 +01:00
Marc Philip Scholten
357d4253ee Fixed typo 2013-12-26 21:00:58 +01:00
Marc Philip Scholten
4817d28a54 Refactored Net_SSH2::$identifier and added unit tests
Added return tag
2013-12-26 21:00:58 +01:00