1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-27 12:44:38 +01:00
Commit Graph

1042 Commits

Author SHA1 Message Date
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
a43dd38365 BigInteger: accomodate GMP change in PHP 5.6 2014-09-27 12:52:54 -05:00
terrafrost
a2f4a2cbba ASN1: add unit test for non-constructed context-specific change 2014-09-22 23:03:06 -05:00
terrafrost
c6ad2b69ba ASN1: fix issue with non-constructed context-specific tags 2014-09-22 01:01:34 -05:00
Andreas Fischer
3f3b9b90fb Merge pull request #469 from terrafrost/rsa-xml-unsigned
RSA: make XML keys use unsigned integers

* terrafrost/rsa-xml-unsigned:
  RSA: syntax error in unit tests
  RSA: make unit tests perform string comparisons sans white space chars
  RSA: update unit test
  RSA: add unit test
  RSA: make XML keys use unsigned integers
2014-09-09 16:41:58 +02:00
terrafrost
c489852332 RSA: update unit test 2014-09-09 00:28:38 -05: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
713393c8ad RSA: make XML keys use unsigned integers
PKCS1 / PKCS8 keys need *signed* integers because of section 8.3.3
at http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#page=7
2014-09-06 11:13:11 -05:00
Andreas Fischer
5e9d41f403 Merge pull request #462 from terrafrost/asn1-handle-indef-lengths
ASN1: rewrite _decode_der

* terrafrost/asn1-handle-indef-lengths:
  ASN1: one more unit test change
  ASN1: another unit test update
  ASN1: unit test adjustments
  ASN1: cs adjustments to unit test
  ASN1: add unit tests for indefinite length decoding
  ASN1: CS adjustment (rm whitespace at eol)
  ASN1: rewrite _decode_der
2014-09-04 22:20:27 +02:00
terrafrost
3bb123c3d5 ASN1: CS adjustment (rm whitespace at eol) 2014-08-30 19:44:12 -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
e258e001fa ASN1: rewrite _decode_der
this rewrite makes phpseclib better able to handle indef lengths,
which had previously been untested.
2014-08-25 10:12:56 -05:00
Vitaliy Zaytsev
2ee0529c9d Replaced "case true:" with "default:" 2014-08-25 19:58:38 +07:00
Vitaliy Zaytsev
cf10e07660 Error: "Constant CRYPT_RSA_MODE already defined"
It happens if defined(MATH_BIGINTEGER_OPENSSL_DISABLE) && !function_exists('openssl_pkey_get_details')
2014-08-25 19:03:24 +07: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
terrafrost
aa0e7347ef AES: a few final changes 2014-08-14 23:09:17 -05:00
terrafrost
35fd2888ea Rijndael, AES: adjustments to what key sizes are and aren't allowed 2014-08-13 09:56:49 -05:00
Andreas Fischer
cb8f991752 Merge pull request #448 from terrafrost/bits-change
BigInteger:  small optimization to bitwise_not

* terrafrost/bits-change:
  BigInteger: fix previous fix
  BigInteger:  small optimization to bitwise_not
2014-08-12 11:30:21 +02:00
terrafrost
33182bb2de BigInteger: fix previous fix 2014-08-10 14:47:08 -05:00
Andreas Fischer
63974e9bbc Merge pull request #446 from terrafrost/hash-96-2
Hash: add sha256-96 and sha512-96

* terrafrost/hash-96-2:
  Hash: apply fixes to sha512 unit tests as well
  Hash: one more fix to unit test
  Hash: fix unit tests
  Hash: add unit tests
  Hash: add sha256-96 and sha512-96
2014-08-10 17:59:03 +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
4ce7a0f63a BigInteger: small optimization to bitwise_not 2014-08-10 02:03:58 -05:00
terrafrost
085fb0ebb8 SSH: update getServerPublicHostKey() to use new _connect() method 2014-08-06 14:42:08 -05:00
terrafrost
88d6517d93 Hash: add sha256-96 and sha512-96
IPSec uses them and some versions of OpenSSH use them (even though RFC6668 makes no mention of them)
2014-08-05 23:27:11 -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
737c8a9d0f Use toBits() as there is no bits property. 2014-07-26 13:43:57 +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
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
terrafrost
9edf905939 SCP: add support for file names with spaces 2014-06-26 20:41:43 -05:00
Andreas Fischer
0f672dde52 Use get_called_class() if available. 2014-06-27 00:35:19 +02:00
Andreas Fischer
73f961cb7d Add Net_SFTP_Stream::register() for easier autoloading. 2014-06-27 00:22:41 +02:00
Andreas Fischer
949cfcc867 Merge pull request #386 from terrafrost/symlink
SFTP: add readlink and symlink functions

