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
- PHP4 doesn't allow method chaining
- $_SESSION isn't always defined
- on PHP5.1 and earlier using 0x100000000 instead of 4294967296 gives E_NOTICE
- array('Net_SSH2', 'func_name') doesn't work so we fix this by passing $this to it.
to make that work on PHP4 pass by call-time reference. normally this would result
in a fatal error on PHP5.4+ but doesn't seem to in this case. the following URL
elaborates:
http://stackoverflow.com/q/20732563/569976
sending the close channel packet right after the eof seems to make some scp transfers terminate prematurely.
unfortunately, sometimes this behavior is undesirable as it is in this case:
http://www.frostjedi.com/phpbb3/viewtopic.php?f=46&t=29457
hence the $want_reply parameter
also, this commit makes the scp packet length account for the length portion