1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-12-02 17:48:00 +01:00
Commit Graph

917 Commits

Author SHA1 Message Date
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
Andreas Fischer
14ba37c539 Merge branch 'master' into php5
* master:
  SSH2: make $mac_algorithms non-static
2014-06-11 07:49:02 +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
f40bc4d3b8 Merge branch 'master' into php5
* master:
  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:39 +02: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
Andreas Fischer
b217994534 Add missing use BigInteger statement to X509. 2014-06-05 17:08:36 +02:00
terrafrost
b64573f4b5 SFTP: add the ability for nlist() and rawlist() to be sorted 2014-06-05 09:56:49 -05:00
Andreas Fischer
2a9d7e5e03 Merge branch 'master' into php5
* master:
  X509: Unit test CS changes
  X509: move location of SPKAC unit test
  X509: CS adjustments
  X509: PHP4 compat changes
  RSA: PHP4 compat changes
  X509: rm trailing white space from unit test
  X509: add SPKAC unit test
  X509: add signSPKAC() and saveSPKAC() methods
2014-06-05 16:56:36 +02: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
a643e5bfb5 Correct the remaining case by using instanceof. 2014-06-02 20:24:25 +02:00
Andreas Fischer
f2f5fcd70a Update users of Math_BigInteger. 2014-06-02 20:19:00 +02:00
Andreas Fischer
65ec4dc8bc Some more documentation polishing in Math/BigInteger.php. 2014-06-02 20:19:00 +02:00
Andreas Fischer
a011596578 Replace new Math_BigInteger with new static. 2014-06-02 20:19:00 +02:00
Andreas Fischer
740422c65f Reference to instances as BigInteger instead of Math_BigInteger. 2014-06-02 20:19:00 +02:00
Andreas Fischer
00f77ab341 Use namespace in example code. 2014-06-02 20:19:00 +02:00
Andreas Fischer
ae4099dc64 Remove any include statement. 2014-06-02 20:19:00 +02:00
Andreas Fischer
8dff257cae Add namespace statement. Rename class. 2014-06-02 20:17:18 +02:00
Andreas Fischer
7d9598a21e Use __construct. 2014-06-02 20:17:18 +02:00
Andreas Fischer
6f4a873cad Merge branch 'master' into php5
* master:
  Adjust documentation to coding guidelines: No () around include.
2014-06-02 12:51:24 +02:00
Andreas Fischer
e6f87318f5 Adjust documentation to coding guidelines: No () around include. 2014-06-01 23:28:49 +02:00
Andreas Fischer
02e06a2c55 Merge branch 'master' into php5
* master:
  RSA: update unit test file
  RSA: auto-detect public keys vs private keys
2014-06-01 22:17:38 +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
Andreas Fischer
4a89349615 Merge branch 'master' into php5
* master:
  BigInteger: "be less overly clever loading Crypt/Random"
2014-05-30 15:50:36 +02:00
Andreas Fischer
7e2289656a Merge branch 'master' into php5
* master:
  SFTP/Stream: fix capatilization
  SFTP/Stream: add explanation as to why nlist() is used here
  SFTP/Stream: use $scheme instead of 'sftp'
2014-05-30 00:00:05 +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
712f820a26 Merge branch 'master' into php5
* master:
  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
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
5ff1c9a349 Merge branch 'master' into php5
* master:
  SFTP: NULL -> null
  SFTP: fix syntax error
  SFTP: add more stat functions
2014-05-28 00:02:23 +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
Andreas Fischer
958430b5a8 Merge branch 'master' into php5
* master:
  Random: wrap crypt_random_string in a function_exists call
2014-05-27 12:24:52 +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
518eb861e9 Merge branch 'master' into php5
* master:
  SFTP: Use the correct stat cache property: stat_cache
2014-05-22 15:27:56 +02:00
Andreas Fischer
f1fbf9c5ae SFTP: Use the correct stat cache property: stat_cache 2014-05-22 13:32:39 +02:00
Andreas Fischer
39b9ffffdf Merge branch 'master' into php5
* master:
  SFTP: last commit had a few ommissions
  SFTP Functional tests: Make use of assertNotSame
  SFTP Functional tests: Keep story linear.
  SFTP: add more unit tests
2014-05-22 13:25:57 +02:00
terrafrost
1ddcd6d873 SFTP: last commit had a few ommissions 2014-05-21 19:55:12 -05:00
Andreas Fischer
4524b9f663 Merge branch 'master' into php5
* master:
  SFTP: stat cache updates
  SFTP: Rudimentary tests for file_exists(), is_file(), is_dir().
2014-05-21 17:55:42 +02:00
terrafrost
4d9214970b SFTP: stat cache updates 2014-05-21 10:20:36 -05:00
Andreas Fischer
6b2b01347f Merge branch 'master' into php5
* master:
  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:21:17 +02: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
b7ebb1e0e3 Merge branch 'master' into php5
* master:
  BigInteger: speedup internal mode slightly
2014-05-06 00:49:46 +02: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
Andreas Fischer
1821f6b28f Merge branch 'master' into php5
* master:
  ASN1: let strings in as well
  ASN1: make File_ASN1 accept int primitives and not just Math_BigInteger objects when an integer is expected
2014-05-06 00:41:59 +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
1d01f56f28 Merge branch 'master' into php5
* master:
  BigInteger: update comments and add test case
  BigInteger: fix some int64 issues
2014-04-29 16:32:59 +02: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
8eeb201de8 Merge branch 'master' into php5
* master:
  CS: Fix "PEAR.Functions.FunctionCallSignature.Indent" sniff.
2014-04-24 00:41:20 +02:00
Andreas Fischer
c0bdf1bd90 CS: Fix "PEAR.Functions.FunctionCallSignature.Indent" sniff. 2014-04-24 00:26:02 +02:00
Andreas Fischer
b3081f2a61 Merge branch 'master' into php5
* master:
  SSH2: improve handling of incomplete packets
2014-04-19 15:46:56 +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
Andreas Fischer
5cfe1560a0 Merge branch 'master' into php5
* master:
  BigInteger: explain precense of uncallable code
2014-04-19 14:05:12 +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
a7da467819 Merge branch 'master' into php5
* master:
  Added some simple Net_SSH2 tests
2014-04-18 16:55:42 +02: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
bf7abfcfce Merge branch 'master' into php5
* master:
  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:48:05 +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
Andreas Fischer
7348ab6ef7 Remove deprecated method Math_BigInteger::setRandomGenerator(). 2014-04-13 01:04:37 +02: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
Andreas Fischer
58cdf692f8 Merge branch 'master' into php5
* master:
  SSH2: move _connect() call to _login() from login()
  SSH2: phpdoc updates
  SSH: clarify role of constructor / connection timeout
  SSH1: do fsockopen() call when login has been called
  SSH2: != -> |=
  SSH2: phpdoc changes
  SSH2: syntax error
  SSH2: timeout set in constructor != timeout set by setTimeout()
  SSH2: add phpdoc header
  SSH2: connect to server in login() function

Conflicts:
	phpseclib/Net/SSH2.php
2014-04-10 18:00:38 +02: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
0288817203 Remove the phpseclib/System/SSH_Agent.php BC file. 2014-04-01 23:15:16 +02:00
Andreas Fischer
b7729feea0 Merge branch 'master' into php5
* master:
  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:14:44 +02: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