* terrafrost/symlink:
  SFTP: return $sftp object in unit tests
  SFTP: fix unit test
  SFTP: syntax error in unit test
  SFTP: add unit tests for symlinks
  SFTP: add readlink and symlink functions
2014-06-23 16:37:55 +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
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
terrafrost
96ccca2817 Random: a few changes to the stream_resolve_include_path_function 2014-06-18 22:03:09 +02:00
terrafrost
a65b820b54 SFTP: add readlink and symlink functions 2014-06-18 11:34:50 -05:00
Andreas Fischer
9c90beaf82 Replace stream_resolve_include_path with phpseclib_is_includable. 2014-06-17 14:38:24 +02:00
Andreas Fischer
9716d9b7e5 Merge pull request #380 from terrafrost/server-host-key
SSH2: make it so you can verify server public host key without logging on

* terrafrost/server-host-key:
  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:36 +02:00
Andreas Fischer
f807d8799e Merge pull request #370 from terrafrost/pkcs8
RSA: add support for PKCS8 encoded private keys

* terrafrost/pkcs8:
  Crypt/Base: readability improvement
  RSA: CS adjustments
  RSA: rename PUBLIC_FORMAT_PKCS1_RAW -> PUBLIC_FORMAT_PKCS8
  RSA: add PKCS8 unit tests
  RSA: add support for saving encrypted PKCS8 keys
  Crypt/Base: adjust default key size for pbkdf1
  RSA: add support for loading PKCS8 encrypted private keys
  Crypt/Base: add support for pbkdf1
  RSA: add support for saving to PKCS8 (unencrypted)
2014-06-17 00:36:54 +02:00
Andreas Fischer
b56c6a535e HHVM does not like it when we call an non-existent parent constructor. 2014-06-16 22:18:19 +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
765154f54e Merge pull request #378 from bantu/UselessOverridingMethod
Always correctly link to the constructor of Crypt_Base.

* bantu/UselessOverridingMethod:
  Always correctly link to the constructor of Crypt_Base.
2014-06-16 17:03:51 +02:00
terrafrost
0bafe1e6c6 Crypt/Base: readability improvement 2014-06-16 09:57:04 -05:00
Andreas Fischer
088e31b6ea Merge pull request #373 from terrafrost/another-random-change
BigInteger: make it so you can do $min->random($max)

* terrafrost/another-random-change:
  BigInteger: one more change to the comments
  BigInteger: update comments
  BigInteger: unit test update
  BigInteger: change argument names for random / randomPrime
  BigInteger: fix unit tests
  BigInteger: fix syntax error
  BigInteger: make it so you can do $min->random($max)
2014-06-16 16:54:00 +02:00
terrafrost
82b5e02f06 Random: add explanatory comment 2014-06-16 09:53:55 -05:00
terrafrost
4401b7e21e SSH2: replace _is_includable() with stream_resolve_include_path 2014-06-16 09:47:13 -05:00
Andreas Fischer
d38886c2a9 Always correctly link to the constructor of Crypt_Base. 2014-06-16 16:42:18 +02:00
terrafrost
638e6c78ec Random: include the Crypt_* classes if they're available
also error out if none are available
2014-06-16 09:40:27 -05:00
Andreas Fischer
c05cfe4c10 Merge pull request #376 from bantu/UselessOverridingMethod
Remove unnecessary constructors.

* bantu/UselessOverridingMethod:
  Remove unnecessary constructors.
2014-06-16 16:29:28 +02:00
Andreas Fischer
5cc024a3b5 Merge pull request #377 from terrafrost/rc4-changes
RC4: speedups

* terrafrost/rc4-changes:
  RC4: speedups
