Commit Graph

450 Commits

Author SHA1 Message Date
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
terrafrost
472e006b6c SSH2: update conditions under which _disconnect's code is executed 2014-12-29 08:37:44 -06:00
Graham Campbell
bd0537fec5 "@access static" isn't a thing 2014-12-27 15:38:14 +00:00
Clint Nelissen
01d7c96a11 Fix undefined $raw error 2014-12-26 10:37:46 +01:00
Andreas Fischer
0efae5a91e Change copyright years from roman numeral to decimal numbers. 2014-12-10 00:04:08 +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
Andreas Fischer
262da528a0 Merge pull request #527 from DavidAnderson684/patch-2
Quote shell argument with escapeshellarg()

* DavidAnderson684/patch-2:
  Quote shell argument with escapeshellarg()
2014-12-04 20:00:41 +01:00
Andreas Fischer
f40bb9190f SCP: Add missing space after case statement. 2014-12-04 18:42:47 +01:00
David Anderson
14dc468b70 Quote shell argument with escapeshellarg()
Currently, the call to "scp -t" or "scp -f" just uses naive quoting - i.e. a couple of quote marks are thrown in.

But, this can easily be escaped from - if the filename has a quote mark of its own in it, for example.

e.g. if the filename is as follows, then bad things will happen:

 ";rm -rf /

Instead, escapeshellarg should be used, to make sure it gets escaped properly.
2014-12-04 16:50:23 +00:00
David Anderson
647a1e9a5e Avoid calling fclose(false)
The previous code would always call fclose(false) if the file was not successfully opened - resulting in a PHP notice.
2014-12-03 19:29:46 +00:00
terrafrost
b1e6643032 SSH2: clarify exec() docblock comment 2014-11-19 22:38:19 -06: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
Andreas Fischer
5c3058cc4b SFTP: Use hexdec() and bin2hex() for filesize calculation. 2014-10-19 21:07:12 +02:00
Andreas Fischer
5b932495cc SFTP: Replace incorrect comment about filesize. There is no 4 GiB limit. 2014-10-15 17:27:48 +02:00
Andreas Fischer
ce3cf60b10 Correct constant: NET_SFTP_BLOCK_DEVICE -> NET_SFTP_TYPE_BLOCK_DEVICE 2014-10-09 23:24:30 +02:00
Vladimir Volodko
6715c41e1f Fix Net_SFTP::filetype() block device recognition. 2014-10-09 12:46:58 +07:00
Cezary Kluczyński
0692a1ea7d SSH2: removed redundant rtrim 2014-09-28 12:39:54 +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
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
terrafrost
74feca9cf2 SFTP: cs adjustment 2014-08-19 14:20:20 -05:00
terrafrost
cb66c561c2 SFTP: optimize conditional calls to fclose in get() method 2014-08-19 14:05:24 -05:00
terrafrost
29e0143308 SFTP: grammar 2014-08-16 15:49:38 -05:00
terrafrost
7ed53f2428 SFTP: fix issue with uploading via a resource 2014-08-16 13:56:34 -05:00
terrafrost
e48ee12940 SFTP: make it so files can be downloaded into resources or upload
from resources
2014-08-16 12:49:55 -05: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
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
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
880bc9d9e6 Merge pull request #420 from bantu/sftp-skip-current-dir-by-removal
SFTP: Do not check filename over and over again, remove '.' and '..' from the map instead.

* bantu/sftp-skip-current-dir-by-removal:
  Do not check filename over and over again, remove '.' and '..' from the map instead.
2014-07-24 17:32:38 +02:00
Andreas Fischer
48a2613cde Merge pull request #421 from bantu/issue/418
SFTP: Only fclose($fp) when $mode & NET_SFTP_LOCAL_FILE.

* bantu/issue/418:
  Only fclose($fp) when $mode & NET_SFTP_LOCAL_FILE.
2014-07-24 17:04:24 +02:00
Andreas Fischer
952d2166bf Net_SFTP::_list() only takes two parameters. 2014-07-24 11:09:37 +02:00
Andreas Fischer
695d1e9038 Only fclose($fp) when $mode & NET_SFTP_LOCAL_FILE. 2014-07-24 11:06:24 +02:00
Andreas Fischer
84a9a300d4 Do not check filename over and over again, remove '.' and '..' from the map instead. 2014-07-24 11:00:55 +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
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
678d0cc792 Make Net_SSH2::isConnected() return a boolean instead of int. 2014-07-20 23:03:06 +02:00
Andreas Fischer
cc64ef9d3f Merge pull request #412 from terrafrost/ssh2-connected
SSH2: make isConnected return true if even if we're not logged in

* terrafrost/ssh2-connected:
  SSH2: make isConnected return true if even if we're not logged in
2014-07-20 23:00:30 +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
terrafrost
a84861bb52 SFTP: stat cache fixes 2014-07-19 21:31:58 -05:00
terrafrost
fe7fd97b59 SFTP: fix an issue with the stat cache 2014-07-11 12:14:26 -05:00
Andreas Fischer
ba24e04729 Merge pull request #394 from terrafrost/scp-spaces
SCP: add support for file names with spaces

* terrafrost/scp-spaces:
  SCP: always encapsulate filenames within double quotes
  SCP: add support for file names with spaces
2014-07-05 17:40:01 +02:00
terrafrost
aec33901fc SCP: always encapsulate filenames within double quotes 2014-07-03 13:36:24 -05:00