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
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
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
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
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
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.
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.
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
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
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
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
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
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)
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)
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
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
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.
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
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
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
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.
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)
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
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.
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
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
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
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.
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
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