2014-06-16 16:28:29 +02:00
terrafrost
4b9eb4af27 BigInteger: one more change to the comments 2014-06-16 09:23:34 -05:00
terrafrost
0938cba3c3 RC4: speedups 2014-06-16 09:19:14 -05:00
Andreas Fischer
91e78c2106 Remove unnecessary constructors. 2014-06-16 16:14:35 +02:00
terrafrost
0eb0ae7ff7 BigInteger: update comments 2014-06-16 09:09:26 -05:00
terrafrost
34a971d317 BigInteger: change argument names for random / randomPrime 2014-06-14 23:49:57 -05:00
terrafrost
f8f0bd44b7 BigInteger: fix syntax error 2014-06-14 19:20:05 -05:00
terrafrost
46166c7351 BigInteger: make it so you can do $min->random($max)
...and $min->randomPrime($max) as well
2014-06-14 14:07:33 -05:00
terrafrost
04d66db309 RC2: speed-ups and CS changes 2014-06-13 16:30:12 -05:00
terrafrost
d8b235141e RSA: CS adjustments 2014-06-13 13:17:37 -05:00
terrafrost
83301097ea RSA: rename PUBLIC_FORMAT_PKCS1_RAW -> PUBLIC_FORMAT_PKCS8
also make CRYPT_RSA_PUBLIC_FORMAT_PKCS8 the default format
2014-06-13 13:11:59 -05:00
terrafrost
4434d91f25 RSA: add support for saving encrypted PKCS8 keys 2014-06-13 11:43:32 -05:00
terrafrost
d474f56f60 Crypt/Base: adjust default key size for pbkdf1 2014-06-13 10:39:57 -05:00
terrafrost
abae026264 RSA: add support for loading PKCS8 encrypted private keys 2014-06-13 08:56:00 -05:00
terrafrost
21c6a15df3 Crypt/Base: add support for pbkdf1 2014-06-13 08:54:30 -05:00
terrafrost
0a5e26a648 RSA: add support for saving to PKCS8 (unencrypted) 2014-06-12 22:03:00 -05:00
Andreas Fischer
90bc07e292 Merge pull request #366 from terrafrost/rsa-format-change
RSA: slight adjustment to CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW format

* terrafrost/rsa-format-change:
  RSA: slight adjustment to CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW format
2014-06-11 08:05:48 +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
terrafrost
72a0913d39 RSA: slight adjustment to CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW format
CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW and CRYPT_RSA_PUBLIC_FORMAT_PKCS1
produce two very similar looking keys but they are not the same.
As dissection OpenSSL's asn1parse would reveal CRYPT_RSA_PUBLIC_FORMAT_PKCS1
has the fact that it is an RSA key embedded within it whereas
CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW does not. phpseclib now resolves
this ambiguity in the same way that OpenSSH's ssh-keygen does.

Despite this change CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW is still incompatible
with OpenSSL's rsautl (CRYPT_RSA_PUBLIC_FORMAT_PKCS1 is compatible). I guess
this incompatibility isn't just due to the headers but is also due to the
overall structure of the format.
2014-06-10 22:16:59 -05:00
Andreas Fischer
6e796d091a Merge pull request #364 from terrafrost/sftp-sort2
SFTP: add the ability for nlist() and rawlist() to be sorted

* terrafrost/sftp-sort2:
  SFTP: update one last comment
  SFTP: update unit test comments
  SFTP: add new line to end of unit test
  SFTP: assertEquals -> assertSame
  SFTP: reset sort options every time and update unit test
  SFTP: rm whitespace
  SFTP: define $sortOptions
  SFTP: add the ability for nlist() and rawlist() to be sorted
2014-06-09 20:19:33 +02:00
terrafrost
0e2b2a416b SFTP: reset sort options every time and update unit test 2014-06-09 09:22:30 -05:00
terrafrost
8dff207ed3 SFTP: rm whitespace 2014-06-05 15:06:50 -05:00
terrafrost
8c0f710083 SFTP: define $sortOptions 2014-06-05 10:50:13 -05:00
terrafrost
b64573f4b5 SFTP: add the ability for nlist() and rawlist() to be sorted 2014-06-05 09:56:49 -05:00
terrafrost
daa466db94 Merge branch 'master' of https://github.com/phpseclib/phpseclib into spkac 2014-06-05 08:40:49 -05:00
terrafrost
b1ad911d20 X509: CS adjustments 2014-06-05 08:33:27 -05:00
terrafrost
aabc5cf822 X509: PHP4 compat changes 2014-06-05 08:10:52 -05:00
terrafrost
af0040b813 RSA: PHP4 compat changes 2014-06-05 08:10:20 -05:00
terrafrost
dce03bb003 X509: add signSPKAC() and saveSPKAC() methods 2014-06-03 23:44:09 -05:00
Andreas Fischer
e6f87318f5 Adjust documentation to coding guidelines: No () around include. 2014-06-01 23:28:49 +02:00
Andreas Fischer
07e1f954de Merge pull request #325 from terrafrost/rsa-public-key
RSA: auto-detect public keys vs private keys

