1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-11-27 04:46:26 +01:00
Commit Graph

1134 Commits

Author SHA1 Message Date
terrafrost
8b59e80aa5 Merge remote-tracking branch 'bantu/feature/gitignore' 2012-06-06 08:19:17 -05:00
terrafrost
0b7673eb56 Merge remote-tracking branch 'bantu/topic/40730' 2012-06-06 08:10:54 -05:00
Andreas Fischer
bb8f24edf1 [feature/gitignore] Ignore editor backup files using .gitignore 2012-06-06 13:15:22 +02: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
Andreas Fischer
dadbddb97c [feature/phpunit] Change test class name to reflect the path it is in. 2012-06-06 13:08:11 +02:00
Andreas Fischer
8571aa0bad [feature/phpunit] Use SPL autoloading instead of manual loading. 2012-06-06 13:08:04 +02:00
Andreas Fischer
d71d7f3496 [feature/phpunit] Add configuration file for travis-ci.org 2012-06-06 13:07:55 +02:00
Andreas Fischer
2da655a783 [feature/phpunit] Add some basic tests for the Math_BigInteger class. 2012-06-06 13:07:47 +02:00
Andreas Fischer
d707975426 [feature/phpunit] Add phpunit configuration and bootstrapping. 2012-06-06 13:07:36 +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