mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 03:27:31 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
c547ee16c7
@ -36,9 +36,9 @@
|
||||
- Random: fix issues with serialize() (#932)
|
||||
- RC2: fix issue with decrypting
|
||||
- RC4: fix issue with key not being truncated correctly
|
||||
- SFTP: nlist() on a non-existant directory resulted in error
|
||||
- SFTP: nlist() on a non-existent directory resulted in error
|
||||
- SFTP: add is_writable, is_writeable, is_readable
|
||||
- RSA: fix PHP4 compatability issue
|
||||
- RSA: fix PHP4 compatibility issue
|
||||
|
||||
## 1.0.1 - 2016-01-18
|
||||
|
||||
@ -115,7 +115,7 @@
|
||||
- truncate
|
||||
- improved file type detection
|
||||
- put() can write to te middle of a file
|
||||
- mkdir accepts the same paramters that PHP's mkdir does
|
||||
- mkdir accepts the same parameters that PHP's mkdir does
|
||||
- the ability to upload/download 2GB files
|
||||
- across-the-board speedups for the various encryption algorithms
|
||||
- multi-factor authentication support for Net_SSH2
|
||||
|
@ -1274,7 +1274,7 @@ abstract class Base
|
||||
* PHP's OpenSSL bindings do not operate in continuous mode so we'll wrap around it. Since the keystream
|
||||
* for CTR is the same for both encrypting and decrypting this function is re-used by both Base::encrypt()
|
||||
* and Base::decrypt(). Also, OpenSSL doesn't implement CTR for all of it's symmetric ciphers so this
|
||||
* function will emulate CTR with ECB when necesary.
|
||||
* function will emulate CTR with ECB when necessary.
|
||||
*
|
||||
* @see self::encrypt()
|
||||
* @see self::decrypt()
|
||||
@ -2503,7 +2503,7 @@ abstract class Base
|
||||
* is stored, classwide (!), here for reusing.
|
||||
*
|
||||
* The string-based index of $function is a classwide
|
||||
* uniqe value representing, at least, the $mode of
|
||||
* unique value representing, at least, the $mode of
|
||||
* operation (or more... depends of the optimizing level)
|
||||
* for which $mode the lambda function was created.
|
||||
*
|
||||
|
@ -1302,7 +1302,7 @@ class DES extends Base
|
||||
// After that, we'll still create very fast optimized code but not the hi-ultimative code, for each $mode one
|
||||
$gen_hi_opt_code = (bool)( count($lambda_functions) < 10 );
|
||||
|
||||
// Generation of a uniqe hash for our generated code
|
||||
// Generation of a unique hash for our generated code
|
||||
$code_hash = "Crypt_DES, $des_rounds, {$this->mode}";
|
||||
if ($gen_hi_opt_code) {
|
||||
// For hi-optimized code, we create for each combination of
|
||||
|
@ -565,7 +565,7 @@ class RC2 extends Base
|
||||
// (Currently, for Crypt_RC2, one generated $lambda_function cost on php5.5@32bit ~60kb unfreeable mem and ~100kb on php5.5@64bit)
|
||||
$gen_hi_opt_code = (bool)(count($lambda_functions) < 10);
|
||||
|
||||
// Generation of a uniqe hash for our generated code
|
||||
// Generation of a unique hash for our generated code
|
||||
$code_hash = "Crypt_RC2, {$this->mode}";
|
||||
if ($gen_hi_opt_code) {
|
||||
$code_hash = str_pad($code_hash, 32) . $this->_hashInlineCryptFunction($this->key);
|
||||
|
@ -673,7 +673,7 @@ class Twofish extends Base
|
||||
// (Currently, for Crypt_Twofish, one generated $lambda_function cost on php5.5@32bit ~140kb unfreeable mem and ~240kb on php5.5@64bit)
|
||||
$gen_hi_opt_code = (bool)(count($lambda_functions) < 10);
|
||||
|
||||
// Generation of a uniqe hash for our generated code
|
||||
// Generation of a unique hash for our generated code
|
||||
$code_hash = "Crypt_Twofish, {$this->mode}";
|
||||
if ($gen_hi_opt_code) {
|
||||
$code_hash = str_pad($code_hash, 32) . $this->_hashInlineCryptFunction($this->key);
|
||||
|
@ -244,7 +244,11 @@ class X509
|
||||
/**
|
||||
* The signature subject
|
||||
*
|
||||
<<<<<<< HEAD
|
||||
* There's no guarantee \phpseclib\File\X509 is going to reencode an X.509 cert in the same way it was originally
|
||||
=======
|
||||
* There's no guarantee File_X509 is going to re-encode an X.509 cert in the same way it was originally
|
||||
>>>>>>> 1.0
|
||||
* encoded so we take save the portion of the original cert that the signature would have made for.
|
||||
*
|
||||
* @var string
|
||||
@ -3101,7 +3105,7 @@ class X509
|
||||
|
||||
$asn1 = new ASN1();
|
||||
|
||||
// OpenSSL produces SPKAC's that are preceeded by the string SPKAC=
|
||||
// OpenSSL produces SPKAC's that are preceded by the string SPKAC=
|
||||
$temp = preg_replace('#(?:SPKAC=)|[ \r\n\\\]#', '', $spkac);
|
||||
$temp = preg_match('#^[a-zA-Z\d/+]*={0,2}$#', $temp) ? base64_decode($temp) : false;
|
||||
if ($temp != false) {
|
||||
@ -3188,7 +3192,7 @@ class X509
|
||||
return $spkac;
|
||||
// case self::FORMAT_PEM:
|
||||
default:
|
||||
// OpenSSL's implementation of SPKAC requires the SPKAC be preceeded by SPKAC= and since there are pretty much
|
||||
// OpenSSL's implementation of SPKAC requires the SPKAC be preceded by SPKAC= and since there are pretty much
|
||||
// no other SPKAC decoders phpseclib will use that same format
|
||||
return 'SPKAC=' . base64_encode($spkac);
|
||||
}
|
||||
|
@ -2476,7 +2476,7 @@ class BigInteger
|
||||
*
|
||||
* Say you have 693 and 609. The GCD is 21. Bezout's identity states that there exist integers x and y such that
|
||||
* 693*x + 609*y == 21. In point of fact, there are actually an infinite number of x and y combinations and which
|
||||
* combination is returned is dependant upon which mode is in use. See
|
||||
* combination is returned is dependent upon which mode is in use. See
|
||||
* {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information.
|
||||
*
|
||||
* Here's an example:
|
||||
|
@ -339,7 +339,7 @@ class SFTP extends SSH2
|
||||
);
|
||||
// http://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-6.3
|
||||
// the flag definitions change somewhat in SFTPv5+. if SFTPv5+ support is added to this library, maybe name
|
||||
// the array for that $this->open5_flags and similarily alter the constant names.
|
||||
// the array for that $this->open5_flags and similarly alter the constant names.
|
||||
$this->open_flags = array(
|
||||
0x00000001 => 'NET_SFTP_OPEN_READ',
|
||||
0x00000002 => 'NET_SFTP_OPEN_WRITE',
|
||||
|
@ -395,7 +395,7 @@ class SSH2
|
||||
var $server_public_host_key;
|
||||
|
||||
/**
|
||||
* Session identifer
|
||||
* Session identifier
|
||||
*
|
||||
* "The exchange hash H from the first key exchange is additionally
|
||||
* used as the session identifier, which is a unique identifier for
|
||||
@ -2385,7 +2385,7 @@ class SSH2
|
||||
|
||||
// RFC4254 defines the (client) window size as "bytes the other party can send before it must wait for the window to
|
||||
// be adjusted". 0x7FFFFFFF is, at 2GB, the max size. technically, it should probably be decremented, but,
|
||||
// honestly, if you're transfering more than 2GB, you probably shouldn't be using phpseclib, anyway.
|
||||
// honestly, if you're transferring more than 2GB, you probably shouldn't be using phpseclib, anyway.
|
||||
// see http://tools.ietf.org/html/rfc4254#section-5.2 for more info
|
||||
$this->window_size_server_to_client[self::CHANNEL_EXEC] = $this->window_size;
|
||||
// 0x8000 is the maximum max packet size, per http://tools.ietf.org/html/rfc4253#section-6.1, although since PuTTy
|
||||
|
@ -23,9 +23,8 @@ use phpseclib\System\SSH\Agent;
|
||||
* Instantiation should only be performed by \phpseclib\System\SSH\Agent class.
|
||||
* This could be thought of as implementing an interface that phpseclib\Crypt\RSA
|
||||
* implements. ie. maybe a Net_SSH_Auth_PublicKey interface or something.
|
||||
* The methods in this interface would be getPublicKey, setSignatureMode
|
||||
* and sign since those are the methods phpseclib looks for to perform
|
||||
* public key authentication.
|
||||
* The methods in this interface would be getPublicKey and sign since those are the
|
||||
* methods phpseclib looks for to perform public key authentication.
|
||||
*
|
||||
* @package SSH\Agent
|
||||
* @author Jim Wigginton <terrafrost@php.net>
|
||||
@ -148,7 +147,7 @@ class Identity
|
||||
$length = current(unpack('N', fread($this->fsock, 4)));
|
||||
$type = ord(fread($this->fsock, 1));
|
||||
if ($type != Agent::SSH_AGENT_SIGN_RESPONSE) {
|
||||
user_error('Unable to retreive signature');
|
||||
user_error('Unable to retrieve signature');
|
||||
}
|
||||
|
||||
$signature_blob = fread($this->fsock, $length - 1);
|
||||
|
@ -71,7 +71,7 @@ class Unit_Crypt_RC2Test extends PhpseclibTestCase
|
||||
|
||||
// now, to OpenSSL's credit, null padding is internally consistent with OpenSSL. OpenSSL only supports fixed length keys. For rc2, rc4 and
|
||||
// bf (blowfish), all keys are 128 bits (or are null padded / truncated accordingly). to use 40-bit or 64-bit keys with RC4 with OpenSSL you
|
||||
// don't use the rc4 algorithm - you use the rc4-40 or rc4-64 algorithm. and similarily, it's not aes-cbc that you use - it's either aes-128-cbc
|
||||
// don't use the rc4 algorithm - you use the rc4-40 or rc4-64 algorithm. and similarly, it's not aes-cbc that you use - it's either aes-128-cbc
|
||||
// or aes-192-cbc or aes-256-cbc. this is in contrast to mcrypt, which (with the exception of RC2) actually supports variable and arbitrary
|
||||
// length keys.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user