* terrafrost/rsa-public-key:
  RSA: update unit test file
  RSA: auto-detect public keys vs private keys
2014-06-01 22:17:38 +02:00
Andreas Fischer
eb12b347b7 Merge pull request #353 from terrafrost/biginteger-function-exists
BigInteger: "be less overly clever loading Crypt/Random"

* terrafrost/biginteger-function-exists:
  BigInteger: "be less overly clever loading Crypt/Random"
2014-05-30 15:50:36 +02:00
terrafrost
7252017268 SFTP/Stream: fix capatilization 2014-05-29 16:49:04 -05:00
terrafrost
7c08ab71d3 BigInteger: "be less overly clever loading Crypt/Random"
pretty much the same as this commit:

28f18f83ec
2014-05-29 16:31:26 -05:00
terrafrost
c0e3795319 SFTP/Stream: add explanation as to why nlist() is used here 2014-05-29 16:23:28 -05:00
terrafrost
3dd92e56e4 SFTP/Stream: use $scheme instead of 'sftp'
This makes it easier for someone to change the scheme (which can be
done by changng the stream_wrapper_register call at the bottom
of the file)
2014-05-29 16:14:03 -05:00
Andreas Fischer
aa5f9b77ec Merge pull request #349 from terrafrost/ssh2-exec-callback-termination
SSH2: make it so callback functions can make exec() return early

* terrafrost/ssh2-exec-callback-termination:
  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
Andreas Fischer
fc57e3f9c9 Merge pull request #348 from terrafrost/more-sftp-changes
More sftp changes

* terrafrost/more-sftp-changes:
  SFTP: NULL -> null
  SFTP: fix syntax error
  SFTP: add more stat functions
2014-05-28 00:02:20 +02:00
terrafrost
015d628183 Random: wrap crypt_random_string in a function_exists call 2014-05-26 18:32:36 -05: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
terrafrost
c100264b65 SFTP: NULL -> null 2014-05-26 16:32:57 -05:00
terrafrost
46ae0da314 SFTP: fix syntax error 2014-05-26 15:42:14 -05:00
terrafrost
a7fa4cc4ff SFTP: add more stat functions
also don't use stat cache for SFTP/Stream.php
2014-05-26 15:39:30 -05:00
Andreas Fischer
f1fbf9c5ae SFTP: Use the correct stat cache property: stat_cache 2014-05-22 13:32:39 +02:00
terrafrost
1ddcd6d873 SFTP: last commit had a few ommissions 2014-05-21 19:55:12 -05:00
terrafrost
4d9214970b SFTP: stat cache updates 2014-05-21 10:20:36 -05:00
Andreas Fischer
7d2a3279c6 Merge pull request #338 from terrafrost/sftp-changes-20140510
SFTP: add file_exists, is_dir and is_file functions

* terrafrost/sftp-changes-20140510:
  SFTP: use_cache -> use_stat_cache
  SFTP: switch from using file existence cache to stat cache, like PHP
  SFTP: add support for recursive nlist and rawlist
  SFTP: add file_exists, is_dir and is_file functions
2014-05-18 23:20:58 +02:00
terrafrost
36fa9e4e48 SFTP: use_cache -> use_stat_cache 2014-05-18 15:55:12 -05:00
terrafrost
e09a6968da SFTP: switch from using file existence cache to stat cache, like PHP
also add a few new functions - is_link and filesize
2014-05-18 15:34:10 -05:00
terrafrost
0a0398268a SFTP: add support for recursive nlist and rawlist 2014-05-13 17:10:32 -05:00
terrafrost
77641003fa SFTP: add file_exists, is_dir and is_file functions
also expand caching layer
2014-05-10 19:52:38 -05:00
Andreas Fischer
3a309d36ed Merge pull request #335 from terrafrost/internal-mode-speedup
BigInteger: speedup internal mode slightly

* terrafrost/internal-mode-speedup:
  BigInteger: speedup internal mode slightly
