terrafrost
4a96cc8024
Use base-2**26 on systems with 32-bit ints and base-2**31 on systems with 64-bit ints
2013-02-17 17:52:59 -06:00
terrafrost
0333805f5c
SSH2: Add isConnected() function
2013-02-16 14:58:12 -06:00
terrafrost
25c7e7bd96
SFTP: Add touch function
...
Also make it so chmod will auto-switch the filename / permissions if they're not in the "right" order (PHP's chmod and ftp_chmod order them differently from each other so this'll make phpseclib consistent with both)
2013-02-14 12:10:36 -06:00
terrafrost
faaa52774f
SFTP: Add the ability to write to specific parts of files
2013-02-12 20:45:09 -06:00
Mike Kruk
d7e4678fc4
Use enablePTY() to get a PTY with exec() calls. While exec() is running
...
you can use read() and write() to interact with the shell.
2013-02-08 17:04:52 -05:00
Hans-Jürgen Petrich
93f9922410
Small CS fix [2]
2013-02-07 00:45:03 +07:00
terrafrost
dba98cd57f
Merge branch 'master' of https://github.com/phpseclib/phpseclib
2013-02-05 07:55:06 -06:00
terrafrost
5910f7c14f
Update date format in File/X509.php
...
Update it to be consistent with bdd42c448b
Thanks runaway518!
2013-02-05 07:53:36 -06:00
Hans-Jürgen Petrich
323396df3c
Small CS fix
2013-02-03 23:19:09 +07:00
Hans-Jürgen Petrich
b4bbb27ef6
AES: Performance update
...
Performance update for AES
2013-01-31 00:59:53 +07:00
terrafrost
13eb688c90
AES, RC4: CS adjustments
2013-01-30 08:39:02 -06:00
terrafrost
248e3bb085
Undo last commit
2013-01-30 08:37:50 -06:00
terrafrost
bfb04dcf4d
Add __construct() constructor to make namespace'ing easier for those wishing to do it
2013-01-29 22:09:31 -06:00
terrafrost
6765cb3b2b
Rijndael, AES: CS adjustments
2013-01-27 01:21:28 -06:00
terrafrost
7894fd98f5
Merge pull request #65 from petrich/patch-3
...
Rijndael: Performance update
2013-01-26 16:29:26 -08:00
terrafrost
01be859b44
Merge pull request #66 from petrich/patch-5
...
AES: Performance update
2013-01-26 16:29:10 -08:00
terrafrost
d774476bcf
RC4: keys were never being set in continuous mode
2013-01-26 11:16:42 -06:00
Hans-Jürgen Petrich
7dceef6ef4
AES: Performance update
...
Performance update for AES
Related to: https://github.com/phpseclib/phpseclib/pull/65
2013-01-26 16:58:31 +07:00
Hans-Jürgen Petrich
c95b997fa7
Rijndael: Performance update
...
Performance update for Rijndael
2013-01-26 16:54:19 +07:00
terrafrost
e7336e6b54
add size checking to binary packets in Net/SSH2.php (thanks ?????? ????????!)
2013-01-26 00:17:23 -06:00
terrafrost
111544428e
Merge pull request #63 from petrich/patch-3
...
Rijndael: little code optimizing
2013-01-25 21:52:40 -08:00
Hans-Jürgen Petrich
376b2759c9
RC4: fixed ContinuousBuffer() using MODE_MCRYPT
...
Fixed multiple calls to ContinuousBuffer() using MODE_MCRYPT
2013-01-21 21:01:37 +07:00
Hans-Jürgen Petrich
d81563d6f3
Rijndael: little code optimizing
...
little code optimizing
2013-01-21 15:46:44 +07:00
terrafrost
45976002c7
Merge pull request #61 from petrich/patch-3
...
AES: Fixed CFB decrypt() using MODE_MCRYPT and ContinuousBuffer
2013-01-20 22:57:43 -08:00
Hans-Jürgen Petrich
bfab4c47f9
DES: Fixed CFB decrypt() using MODE_MCRYPT and ContinuousBuffer
...
DES: Fixed small bug from commit d94f1b252d
(DES.php in line 739-740)
in CFB decrypt() using CRYPT_DES_MODE_MCRYPT and enableContinuousBuffer()
2013-01-21 10:15:13 +07:00
Hans-Jürgen Petrich
2deea8b491
AES: Fixed CFB decrypt() using MODE_MCRYPT and ContinuousBuffer
...
AES: Fixed small bug from commit d94f1b252d
(AES.php in line 425-426)
in CFB decrypt() using CRYPT_AES_MODE_MCRYPT and enableContinuousBuffer()
2013-01-21 10:08:49 +07:00
terrafrost
882e019062
Merge pull request #59 from tamagokun/set_exit_status
...
Get the exit status in ssh
2013-01-20 09:09:45 -08:00
terrafrost
d94f1b252d
AES, DES, RC4, Rijndael, TripleDES: multiple changes
...
- apply petrich's TripleDES / CFB decrypt to AES and DES
- make DES use the updated _generate_xor
- correct a comment typo
2013-01-20 10:11:19 -06:00
Mike Kruk
efdec7b118
Extract the exit_status if given to us from SSH.
2013-01-17 13:47:42 -05:00
Hans-Jürgen Petrich
f7dc23a18e
3DES: Fixed ContinuousBuffer() in CTR/CFB/OFB
...
FIXED: multiple calls to enable/enableContinuousBuffer() work's now in CTR/CFB/OFB
FIXED: "Illegal string offset" and strlen(array()) Warning/Notice
Performance improvement in CFB Mode with enableContinuousBuffer() using MODE_MCRYPT
2013-01-14 21:23:20 +07:00
terrafrost
efe8cc45e5
Merge branch 'petrich'
2013-01-14 01:17:06 -06:00
terrafrost
5d49af105f
SSH2: $this->channel_buffers is an array - not a string
2013-01-13 11:36:57 -06:00
terrafrost
94ca5e1d0c
SSH1,SSH2: strpos expects string - not array
2013-01-13 10:49:03 -06:00
Hans-Jürgen Petrich
c624c785ee
DES: Fixed CFB/OFB and continuousBuffer
...
FIXED: multiple calls to enable/disableCMode() will work now
FIXED: CFB/OFB modes
FIXED: "Illegal string offset" and strlen(array()) Warning/Notice
2013-01-13 01:48:48 +07:00
terrafrost
bccce5802c
SSH2: Use strlen instead of empty
2013-01-12 10:46:19 -06:00
terrafrost
b8768c8d11
SSH1: Make it so SSH packets spanning multiple TCP/IP packets can be rcvd
2013-01-12 10:45:35 -06:00
terrafrost
bbed0916cd
SSH2: Make $stop be after all network activity
2013-01-11 18:38:38 -06:00
terrafrost
ab7f65d436
SSH1: Added setTimeout()
...
Note that interactiveRead() was left untouched.
2013-01-11 18:36:58 -06:00
terrafrost
76a24dc546
AES: $pos will always be 0 in the last if statement for CFB
2013-01-11 18:09:28 -06:00
terrafrost
7c0926d94a
Merge remote-tracking branch 'origin/petrich'
...
Conflicts:
phpseclib/Crypt/AES.php
2013-01-11 18:06:43 -06:00
terrafrost
74e61deb4f
AES: CFB: decrypted strings were being truncated
2013-01-11 15:30:06 -06:00
terrafrost
d90caa17e3
SSH1: CS adjustments
2013-01-11 00:31:49 -06:00
terrafrost
4a1cbfa7fd
Merge remote-tracking branch 'petrich/patch-3' into petrich
...
Conflicts:
phpseclib/Crypt/AES.php
2013-01-10 23:49:59 -06:00
terrafrost
bbd62f6490
AES: CFB mode fix
2013-01-10 20:42:38 -06:00
terrafrost
5ce9ad6a42
Random: $urandom -> $fp
2013-01-10 13:19:31 -06:00
Hans-Jürgen Petrich
20461866ef
AES: Fix broken CFB and disableContinuousBuffer()
...
Related to: https://github.com/phpseclib/phpseclib/pull/45
2013-01-10 23:27:12 +07:00
terrafrost
46baf1815f
SSH1: Fix E_NOTICE
2013-01-10 00:42:53 -06:00
terrafrost
c3ee632587
SSH1: fix "Expected SSH_SMSG_SUCCESS" error
2013-01-09 23:56:33 -06:00
terrafrost
b1c96faf90
SSH1: Packets shown in log were encrypted
2013-01-09 22:54:11 -06:00
terrafrost
d741def23c
AES: Fix broken CFB and disableContinuousBuffer()
...
Quoting from petrich's pull request (from which this commit was inspired):
Fixed: Broken CFB in continuous mode when using CRYPT_AES_MODE_MCRYPT (related to: #39 )
Fixed: Multiple calls to enable/disableContinuousBuffer()
Fixed: Some PHP Notice/Warnings about strlen(array())
2013-01-09 17:39:57 -06:00
terrafrost
2ead31dac2
rm debug code
2013-01-09 00:07:54 -06:00
terrafrost
e71fc97913
Revamp SSH1 logging and go back to using user_error
...
(_handle_error returned the line number in _handle_error - not the line number triggering the error)
2013-01-08 22:09:27 -06:00
terrafrost
10d9671601
SSH1: Fix E_NOTICE (thanks nosx!)
2013-01-08 11:15:28 -06:00
terrafrost
a890c6d127
Merge remote-tracking branch 'origin/petrich'
2013-01-06 19:14:05 -06:00
terrafrost
5e882d57fe
Merge remote-tracking branch 'origin/petrich'
2013-01-06 19:10:25 -06:00
terrafrost
edc6d9cf5b
AES.php in mcrypt mode always treated CFB as though it was a continuous cipher
2013-01-06 19:09:43 -06:00
terrafrost
fc2bf41588
Fix E_NOTICEs in the rewritten CFB mode
2013-01-06 19:08:36 -06:00
terrafrost
1626c0a3c7
CS adjustments to petrich's code and optimizations
2013-01-05 17:55:30 -06:00
terrafrost
fba455dfb2
Merge remote-tracking branch 'petrich/patch-2' into petrich
...
Conflicts:
phpseclib/Crypt/Rijndael.php
2013-01-05 17:54:22 -06:00
Hans-Jürgen Petrich
d1f71cc5a7
Fixed CFB Decrypt(). Fixed OFB warnings
...
Fixed/rewritten: Decrypt() in CFB mode to work clean with enableContinuousBuffer()
Fixed: PHP's strlen(array()) warning in OFB mode,
Fixed: disableContinuousBuffer() clear's now also the $enbuffer/$debuffer arrays so that multiple calls to enable/disableContinuousBuffer() will work without old buffers
2013-01-05 16:23:35 +07:00
terrafrost
c1244dd339
CFB didn't always work in continuous mode
2013-01-04 20:53:23 -06:00
Hans-Jürgen Petrich
359e38b4d4
fixed corrupted decrypt() in CTR mode
...
$buffer['encrypted'] (which is always empty) should be $buffer['ciphertext'] or buffered stream will get corrupt...
Example:
define('CRYPT_AES_MODE',CRYPT_AES_MODE_INTERNAL);//in MODE_MCRYPT all is fine
$aes = new Crypt_AES(CRYPT_AES_MODE_CTR);
$aes->setKey(':-8');
$aes->enableContinuousBuffer();
$plaintext = ':-):-):-):-):-):-)';
for($i=0; $i<strlen($plaintext); $i++) {
echo $aes->Decrypt($aes->Encrypt($plaintext[$i]));
}
Output:
:-):-):-):-):-):-(
Expected:
:-):-):-):-):-):-)
After Bugfix, output is:
:-):-):-):-):-):-)
2013-01-04 14:23:34 +07:00
terrafrost
61ad80fd64
More strlen() / empty() changes
2013-01-03 00:26:27 -06:00
terrafrost
9b4240c104
Use !empty('0') instead of strlen('0')
...
Thanks petrich!
2013-01-03 00:21:09 -06:00
terrafrost
aa3da09747
Add limited SPKAC support
2012-12-19 00:21:55 -06:00
terrafrost
e4ccaef7bf
Make PEM lines be 64 bytes long instead of 72
...
Also, add more notes to Crypt_Random's comments
2012-12-18 07:11:24 -06:00
terrafrost
7f5e9f404a
Random: expand on the explanations as to how things work
2012-12-17 08:41:47 -06:00
terrafrost
885d7e0f24
SFTP: Make get() work correctly when files are being written to for partial transfers
2012-12-16 02:34:49 -06:00
terrafrost
35832fe2a1
Refactor crypt_random (renaming it to crypt_random_string)
...
...and update all the calls to it accordingly
2012-12-16 02:20:16 -06:00
terrafrost
a731220785
Fix E_NOTICE in SFTP.php (thanks dlgoodchild!)
2012-12-14 08:45:35 -06:00
terrafrost
65193d9a25
SFTP: Add $offset and $length get() function
2012-12-11 19:54:48 -06:00
terrafrost
7401d148f8
Remove unused lines
...
The MATH_BIGINTEGER_MODE == MATH_BIGINTEGER_MODE_GMP case is already handled earlier
2012-12-11 18:38:45 -06:00
Patrick Monnerat
18fc6b7712
X509: Fix typo: ';' --> ':'
2012-12-10 12:27:07 +01:00
Patrick Monnerat
06779a92de
Merge branch 'master' of https://github.com/phpseclib/phpseclib into pmexts
2012-12-10 12:10:06 +01:00
Patrick Monnerat
f039a6ebc2
RSA: Allow changing openssl configuration file. X509: process HoldInstructionCode.
...
Also fixes HoldInstruction* OIDs.
2012-12-10 12:07:49 +01:00
terrafrost
27f6012d62
Make it so extension OIDs can be File_ASN1_Elements
2012-12-01 10:52:10 -06:00
terrafrost
d130d2274d
Make the save*() functions save in multiple formats
...
Currently only PEM and DER supported.
Also make fuzzing enhancements
2012-11-30 08:31:16 -06:00
terrafrost
3c6ae4312f
The user_error in _handle_error shouldn't be replaced..
2012-11-29 00:19:09 -06:00
terrafrost
3caaa91160
Replace user_error() with new _handle_error() function
...
To use exceptions do define('PHPSECLIB_USE_EXCEPTIONS', true).
To have the exceptions thrown by phpseclib be of a certain class define PHPSECLIB_EXCEPTION_CLASS.
2012-11-28 23:33:15 -06:00
terrafrost
862253784d
Merge branch 'master' of https://github.com/phpseclib/phpseclib
2012-11-28 08:24:00 -06:00
terrafrost
1f6cc77c11
Merge remote-tracking branch 'origin/noauth'
2012-11-28 08:21:36 -06:00
terrafrost
dbc10491e7
Fix an E_NOTICE (thanks chubbypama!)
2012-11-28 08:17:57 -06:00
terrafrost
ff94576315
Remove unused fields from pack()
2012-11-27 14:38:30 -06:00
terrafrost
8ea452ed31
type in comment
...
(testing out github.com's edit via web interface)
2012-11-27 10:11:49 -06:00
terrafrost
0b9f743343
Add getChain() function
...
Also improve loading of raw certs
2012-11-25 23:06:58 -06:00
terrafrost
76cb693d62
CS adjustments, make it so PEM-encoded CRLs can be read (again) and make it so already decoded CSRs and CRLs can be read
2012-11-23 19:04:04 -06:00
terrafrost
346bc5dcc8
Make it so none is a supported authentication method
2012-11-22 14:25:57 -06:00
terrafrost
875cef8bbd
Revamp logging
2012-11-22 13:08:30 -06:00
terrafrost
6c33012a4a
Suppress further error messages if connection is prematurely disconnected
2012-11-22 12:11:15 -06:00
terrafrost
fbf3ba353e
Null pad RSA ciphertext's to be the length of the modulo and improve XML parsing
2012-11-19 23:00:04 -06:00
terrafrost
7e120a0f30
Make validateSignature() behave more intuitively
2012-11-19 21:10:22 -06:00
terrafrost
126c396a51
More CS adjustments
2012-11-18 16:29:15 -06:00
terrafrost
406e7e90e9
CS adjustments
2012-11-18 16:16:11 -06:00
terrafrost
2a1909fd71
Set $this->paddable to true in a few missing places
2012-11-16 02:59:06 -06:00
Patrick Monnerat
8f6cd4f91f
Merge branch 'master' of https://github.com/phpseclib/phpseclib into pmexts
2012-11-14 16:35:00 +01:00
Patrick Monnerat
a61d7ba29b
X509: *Attribute() functions may now handle single values.
2012-11-14 16:33:32 +01:00
terrafrost
8cf6bb0b1c
SSH1: Fix E_NOTICE (thanks dayton967!)
2012-11-14 04:34:33 -06:00
terrafrost
691f4d1e62
Make it so loadCA() doesn't have to be called before loadX509() or loadCRL()
2012-11-13 00:43:45 -06:00
terrafrost
d492d19748
X509: Missing $
2012-11-13 00:37:54 -06:00
terrafrost
1fd87dcd35
Fix bug in listRevoked() and make it so getSubjectDN() doesn't return issuer DN for CRLs
2012-11-13 00:33:15 -06:00
terrafrost
1abc7e742b
X509: CSRs and CRLs didn't have the signatureSubject variable saved properly
2012-11-12 23:51:41 -06:00
terrafrost
661eb8db3f
Missing ;
2012-11-12 01:05:24 -06:00
terrafrost
0e0eebf456
CS adjustments, make loadXXX() take in binary data, and make getDN() == getIssuerDN() for CRLs
2012-11-12 00:46:03 -06:00
terrafrost
1ff798da47
Merge branch 'master' of https://github.com/phpseclib/phpseclib
2012-11-09 22:24:23 -06:00
terrafrost
6bc46d42e0
Only save the directory if it was able to be successfully created
2012-11-09 22:22:02 -06:00
Patrick Monnerat
ac8d0172eb
Merge branch 'master' of https://github.com/phpseclib/phpseclib into pmexts
2012-11-08 12:51:07 +01:00
Patrick Monnerat
7fbf089e32
X509: Do not use memory-wasting create_function()
2012-11-08 12:45:17 +01:00
Patrick Monnerat
4ad2ffe9d7
Merge branch 'master' of https://github.com/phpseclib/phpseclib into pmexts
2012-11-08 12:23:03 +01:00
terrafrost
9ead66143d
Updates to mkdir() (thanks easy-dev!)
2012-11-07 23:35:23 -06:00
Patrick Monnerat
dde23464a1
X509: Fix typo.
2012-11-07 16:29:18 +01:00
Patrick Monnerat
5ef4f9900a
X509: Suppress {get|set|remove}CRLExtension() functions: non *CRL* functions are now polymorphic.
2012-11-07 16:23:01 +01:00
Patrick Monnerat
d980a91360
X509: Fix DirectoryString syntax
2012-11-07 16:21:23 +01:00
Patrick Monnerat
9860f020c3
X509: Fix typo.
2012-11-07 15:41:41 +01:00
Patrick Monnerat
9b2a6d68f4
X509: Add CSR attributes handling support and CSR extension requests.
2012-11-07 15:35:10 +01:00
Patrick Monnerat
d9ab2d7f10
ASN1: Improve input SEQUENCE and SET mapping, better syntax error detection.
2012-11-07 15:23:54 +01:00
Patrick Monnerat
bf2107eaa8
X509: Suppress {get|set|remove}CRLExtension() functions: non *CRL* functions are now polymorphic.
2012-11-07 15:18:55 +01:00
Patrick Monnerat
1a0ae1ff76
X509: Fix DirectoryString syntax.
2012-11-07 15:03:58 +01:00
Patrick Monnerat
0afed5b65b
X509: adjust comments
2012-11-05 12:08:20 +01:00
Patrick Monnerat
916dcff8a8
ASN1/X509: implement limited string conversion. Add getDN() options.
...
Warning: converted strings must not be used for matching DNs.
2012-11-02 16:53:32 +01:00
Patrick Monnerat
26b842be5b
X509: compute public key identifiers.
...
Force subject public key identifier when signing a CA.
2012-10-29 18:21:25 +01:00
Patrick Monnerat
64c3b309bd
ASN1: little optimization for better performance.
2012-10-25 17:54:02 +02:00
Patrick Monnerat
c1c9c38fe6
X509: Avoid an "undefined" error and define netscape-ca-policy-url OID.
2012-10-24 13:36:18 +02:00
Patrick Monnerat
2d34c291f0
ASN1: _decode_ber should now accept a FILE_ASN1_Element object as source.
2012-10-24 11:42:13 +02:00
Patrick Monnerat
340ee0cd2d
ASN1/X509: latch effective type of ANY fields as an additional indexing level.
2012-10-23 13:37:51 +02:00
terrafrost
9e803fe374
Return $this->publicKey if it's available in getPublicKey() function
2012-10-22 00:27:26 -05:00
terrafrost
bdd42c448b
Change default date format
...
This change stems from the fact that date('T') on PHP 4 (and possibly 5.0/5.1/etc) returns "Central Daylight Time" vs PHP 5, which returns "CDT". "CDT" is parsable by strtotime - "Central Daylight Time" is not.
There will still be some dates that won't properly decode, however, on PHP 4. Those dates would seem to be due to this (from php.net):
"On systems where time_t is a 32bit signed integer, as most common today, the valid range for year is somewhere between 1901 and 2038. However, before PHP 5.1.0 this range was limited from 1970 to 2038 on some systems (e.g. Windows)."
2012-10-19 07:19:22 -05:00
Patrick Monnerat
4c5163234b
ASN1: Fix default value optimization upon encoding.
...
Also encode SETs as SEQUENCEs since order is not important.
2012-10-18 12:38:43 +02:00
terrafrost
ce250ea546
Rename $keyIdentifier to $currentKeyIdentifier
...
$KeyIdentifier (upper case) is already defined and although it doesn't cause any problems with $keyIdentifier (lower case) I still think it's poor practice
2012-10-18 00:37:48 -05:00
terrafrost
8758ca8517
Merge pull request #24 from monnerat/crl
...
Certificate Revocation Lists
2012-10-16 04:34:34 -07:00
terrafrost
eba3fbe13e
Suppress Warning messages
...
Warning messages would appear if recursive deletes or chmods were
attempted. Also, doing pwd() when . was / would return //.
2012-10-13 19:42:01 -05:00
Patrick Monnerat
2c7c7b9679
X509, ASN1: Fix CS and indent. Remove tabs.
2012-10-12 16:17:34 +02:00
monnerat
ef96f777c3
X509: setSerialNumber(): new optional parameter $base
2012-10-12 03:29:25 +01:00
monnerat
711d44f0e5
X509: implement CRLs.
2012-10-12 03:13:39 +01:00
monnerat
6da490d00a
X509: new setExtension() method.
2012-10-12 03:03:21 +01:00
monnerat
bc7a59bc8c
X509: factorize some code in prevision of CRL support.
2012-10-12 02:56:23 +01:00
monnerat
73b0d05ddc
X509: set-up key identifier upon certificate loading.
2012-10-12 02:42:19 +01:00
monnerat
4f634aaca8
X509: avoid some "undefined" errors.
2012-10-12 02:37:55 +01:00
monnerat
2c8ad5ee72
ASN1: _encode_der(): do not encode optional fields with value set to default.
2012-10-12 01:07:01 +01:00
monnerat
a75de60478
ASN1: asn1map(): fix handling of optional CHOICE and ANY children in SEQUENCE.
2012-10-12 01:04:24 +01:00
monnerat
b05cff1320
ASN1: process input NULL fields.
2012-10-12 01:01:20 +01:00
monnerat
50962f9cd3
ASN1: asn1map(): do not rely on input fields to determine mapping parameters.
2012-10-12 00:58:36 +01:00
monnerat
d9a3dafa0a
ASN1: Support enumerated types by processing them as integers.
2012-10-12 00:51:42 +01:00
terrafrost
35d6910bf3
Revisions to _logError() function
2012-10-09 07:27:42 -05:00
terrafrost
827090c562
Update comments
2012-10-09 01:00:47 -05:00
terrafrost
c65f5ba0e5
Add SFTPv2 support
...
Thanks bitvise for providing an SFTP client that does SFTPv2 and to faceleg for bringing the issue to my attention!
2012-10-09 00:56:50 -05:00
terrafrost
7ba006ccdc
Add getSize() function to Crypt_RSA
2012-10-07 18:53:26 -05:00
terrafrost
7d1e714a08
Remove extra white space
2012-10-07 09:48:58 -05:00
terrafrost
32857c5e7f
CS adjustment
2012-10-06 10:50:19 -05:00
terrafrost
ec067c1f14
Merge pull request #23 from monnerat/newattrs
...
X509: handle multiple-valued attributes in setDNProp(). Fix setDN().
2012-10-06 08:16:15 -07:00
Patrick Monnerat
f4b03722fd
X509: handle multiple-valued attributes in setDNProp(). Fix setDN().
2012-10-01 12:35:43 +02:00
terrafrost
7cfcdf90f6
Merge branch 'master' of https://github.com/phpseclib/phpseclib
2012-09-30 21:37:25 -05:00
terrafrost
bb4995e446
Add $extra to logs
2012-09-30 21:32:26 -05:00
terrafrost
f8b05fb6ad
Merge pull request #22 from monnerat/newattrs
...
X509: Fix 'OU' attribute mapping, add 'SN' (surname) short name, add 'ro...
2012-09-29 17:46:08 -07:00
terrafrost
ee25c73a44
Three fixes
...
- Ingore white space in keys
- Handle negative numbers in the same way OpenSSL seems to handle them
- Fix signature verification (thanks Richard Odekerken!)
2012-09-29 14:32:27 -05:00
Patrick Monnerat
45512c7a50
X509: Fix emailAddress attribute name mapping.
2012-09-27 16:50:58 +02:00
Patrick Monnerat
1377d56a4e
X509: fix typo: improve new DN attrs handling.
2012-09-27 15:15:12 +02:00
Patrick Monnerat
29b9642965
X509: Fix 'OU' attribute mapping, add 'SN' (surname) short name, add 'role', 'title', 'description', 'x500UniqueIdentifier' DN attributes.
2012-09-27 14:38:37 +02:00
terrafrost
076050cc19
Ignore white spaces in CSRs and X.509 certs
2012-09-26 00:34:37 -05:00
terrafrost
13eed6147a
Do CRYPT_DES_MODE_CBC instead of CRYPT_MODE_DES_CBC
2012-09-22 11:38:09 -05:00
terrafrost
6686e203e7
Reformat keys even if private key format is the same OpenSSL uses
...
As is private keys weren't being encrypted when a private key was being set and OpenSSL was being used.
Thanks TeigneuX!
2012-09-18 05:17:14 -05:00
terrafrost
ec5aead746
SSH-2.0-SSHD doesn't implement hmac-*-96 correctly
2012-09-17 02:33:03 -05:00
terrafrost
c7d6492f43
stat() and lstat() ignore false output from _stat()
...
Thanks Fluffycloud!
2012-09-16 18:50:16 -05:00
terrafrost
31ad9aacbd
stream_set_blocking calls were unnecessary
2012-09-09 23:45:18 -05:00
terrafrost
5d91746f73
stream_select() failed when timeout went below 1 second
2012-09-03 14:48:18 -05:00
terrafrost
26776b486e
Update a few comments
2012-09-03 01:42:50 -05:00
terrafrost
a3781bd172
Changing the public key format broke File_X509
2012-09-03 01:32:57 -05:00
terrafrost
c2c3e9420d
Negative numbers should be prepended with a 0
2012-09-02 11:06:53 -05:00
terrafrost
0f95ddc692
Updated fix for php.pear.net bug # 18015
...
toBits() on an object for which setPrecision(8) has been called should always return 8 bits.
As such we'll just iterate backwards instead of forward.
2012-09-02 01:13:21 -05:00
terrafrost
5de5d45bd5
Workaround for buggy stream_select's
...
Workaround for this issue:
https://bugs.php.net/bug.php?id=42682
Thanks solefald!
2012-08-29 17:55:22 -05:00
terrafrost
e2ae5100c2
Fix a few E_NOTICEs
2012-08-28 03:04:15 -05:00
terrafrost
11872fe747
CRYPT_RSA_ASN1_SEQUENCE shouldn't have been used
2012-08-26 02:01:26 -05:00
terrafrost
770075fe08
Don't redefine MATH_BIGINTEGER_OPENSSL_ENABLED
2012-08-26 01:52:58 -05:00
terrafrost
2f8d1055ea
Use OpenSSL for Math_BigInteger::modPow speedups
...
Also, make Crypt_RSA's public keys compatible with OpenSSL and make it so __toString will return the key even when it's the public key that's loaded and it hasn't been set as the public key.
2012-08-26 01:36:34 -05:00
terrafrost
6c4fcd34d3
Misc fixes
...
- make it so '' is a legit password and doesn't unset the pw to pass bantu's unit tests (unit test could have been updated too but whatever)
- make it so not passing in any parameters to Crypt_RSA::setPassword() works without E_NOTICE or E_WARNING as per example in docs
- add missing phpdoc headers to File_ANSI
- cryan -> cyan in File_ANSI
2012-08-23 08:59:49 -05:00
Joshua Johnson
1f90170049
Fix typos
2012-08-14 13:12:01 -04:00
terrafrost
c2850cd36a
- certs couldn't be signed since setDNProp didn't work as it should
2012-08-06 23:00:34 -05:00
terrafrost
8d34cb11e9
- validateDate didn't work
2012-08-05 10:55:47 -05:00
terrafrost
30391fe2b6
- add getSubjectDN and getSubjectDNProp as aliases
2012-08-02 16:04:11 -05:00
terrafrost
de2691a281
- add autoloading support to ASN1.php
2012-08-01 23:57:11 -05:00
terrafrost
6e1b79ba24
- add __toString magic method to Crypt_RSA
2012-07-26 13:14:18 -05:00
terrafrost
8f2994349c
- fix getDNProp(), add getIssuerDNProp()
2012-07-24 08:15:54 -05:00
terrafrost
879a5c4364
- add enableQuietMode to suppress stderr
2012-07-23 07:17:53 -05:00
terrafrost
4eaf6db3ab
- fix for PEAR bug # 19494
2012-07-07 17:24:45 -05:00
terrafrost
f292931aed
- make Net_SSH2 return more printer friendly server public host keys
2012-07-04 13:36:26 -05:00
terrafrost
1417463eba
- make Crypt_RSA use openssl for key generation (if openssl is available) and make it so File_X509 can create CSRs
2012-07-01 12:07:42 -05:00
terrafrost
f0e1b2deec
- add second function_exists call to prevent require_once from being called if autoloader was called
2012-06-27 20:56:36 -05:00
terrafrost
6cd2d154b4
Merge remote-tracking branch 'terrafrost/moizhb'
2012-06-25 11:20:02 -05:00
terrafrost
5eacf2b05d
- do class_exists(Crypt_Random) too to facilitate auto-loading
2012-06-24 16:53:16 -05:00
terrafrost
9e69344d60
- better timeout handling (thanks moizhb)
2012-06-23 17:16:42 -05:00
terrafrost
6ee991f604
Merge branch 'master' of https://github.com/phpseclib/phpseclib
2012-06-20 10:43:20 -05:00
terrafrost
1e3778dc4f
- auto loading fixes (thanks skydiablo)
2012-06-20 10:36:36 -05:00
terrafrost
dfe264594f
Merge pull request #9 from bantu/feature/consistent-file-endings
...
[feature/consistent-file-endings] Remove ?> and make sure there is an empty line at the end of files.
2012-06-16 21:06:15 -07:00
terrafrost
ccd2b6ae78
- PBKDF2 updates
2012-06-16 16:42:54 -05:00
Andreas Fischer
eb64dfef7d
[feature/consistent-file-endings] Make sure files have empty line at the end.
2012-06-11 10:34:07 +02:00
Andreas Fischer
5923f4ad68
[feature/consistent-file-endings] Remove remaining ?> from PHP files.
2012-06-11 10:33:39 +02:00
terrafrost
9d0b172103
- exit-status's sent before channel data no longer produce empty output
2012-06-10 21:52:30 -05:00
terrafrost
2306b73677
- remove PHP_Compat stuff; install PHP_Compat from PEAR if you want PHP4 support
2012-06-10 21:40:31 -05:00
terrafrost
5999f93ce3
- attempt to make it so File/ANSI.php doesn't always show up with git status
2012-06-09 14:29:03 -05:00
Rob Loach
8d8b5e09dd
Fix for syntax error found by @bantu #r954245
2012-06-08 18:48:23 -04:00
Rob Loach
7e9a975296
Add Composer support to phpseclib
2012-06-08 15:38:27 -04:00
terrafrost
0b7673eb56
Merge remote-tracking branch 'bantu/topic/40730'
2012-06-06 08:10:54 -05:00
Andreas Fischer
3e450fa978
[topic/36062] Change unconditional includes to require_once in ASN1 and X509.
2012-06-06 13:14:06 +02:00
Andreas Fischer
71dea1fc2b
[topic/40730] Use strlen() instead of count() in function _equals() of Crypt_RSA.
...
It appears that count() always returns int(1) on strings. Thus, this check is
pointless as is. strlen() was meant here and is actually required to prevent
E_NOTICEs from invalid array accesses using $y[$i].
2012-06-06 13:12:48 +02:00
terrafrost
e484373a2b
- updates to _remove directory (thanks, bantu)
2012-06-05 23:44:40 -05:00
Jim Wigginton
e5ee7809c4
- add partial VT100 terminal emulator to decode ANSI escape codes from Net_SSH2::read()
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@223 21d32557-59b3-4da0-833f-c5933fad653e
2012-05-27 22:20:42 +00:00
Jim Wigginton
7f1c861c1a
- $this->mcrypt was removed in a commit from yesterday
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@222 21d32557-59b3-4da0-833f-c5933fad653e
2012-05-14 18:20:11 +00:00
Jim Wigginton
3141c0f803
- if the SFTP connection was closed prematurely put() could hang (thanks, KCC!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@221 21d32557-59b3-4da0-833f-c5933fad653e
2012-05-14 01:43:49 +00:00
Jim Wigginton
b39d2597dd
- if the algorithm is not supported upon mcrypt's initial initialization use the internal implementation
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@220 21d32557-59b3-4da0-833f-c5933fad653e
2012-05-14 01:21:21 +00:00
Jim Wigginton
5a4595ab56
- when the child is an optional CHOICE it needs to be explicit and not implicit
...
- make asn1map more accurate
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@219 21d32557-59b3-4da0-833f-c5933fad653e
2012-05-13 17:52:12 +00:00
Jim Wigginton
5db0f88218
- add blinded rsa equality test (thanks singpolyma!)
...
- make validateSignature behave more like openssl_verify()
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@218 21d32557-59b3-4da0-833f-c5933fad653e
2012-05-05 23:57:30 +00:00
Jim Wigginton
7ef3108d00
- add two new logging modes
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@217 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-30 16:25:37 +00:00
Jim Wigginton
9a7d6cdb54
- add !is_resource() check
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@216 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-24 05:01:55 +00:00
Jim Wigginton
da8614a511
- add getIssuerDN()
...
- fill in getPublicKey() stub
- add 'lifetime' option to setEndDate()
- fix a bug that'd prevent certs with File_ASN1_Element being saved
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@215 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-23 03:57:34 +00:00
Jim Wigginton
a90bba115c
- make it so certs can be setup as CA's
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@214 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-22 17:11:29 +00:00
Jim Wigginton
3dd9e2b318
- id-at-organizationalUnitName was misnamed as id-at-dnQualifier
...
- make it so CA's can't be loaded if the keyusage extension doesn't permit their being loaded
- implement validateURL() function stub
- add support for a few more DN attributes
- add removeDNProp(), getDNProp() and setDomain()
- fixed some issues preventing new certs from being signed
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@213 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-22 06:00:55 +00:00
Jim Wigginton
392ff50c00
- sign() didn't save subjectPublicKeyInfo correctly
...
- sign() could erase the subject's DN from an existing X.509 cert
- setSerialNumber didn't save the serial number correctly
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@212 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-17 06:47:39 +00:00
Jim Wigginton
6d60fa63e5
- make it so the following all do the same thing:
...
$pubKey = new Crypt_RSA();
$pubKey->loadKey($privKey->getPublicKey());
$pubKey->setPublicKey();
$pubKey = new Crypt_RSA();
$pubKey->loadKey($privKey->getPublicKey());
$pubKey->setPublicKey($privKey->getPublicKey());
$pubKey = new Crypt_RSA();
$pubKey->setPublicKey($privKey->getPublicKey());
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@211 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-17 06:21:42 +00:00
Jim Wigginton
960dd01fe1
- add full support for the id-ce-authorityKeyIdentifier and id-ce-subjectKeyIdentifier extensions via setKeyIdentifier() function
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@210 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-16 04:35:37 +00:00
Jim Wigginton
3f9aa1ad6a
- make it so an array returned by loadX509() can be reloaded by loadX509()
...
- validateDate() didn't work
- add postalCode and streetAddress as supported DN attributes
- add getDN()
- split setKey() out into setPrivateKey() and setPublicKey()
- add sign(), setStartDate(), setEndDate(), setSerialNumber(), removeExtension(), getExtension() and getExtensions()
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@209 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-15 17:17:16 +00:00
Jim Wigginton
09f4bef2f1
- add loadCSR(), setKey(), setDN() and setDNProp()
...
- refactor some code
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@208 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-09 03:13:53 +00:00
Jim Wigginton
42e5ad80f7
- BMPString's should be decoded via decodeBER(), use UTF8 strings for everything but policy qualifiers and make policy qualifiers optional
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@207 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-25 00:24:03 +00:00
Jim Wigginton
5cc327e0c3
- fix a bunch of E_NOTICEs, add support for the id-ce-certificatePolicies extension, add limited validation
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@206 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-20 05:25:43 +00:00
Jim Wigginton
81beb6e2e2
- fix E_NOTICES
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@205 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-12 03:23:04 +00:00
Jim Wigginton
60340d5466
- make it so setPublicKey() can guess at the format like loadKey() can
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@204 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-11 19:13:34 +00:00
Jim Wigginton
1b2dde6e7d
- encode the subjectPublicKey in a format Crypt_RSA can use (assuming the algorithm is rsaEncryption)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@203 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-11 19:00:28 +00:00
Jim Wigginton
1b161ece26
- add support for id-ce-nameConstraints
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@202 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-11 08:41:06 +00:00
Jim Wigginton
441ada0502
- add an X.509 encoder / decoder
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@201 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-11 07:54:41 +00:00
Jim Wigginton
228fb3ceb9
- - close the channel when a NET_SSH2_CHANNEL_REQUEST exit-status is received (thanks, ferus!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@200 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-07 18:57:45 +00:00
Jim Wigginton
40bc51da99
- fix some E_NOTICES (thanks, ferus!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@199 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-05 15:32:15 +00:00
Jim Wigginton
6309f5a70a
- read() doesn't give an E_WARNING when $expect is blank
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@198 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-05 03:13:09 +00:00
Jim Wigginton
329d3e2a15
- send a NET_SSH2_MSG_CHANNEL_CLOSE packet in addition to a NET_SSH2_MSG_CHANNEL_EOF packet when force closing the channel (thanks, ferus!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@197 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-05 02:06:13 +00:00
Jim Wigginton
6d3e3dd12e
- setTimeout() updates
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@196 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-03 19:56:22 +00:00
Jim Wigginton
1ab30836a6
- make it so requests can timeout (thanks pmprojx!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@195 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-03 17:49:16 +00:00
Jim Wigginton
8ad76c9236
- get() no longer needs to know the size of a file to download it (thanks xyzzy!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@194 21d32557-59b3-4da0-833f-c5933fad653e
2012-01-20 06:36:16 +00:00
Jim Wigginton
883b13f540
- fclose() was being called twice (thanks zyzzy!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@193 21d32557-59b3-4da0-833f-c5933fad653e
2012-01-20 05:39:10 +00:00
Jim Wigginton
8e0845f411
- make it so size() doesn't give an E_NOTICE if the size attribute isn't present
...
- make delete() recursive by default
- fix a bug that prevented inbound packets from being logged
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@192 21d32557-59b3-4da0-833f-c5933fad653e
2012-01-20 05:33:19 +00:00
Jim Wigginton
257b18501e
- make setHash non case sensitive (thanks e1ven!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@191 21d32557-59b3-4da0-833f-c5933fad653e
2011-12-14 13:36:31 +00:00
Jim Wigginton
019edc6694
- the key has to be truncated before setKey() is called or else it'll be rounded up to the nearest key size - not down
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@190 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-25 00:11:19 +00:00
Jim Wigginton
f600a9bb50
- !== is faster than !=
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@189 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-24 19:03:56 +00:00
Jim Wigginton
70ea9ceec8
- update link to svn.php.net
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@188 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-24 18:46:12 +00:00
Jim Wigginton
e8d6d8d165
- use openssl_random_pseudo_bytes if available (thanks wise.man!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@187 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-24 18:32:49 +00:00
Jim Wigginton
b1c7fed946
- the IV wasn't resetting when mcrypt was being used
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@186 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-16 06:53:36 +00:00
Jim Wigginton
a00a5e6ba4
- add pbkdf2 support via setPassword()
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@185 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-13 02:23:56 +00:00
Jim Wigginton
bc1c12357d
- CRYPT_RSA_PUBLIC_FORMAT_XML didn't work correctly
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@184 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-07 08:25:59 +00:00
Jim Wigginton
a1f3ee7b69
- fix potential E_NOTICE in modInverse (thanks bantu!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@183 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-07 02:27:01 +00:00
Jim Wigginton
cfcf20cce5
- add the ability to save newly created keys in the XML and PuTTY formats
...
- add the ability to save private keys that have already been loaded
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@182 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-07 01:35:12 +00:00
Jim Wigginton
0531f713ab
- close local file if one is being used and if get() would return prematurely (thanks, Sascha.Pfalz!)
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@181 21d32557-59b3-4da0-833f-c5933fad653e
2011-10-14 05:46:18 +00:00
Jim Wigginton
034ec72ade
- if a binary packet can't be decrypt don't bother to process it further
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@180 21d32557-59b3-4da0-833f-c5933fad653e
2011-10-06 12:12:56 +00:00
Jim Wigginton
58b4b8d681
- make realtime logging better accommodate whitespace
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@179 21d32557-59b3-4da0-833f-c5933fad653e
2011-09-17 18:46:04 +00:00
Jim Wigginton
7e416149c1
- NET_SFTP_APPEND -> NET_SFTP_RESUME
...
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@178 21d32557-59b3-4da0-833f-c5933fad653e
2011-09-10 05:46:19 +00:00