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

624 Commits

Author SHA1 Message Date
terrafrost
5c3c9f990f SFTP: remove isset() from constructor 2013-06-10 15:42:35 -05:00
terrafrost
799c8e322f Merge pull request #119 from VaclavSir/sftp_default_port
Net_SFTP_Stream: Use default SFTP port, if no port specified
2013-06-10 13:40:54 -07:00
Vaclav Sir
b0ee4d5591 Net_SFTP_Stream: Use default SFTP port, if not set otherwise. 2013-06-10 21:40:03 +02:00
terrafrost
a83ff6cad8 SFTP: add _close_handle() function and close handle on put failure 2013-06-10 13:21:58 -05:00
terrafrost
d79ce65fe3 SSH2: close channel and break after exit-signal
Prior to efdec7b118 exit-signal's would re-use exit-status's channel closing code. after that commit, however, exit-status specific code was added, which meant that falling through, without the break, broke things
2013-06-10 10:57:34 -05:00
terrafrost
fe3765fe17 X509: don't validate self-signed certs by default 2013-06-08 12:40:39 -05:00
terrafrost
9bcee47f2e Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-06-08 11:12:49 -05:00
terrafrost
043ad01eca BigInteger: refactor randomPrime somewhat 2013-06-08 11:10:52 -05:00
terrafrost
2ec8c8c925 Merge pull request #117 from bantu/elliptic-curve-preparation
Preparation for ECDH in SSH
2013-06-07 15:24:24 -07:00
terrafrost
e85f5c7198 SSH2: Update timeout functionality
Make it so Net_SSH2 doesn't close channel upon timeout. only if reset() is closed will channel be closed.
Also add isTimeout() function
2013-06-07 17:21:11 -05:00
Andreas Fischer
61279f1fb6 [feature/elliptic-curve] Add comment for generator 2 and sha1 hash function. 2013-06-07 01:03:03 +02:00
Andreas Fischer
2fcbd77605 [feature/elliptic-curve] Associate the generator (decimal 2) with the prime. 2013-06-07 00:58:09 +02:00
Andreas Fischer
1c63d4b746 [feature/elliptic-curve] Specify prime data to BigInteger directly in base 16. 2013-06-07 00:55:23 +02:00
Andreas Fischer
1a200f8c7b [feature/elliptic-curve] Rename $p -> $prime 2013-06-07 00:53:21 +02:00
Andreas Fischer
7253e77386 [feature/elliptic-curve] Do not instantiate unnecessary $x instance. 2013-06-07 00:47:59 +02:00
Andreas Fischer
97cf60900d [feature/elliptic-curve] Rename $q to $max because that's what it is. 2013-06-07 00:47:37 +02:00
Andreas Fischer
50f5f3f97e [feature/elliptic-curve] Assign a variable to Math_BigInteger(1). 2013-06-07 00:43:40 +02:00
Andreas Fischer
a730ed6e4c [feature/elliptic-curve] Use an instance of Crypt_Hash instead of sha1(). 2013-06-07 00:38:38 +02:00
Andreas Fischer
dadaaf791e Remove unused variable $generator from Math_BigInteger::random(). 2013-06-06 17:17:15 +02:00
terrafrost
32a47d2fbc BigInteger: docblock update 2013-06-06 00:02:26 -05:00
terrafrost
e25ae8c4f4 Merge pull request #114 from bantu/fix-weak-ssh-dh-keys
Fix weak ssh dh keys
2013-06-05 21:57:15 -07:00
Hans-Jürgen Petrich
6c4b0cb833 RC4: removed __destruct()
Re: https://github.com/phpseclib/phpseclib/issues/107
2013-06-03 06:39:18 +07:00
Andreas Fischer
727dba5905 [remove-svn-version-lines] Remove useless @version: $Id$ lines.
These lines served some purpose on SVN, but are now useless on Git. They
actually do harm as they might make people think their files are older
than they actually are.
2013-06-02 18:50:46 +02:00
Andreas Fischer
aa2e1ff177 [sourceforge-url-typo] {htp:// -> http://}phpseclib.sourceforge.net 2013-06-02 17:56:05 +02:00
Andreas Fischer
1733c3366c [fix-weak-ssh-dh-keys] bitwise_leftShift() expects number of bits, not bytes. 2013-06-02 16:55:19 +02:00
Andreas Fischer
252c6ec68d [fix-weak-ssh-dh-keys] $keyLength is in bytes. Do not compare to 160 bits. 2013-06-02 16:54:02 +02:00
Hans-Jürgen Petrich
fb8d185804 Base/AES/Rijndael: Optimizations
- Base/Rijndael/AES: Comments updated.

- Base: removed __desctructor(). Re:
https://github.com/phpseclib/phpseclib/issues/107

- Base: setPassword() will use >= php-5.5's new (faster) hash_pbkdf2()
function if availalbe/possible. 100% compatible to the internal
implementation. Strong testet with all
hashes/iterations/lengths/ciphers.

- Rijndael: Runtime engine-switch: Will now use mcrypt (in case of
128/192/256-bit block/keys), if possible. Otherwise MODE_INTERNAL.

AES: Soucecode reducing. After all, now, AES.php is virtually nothing
other than a wrapper to Rijndael.php::new
Crypt_Rijndael()->setBlockLength(128). No different in speed or
functionality, but fixed block_size.
2013-06-02 16:21:32 +07:00
Hans-Jürgen Petrich
53276ba4a1 AES: inconsistencey with 160 / 224-bits keys
re: https://github.com/phpseclib/phpseclib/issues/110
2013-06-01 08:00:04 +07:00
terrafrost
dc76cf5b8e SSH2: add $callable parameter to exec() 2013-05-28 17:02:27 -05:00
Hans-Jürgen Petrich
e71ec8f4c8 CS adjustments 2013-05-25 18:10:20 +07:00
Hans-Jürgen Petrich
35f1b8dc2b Method namings 2013-05-25 14:08:17 +07:00
Hans-Jürgen Petrich
5429504aee CS adjustment 2013-05-25 11:22:25 +07:00
Hans-Jürgen Petrich
995c09cb67 CS and method namings 2013-05-25 09:05:24 +07:00
Hans-Jürgen Petrich
72fa880aa2 BL/TF optimizations. 3DES: +20% speed
- Blowfish/Twofish small optimizations

- 3DES +20% speedup from Patrick's commit:
f596c577cf
2013-05-23 01:11:08 +07:00
Patrick Monnerat
f596c577cf DES: move IP/inverse IP transforms out of the round loop in inline_crypt_setup().
This is another 20% runtime gain on triple DES.
2013-05-21 16:01:10 +02:00
Hans-Jürgen Petrich
55ff00cc35 Crypt_Base
Crypt_Base() implementation
2013-05-20 13:19:38 +07:00
Hans-Jürgen Petrich
448be87e83 Twofish: bugfix in setPasswort()
fixed bug in setPasswort()... (occurred only in Twofish.php)
2013-05-19 23:35:06 +07:00
terrafrost
eabd0a8963 SFTP: add the same multi-factor auth support that Net_SSH2 enjoys 2013-05-14 17:32:31 -05:00
terrafrost
6fdac04fd1 SSH2: fix broken grammer from next to last commit
Thanks, bantu!
2013-05-14 17:15:23 -05:00
terrafrost
7fe989a449 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-05-14 17:13:06 -05:00
terrafrost
cb10016291 SFTP: attempt to utilize SFTP via CLI if subsystem is unavailable 2013-05-14 17:08:54 -05:00
terrafrost
742fbc188f SSH2: return false (without error) on channel failure
Also update error message. SFTP, for example, makes a channel request even though it's not asking to open a pseudo-terminal.
2013-05-14 16:16:06 -05:00
terrafrost
b2262f731d Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-05-14 11:02:45 -05:00
terrafrost
33e415cb4d Merge remote-tracking branch 'vlajos/master' 2013-05-14 11:01:58 -05:00
terrafrost
af3f275f19 SFTP: $content isn't defined when file is being written to 2013-05-14 10:43:17 -05:00
terrafrost
ff88b7e685 ASN1: CS adjustments 2013-05-14 10:38:01 -05:00
terrafrost
40af708254 Merge pull request #106 from petrich/optimizations
Optimizations
2013-05-14 08:35:31 -07:00
terrafrost
2ab6497e41 Merge remote-tracking branch 'origin/largerfiles' 2013-05-13 22:38:11 -05:00
terrafrost
1e2d0ccd9f SSH2: window size is server -> client, not client -> server 2013-05-13 22:37:32 -05:00
Hans-Jürgen Petrich
b242259d17 optimizations 2013-05-13 12:41:52 +07:00
terrafrost
06044e8632 SSH2: 0x7FFFFFFF == 2GB not 4GB 2013-05-10 16:48:10 -05:00
terrafrost
a48871a865 SSH2: realtime_file logging update 2013-05-10 17:45:57 -04:00
Veres Lajos
ddaf520b3b typofixes 2013-05-10 11:51:49 +01:00
terrafrost
8aada4b30d SFTP: looks like some SFTP servers will fail unless write flag is also enabled 2013-05-09 16:35:47 -05:00
terrafrost
b4ebc5b931 SFTP: fix formatting of touch open call 2013-05-09 17:27:56 -04:00
terrafrost
d2d4e89ffc SFTP: typo 2013-05-09 13:23:54 -04:00
terrafrost
2c80ac8aca SFTP: Add support for files larger than 2GB
0x7FFFFFFF is about 2GB. To support larger files floating point is used
2013-05-09 00:02:04 -05:00
terrafrost
aa3e6c1a99 SSH2: rm last commit; _get_channel_packet() takes care of this lol 2013-05-08 15:13:18 -04:00
terrafrost
b440708a7b SSH2: check response in exec() 2013-05-08 11:44:34 -05:00
terrafrost
63ec6e2055 SFTP: remove $start = $offset line
$start isn't used anywhere in the function
2013-05-08 10:20:35 -05:00
terrafrost
0bdf39c83b Merge pull request #101 from johnsterling/rsa-comment
Add support for custom RSA key comments.
2013-05-08 08:11:20 -07:00
Veres Lajos
dd2a4ddff2 typofixes 2013-05-08 15:34:07 +01:00
terrafrost
9ac94a7b74 Merge pull request #103 from rlerdorf/patch-1
Fix a couple of minor logic problems
2013-05-08 05:19:49 -07:00
Hans-Jürgen Petrich
fe0cc95265 SSH2: Blowfish: typo... block_size adjustment
Changed: Blowfish block_size = 8
re: https://github.com/phpseclib/phpseclib/pull/100
2013-05-08 13:52:18 +07:00
Rasmus Lerdorf
b47109cf55 And here too, size-related logic problems 2013-05-07 23:21:53 -07:00
Rasmus Lerdorf
e24d7612a2 I think this is what you meant to do here 2013-05-07 23:19:50 -07:00
terrafrost
c89db52e39 Twofish: make CS more consistent 2013-05-07 23:23:07 -05:00
terrafrost
d396b0c503 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-05-07 23:18:07 -05:00
terrafrost
e3a2772c30 SSH2: Add Crypt_Blowfish 2013-05-07 23:17:17 -05:00
John Sterling
c1244805cf Add support for custom RSA key comments.
Add ivar and set/getComment() instead of constant. Also parse comment from applicable formats in loadKey().
2013-05-05 19:38:34 -04:00
Hans-Jürgen Petrich
dcac12003a Blowfish
Blowfish implementation
2013-05-05 09:32:00 +07:00
Hans-Jürgen Petrich
a83166fe48 SSH2: Typo (Twofish related..)
Typo...
2013-05-05 08:59:44 +07:00
terrafrost
5dda3a088f SSH2: Twofish typos 2013-05-04 13:55:51 -05:00
terrafrost
2c43e9151c SSH2: add twofish support 2013-05-03 01:45:09 -05:00
terrafrost
3ac29adff1 Merge remote-tracking branch 'petrich/master' into twofish 2013-05-03 01:43:43 -05:00
terrafrost
232d3e2725 Random: remove comment for old code 2013-05-01 08:13:41 -05:00
terrafrost
65a6c85450 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-05-01 00:33:13 -05:00
terrafrost
cb36b811a0 Random: use constant for windows test
BigInteger: Docblock adjustments
2013-05-01 00:30:01 -05:00
Hans-Jürgen Petrich
be47960908 Twofish
Twofish implementation
2013-04-30 17:26:14 +07:00
Hans-Jürgen Petrich
6b7c1da103 DES: removed debug code
removed debug code
2013-04-30 14:53:27 +07:00
terrafrost
960dbe4f62 Merge pull request #94 from petrich/DES-3DES-Performance-Update
DES/3DES performance update
2013-04-30 00:13:36 -07:00
terrafrost
08e987cede BigInteger: Docblock adjustments 2013-04-27 20:55:25 -05:00
terrafrost
3230a7b1f7 SSH2: Add getBannerMessage() function 2013-04-27 19:58:24 -05:00
terrafrost
83ebb08f0a SCP: Update example 2013-04-27 16:06:05 -05:00
terrafrost
9555ddc212 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-04-27 16:04:27 -05:00
terrafrost
4c8173dc23 Add an SCP class 2013-04-27 16:03:35 -05:00
terrafrost
8cecaf2d2b SSH2: another CS adjustment 2013-04-27 14:12:59 -05:00
terrafrost
04f5a28bff SSH2: CS adjustments 2013-04-27 14:10:36 -05:00
terrafrost
46f3039217 SFTP: Fix broken mkdir
Thanks Antek88!
2013-04-26 18:36:00 -05:00
Hans-Jürgen Petrich
c4752cbeba DES / 3DES Performance Update
DES / 3DES Performance Update.
Inline en/decrypting gives additional ~25% performance.
100% compatible with the current DES/TribleDES.php
Strong testet on Windows/Linux 32/64bit with php4/5.0/5.1//5.2/5.3/5.4
2013-04-25 14:16:10 +07:00
Patrick Monnerat
a13684584c DES: fix file permissions. 2013-04-24 11:02:01 +02:00
Patrick Monnerat
a8e5ccf895 DES: pre-permuted tables version. 2013-04-24 11:00:11 +02:00
terrafrost
d6ee41d957 SSH2: fix E_NOTICE in keyboard interactive code
Thanks ravage84!
2013-04-24 01:07:32 -05:00
mdesign83
2b4e940885 SFTP: Adding missing status codes 2013-04-23 16:04:50 +02:00
terrafrost
a229b2a32d Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-04-20 20:45:00 -05:00
terrafrost
292340cdd5 SSH2: Improve timeout handling
(thanks, SergeyTsalkov!)
2013-04-20 20:43:05 -05:00
terrafrost
f16d8ba6b2 Hash: docblock updates 2013-04-20 20:09:42 -05:00
terrafrost
e0abab9bb4 SSH2: keyboard-interactive changes
Let's say your SSH server had a two-part keyboard-interactive auth. One prompt is for "Password" and the other is for "Verification code". Previously you'd have to do this:

$ssh->login($username, 'pass1', 'code1');

It'd try password authentication with pass1, fail, then do keyboard-interactive with pass1 and then keyboard-interacitve with code1.

ie. the order in which it tried stuff was dependent on the order it was past to the Net_SSH2 object.  And it'd always try password auth first.

Now you can go straight to keyboard-interactive and mix the order as follows:

$ssh->login($username, array('Password' => 'pass1'), array('Verification code' => 'code1'));
2013-04-20 14:35:08 -05:00
terrafrost
04c24f6bbc SSH2: More multi-factor authentication changes
Previously to do multi-factor authentication you'd have to do this:

$ssh->login($user, 'pass1');
$ssh->login($user, 'pass2');

Now you can do this too:

$ssh->login($user, 'pass1', 'pass2');
2013-04-20 14:33:07 -05:00
terrafrost
ccd4ce1d19 SSH2: add support for multi-factor authentication 2013-04-19 22:23:06 -05:00