2014-05-06 00:49:44 +02:00
terrafrost
1b9c599476 ASN1: let strings in as well 2014-05-05 17:38:33 -05:00
terrafrost
7a9ea673ca ASN1: make File_ASN1 accept int primitives and not just Math_BigInteger objects when an integer is expected
The code to convert the regular integer type into the appropriate format could all just be in-line'd when an integer primitive is used but this approach is easier to read.
2014-05-05 16:39:35 -05:00
terrafrost
309c8fd555 BigInteger: speedup internal mode slightly
Changes should yield a slight speedup per the analysis at https://github.com/phpseclib/phpseclib/pull/317#issuecomment-42122335
2014-05-05 11:34:45 -05:00
Andreas Fischer
431e3a04c7 Merge branch 'int64-fix'
* int64-fix:
  BigInteger: update comments and add test case
  BigInteger: fix some int64 issues
2014-04-29 16:32:49 +02:00
terrafrost
9eb6e1ed67 BigInteger: update comments and add test case 2014-04-29 16:32:25 +02:00
terrafrost
e4ff01f054 BigInteger: fix some int64 issues 2014-04-29 16:32:25 +02:00
Andreas Fischer
c0bdf1bd90 CS: Fix "PEAR.Functions.FunctionCallSignature.Indent" sniff. 2014-04-24 00:26:02 +02:00
Andreas Fischer
b90deb5e83 Merge pull request #328 from terrafrost/get_binary_packet
SSH2: improve handling of incomplete packets

* terrafrost/get_binary_packet:
  SSH2: improve handling of incomplete packets
2014-04-19 15:44:29 +02:00
terrafrost
0cbb631852 BigInteger: explain precense of uncallable code 2014-04-18 23:43:03 -05:00
terrafrost
efd3b96dc8 SSH2: improve handling of incomplete packets 2014-04-18 16:58:00 -05: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
14cfcc1b53 Merge pull request #310 from terrafrost/keberos-fix
ASN1 changes

* terrafrost/keberos-fix:
  ASN1: test case updates
  ASN1: add test cases for latest changes
  ASN1: CS update
  ASN1: make developing new ASN.1 scripts a little easier
  ASN1: make it so bit string's can have an optional minimum size
  ASN1: explicit application tags didn't work (although implicit ones did)
2014-04-18 16:47:48 +02:00
terrafrost
317efaf28a RSA: auto-detect public keys vs private keys 2014-04-17 10:30:32 -05:00
terrafrost
10be403aff ASN1: CS update 2014-04-12 12:01:04 -05:00
terrafrost
61cd5e4f5a ASN1: make developing new ASN.1 scripts a little easier 2014-04-10 13:49:28 -05: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
24bb941799 SSH1: do fsockopen() call when login has been called 2014-04-07 00:30:50 -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
terrafrost
c8bf68ac02 ASN1: make it so bit string's can have an optional minimum size 2014-04-05 18:07:35 -05:00
Andreas Fischer
a455c1771e Merge pull request #304 from bantu/ssh-agent-psr0-fix
SSH_Agent: mv SSH_Agent to SSH/Agent and create SSH_Agent for BC

* bantu/ssh-agent-psr0-fix:
  SSH_Agent: add new line at end of file to comply with CS
  SSH_Agent: another CS update
  SSH_Agent: CS updates
  SSH_Agent: mv SSH_Agent to SSH/Agent and create SSH_Agent for BC
2014-04-01 23:13:58 +02:00
Andreas Fischer
6f4ddf0e33 SSH_Agent: add new line at end of file to comply with CS 2014-04-01 22:54:26 +02:00
terrafrost
1694012f78 SSH_Agent: another CS update 2014-03-30 16:37:11 -05:00
terrafrost
50b250ce69 SSH_Agent: CS updates 2014-03-30 16:32:05 -05:00
terrafrost
a8c2ff0fb0 add error suppression to phpinfo()
bad timezone settings can make phpinfo() throw errors so we'll just
suppress them. if there are legit non-timezone errors with php install
those will probably be hit in other parts of the code
2014-03-30 10:15:08 -05:00
terrafrost
924014fe72 SSH_Agent: mv SSH_Agent to SSH/Agent and create SSH_Agent for BC 2014-03-30 08:49:22 -05:00
terrafrost
a478b74860 ASN1: explicit application tags didn't work (although implicit ones did) 2014-03-30 01:11:47 -05:00
terrafrost
dfa583b9ea X509: Array -> array (CS consistency) 2014-03-29 15:26:50 -05:00
terrafrost
ea4dc53a06 Merge remote-tracking branch 'michael/fix_cert_time_encoding' 2014-03-29 15:25:32 -05:00
Michael Braun
457f8fbb99 fix certificate date encoding
RFC 3280 requires in section
 - 4.1.2.5 Validity
 - 5.1.2.4 This Update
 - 5.1.2.5 Next Update
 - 5.1.2.6 Revoked Certificates
that dates are to be encoded as utcTime iff they are before 2050 and
as generalTime otherwise.

Currently, phpseclib does not respect this by always choosing generalTime.
Further, the format used interally to represent dates only keeps two digits,
so dates in 2050 and later cannot be represented in this format.

This patch fixes this by
 1. changing the interal format to be capable of unambiguously representing
    dates in 2050 or later (i.e. use four digits to represent the year),
 2. choosing between utcTime and generalTime accordingly.

Without this patch, openssl_x509_parse complains:
 Warning: openssl_x509_parse(): illegal ASN1 data type for timestamp
2014-03-28 15:02:50 +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
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
aa64ddfd4d Merge pull request #280 from nickygerritsen/master
Use call_user_func, as this will work on PHP < 5.4, whereas $callback() does not

* nickygerritsen/master:
  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:01:14 +01:00
Veres Lajos
930a3fb4d2 typofixes - https://github.com/vlajos/misspell_fixer 2014-03-05 23:41:20 +00:00
Nicky Gerritsen
b5e579f6c0 Also replace this with call_user_func 2014-03-05 18:38:33 +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
c1597f4533 Remove HTML from BigInteger code example. 2014-03-01 01:40:28 +01:00
Andreas Fischer
f744fbbcc9 Set permissions of phpseclib/Crypt/RC2.php to 644. 2014-03-01 00:56:08 +01:00
terrafrost
b3a1f52bff SSH_Agent: a few changes per bantu 2014-02-21 23:15:24 -06:00
Andreas Fischer
e08c7244e2 Add newline at EOF to phpseclib/System/SSH_Agent.php. 2014-02-21 19:22:09 +01:00
Andreas Fischer
053a9ac9af Merge pull request #265 from terrafrost/ssh-agent
SSH2: add ssh-agent support

* terrafrost/ssh-agent:
  SSH_Agent: phpdoc updates
  SSH_Agent: misc updates
  SSH2: add ssh-agent support
2014-02-21 19:17:51 +01:00
terrafrost
b4b93b80f5 SSH_Agent: phpdoc updates 2014-02-20 13:38:07 -06:00
terrafrost
405ff3f7b4 SSH_Agent: misc updates 2014-02-19 10:13:54 -06:00
Andreas Fischer
56f1ada5c1 CS: Each file MUST end with exactly one newline character 2014-02-10 14:51:35 +01:00
terrafrost
e90648c7a5 SSH2: add ssh-agent support 2014-02-10 00:04:16 -06:00
Andreas Fischer
f4dbcb1b78 Merge pull request #264 from terrafrost/exit-status
SSH2: ignore exit_status channel requests

* terrafrost/exit-status:
  SSH2: ignore exit_status channel requests
2014-02-03 16:56:36 +01:00
terrafrost
cd9801db8a SSH2: ignore exit_status channel requests
Fixes #258
2014-02-02 23:42:06 -06:00
Hans-Jürgen Petrich
50f46959ed Ciphers: Adding setEngine() and some optimizations
Ciphers: Adding setEngine() and some optimizations
2014-01-31 06:13:14 +07:00
Graham Campbell
1c2796e3eb Cleaned up whitespace 2014-01-18 17:29:25 +00: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
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
466f9354df SFTP: make get() return correctly sized strings 2013-12-27 11:08:33 -06:00
terrafrost
d2c4ccfc28 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-12-27 10:24:47 -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
Andreas Fischer
f63798b923 Merge pull request #233 from terrafrost/phar-fix
SSH2: better accomodate Phar's

* terrafrost/phar-fix:
  SSH2: better accomodate Phar's
2013-12-26 19:43:26 +01:00
Andreas Fischer
9c7c01c337 Merge pull request #223 from mpscholten/fix-ssh1-php55
Fix Net_SSH1 on Php5.5 (/e preg_replace modifier)

* mpscholten/fix-ssh1-php55:
  Fixed classname of test
  Fixed some wrong @see annotations
  Fixed /e preg_replace modifier exactly like in 0dc8b27a6a
  Added Net_SSH1::_format_log test
2013-12-26 18:41:25 +01:00
Marc Philip Scholten
6d8c02c432 Fixed some wrong @see annotations 2013-12-26 12:09:40 +01:00
Andreas Fischer
0f69d35584 Fix indentation of _append_log in SSH1 and SSH2. 2013-12-26 11:45:24 +01:00