- change license to the less restrictive MIT license (if people want to modify phpseclib and distribute binaries of it [whatever that means for PHP] without including the source code I don't care); two of the three PHP_Compat stuff still uses the LGPL since I didn't author them but they're only needed, anyway, if you're using phpseclib on PHP4.

- add svn:eol-style: LF to all files
- fixed pear.php.net bug # 18037 (thanks, nounours!)

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@130 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
Jim Wigginton 2010-11-13 19:28:20 +00:00
parent 19cc43cc16
commit b94a467999
13 changed files with 33 additions and 26 deletions

View File

@ -55,8 +55,8 @@
* @package Crypt_AES * @package Crypt_AES
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVIII Jim Wigginton * @copyright MMVIII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: AES.php,v 1.10 2010-09-26 05:24:52 terrafrost Exp $ * @version $Id: AES.php,v 1.7 2010/02/09 06:10:25 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */

View File

@ -52,8 +52,8 @@
* @package Crypt_DES * @package Crypt_DES
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVII Jim Wigginton * @copyright MMVII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: DES.php,v 1.16 2010-09-26 05:24:52 terrafrost Exp $ * @version $Id: DES.php,v 1.12 2010/02/09 06:10:26 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */

View File

@ -48,8 +48,8 @@
* @package Crypt_Hash * @package Crypt_Hash
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVII Jim Wigginton * @copyright MMVII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: Hash.php,v 1.8 2010-08-28 17:26:22 terrafrost Exp $ * @version $Id: Hash.php,v 1.6 2009/11/23 23:37:07 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */

View File

@ -54,8 +54,8 @@
* @package Crypt_RC4 * @package Crypt_RC4
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVII Jim Wigginton * @copyright MMVII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: RC4.php,v 1.9 2010-10-24 01:24:30 terrafrost Exp $ * @version $Id: RC4.php,v 1.8 2009/06/09 04:00:38 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */
@ -209,7 +209,6 @@ class Crypt_RC4 {
$this->key = $key; $this->key = $key;
if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) { if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) {
$this->encryptStream = $this->decryptStream = false;
return; return;
} }

View File

@ -61,8 +61,8 @@
* @package Crypt_RSA * @package Crypt_RSA
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMIX Jim Wigginton * @copyright MMIX Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: RSA.php,v 1.20 2010-09-26 03:10:20 terrafrost Exp $ * @version $Id: RSA.php,v 1.19 2010/09/12 21:58:54 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */
@ -1381,9 +1381,11 @@ class Crypt_RSA {
*/ */
function _blind($x, $r, $i) function _blind($x, $r, $i)
{ {
echo "blinding\r\n";
$x = $x->multiply($r->modPow($this->publicExponent, $this->primes[$i])); $x = $x->multiply($r->modPow($this->publicExponent, $this->primes[$i]));
echo "calling modpow\r\n";
$x = $x->modPow($this->exponents[$i], $this->primes[$i]); $x = $x->modPow($this->exponents[$i], $this->primes[$i]);
echo "modpow called\r\n";
$r = $r->modInverse($this->primes[$i]); $r = $r->modInverse($this->primes[$i]);
$x = $x->multiply($r); $x = $x->multiply($r);
@ -1679,6 +1681,7 @@ class Crypt_RSA {
$c = $this->_os2ip($c); $c = $this->_os2ip($c);
$m = $this->_rsadp($c); $m = $this->_rsadp($c);
echo urlencode($m->toBytes()) . "\r\n";
if ($m === false) { if ($m === false) {
user_error('Decryption error', E_USER_NOTICE); user_error('Decryption error', E_USER_NOTICE);
return false; return false;
@ -2025,6 +2028,7 @@ class Crypt_RSA {
case CRYPT_RSA_ENCRYPTION_PKCS1: case CRYPT_RSA_ENCRYPTION_PKCS1:
$length = $this->k - 11; $length = $this->k - 11;
if ($length <= 0) { if ($length <= 0) {
echo 'returning false';
return false; return false;
} }

View File

@ -34,8 +34,8 @@
* @package Crypt_Random * @package Crypt_Random
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVII Jim Wigginton * @copyright MMVII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: Random.php,v 1.9 2010-04-24 06:40:48 terrafrost Exp $ * @version $Id: Random.php,v 1.9 2010/04/24 06:40:48 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */

View File

@ -63,8 +63,8 @@
* @package Crypt_Rijndael * @package Crypt_Rijndael
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVIII Jim Wigginton * @copyright MMVIII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: Rijndael.php,v 1.15 2010-09-26 05:02:10 terrafrost Exp $ * @version $Id: Rijndael.php,v 1.12 2010/02/09 06:10:26 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */
@ -671,6 +671,8 @@ class Crypt_Rijndael {
} }
break; break;
case CRYPT_RIJNDAEL_MODE_CBC: case CRYPT_RIJNDAEL_MODE_CBC:
echo "USING CBC\r\n";
echo "mode = {$this->mode}\r\n";exit;
$xor = $this->encryptIV; $xor = $this->encryptIV;
for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
$block = substr($plaintext, $i, $block_size); $block = substr($plaintext, $i, $block_size);

View File

@ -46,8 +46,8 @@
* @package Crypt_TripleDES * @package Crypt_TripleDES
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVII Jim Wigginton * @copyright MMVII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: TripleDES.php,v 1.17 2010-09-26 05:24:52 terrafrost Exp $ * @version $Id: TripleDES.php,v 1.13 2010/02/26 03:40:25 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */

View File

@ -66,7 +66,7 @@
* @package Math_BigInteger * @package Math_BigInteger
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVI Jim Wigginton * @copyright MMVI Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: BigInteger.php,v 1.33 2010/03/22 22:32:03 terrafrost Exp $ * @version $Id: BigInteger.php,v 1.33 2010/03/22 22:32:03 terrafrost Exp $
* @link http://pear.php.net/package/Math_BigInteger * @link http://pear.php.net/package/Math_BigInteger
*/ */
@ -599,7 +599,9 @@ class Math_BigInteger {
for ($i = 0, $end = strlen($hex) & 0xFFFFFFF8; $i < $end; $i+=8) { for ($i = 0, $end = strlen($hex) & 0xFFFFFFF8; $i < $end; $i+=8) {
$bits.= str_pad(decbin(hexdec(substr($hex, $i, 8))), 32, '0', STR_PAD_LEFT); $bits.= str_pad(decbin(hexdec(substr($hex, $i, 8))), 32, '0', STR_PAD_LEFT);
} }
$bits.= str_pad(decbin(hexdec(substr($hex, $end))), strlen($hex) & 7, '0', STR_PAD_LEFT); if ($end != strlen($hex)) { // hexdec('') == 0
$bits.= str_pad(decbin(hexdec(substr($hex, $end))), strlen($hex) & 7, '0', STR_PAD_LEFT);
}
return $this->precision > 0 ? substr($bits, -$this->precision) : ltrim($bits, '0'); return $this->precision > 0 ? substr($bits, -$this->precision) : ltrim($bits, '0');
} }

View File

@ -47,7 +47,7 @@
* @package Net_SFTP * @package Net_SFTP
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMIX Jim Wigginton * @copyright MMIX Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: SFTP.php,v 1.25 2010/10/02 22:23:25 terrafrost Exp $ * @version $Id: SFTP.php,v 1.25 2010/10/02 22:23:25 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */

View File

@ -64,8 +64,8 @@
* @package Net_SSH1 * @package Net_SSH1
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVII Jim Wigginton * @copyright MMVII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: SSH1.php,v 1.16 2010-08-08 05:06:38 terrafrost Exp $ * @version $Id: SSH1.php,v 1.15 2010/03/22 22:01:38 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */

View File

@ -59,7 +59,7 @@
* @package Net_SSH2 * @package Net_SSH2
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>
* @copyright MMVII Jim Wigginton * @copyright MMVII Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version $Id: SSH2.php,v 1.53 2010-10-24 01:24:30 terrafrost Exp $ * @version $Id: SSH2.php,v 1.53 2010-10-24 01:24:30 terrafrost Exp $
* @link http://phpseclib.sourceforge.net * @link http://phpseclib.sourceforge.net
*/ */

View File

@ -1,5 +1,5 @@
<?php <?php
// $Id: array_fill.php,v 1.1 2007-07-02 04:19:55 terrafrost Exp $ // $Id: array_fill.php,v 1.1 2007/07/02 04:19:55 terrafrost Exp $
/** /**
@ -7,7 +7,7 @@
* *
* @category PHP * @category PHP
* @package PHP_Compat * @package PHP_Compat
* @license LGPL - http://www.gnu.org/licenses/lgpl.html * @license http://www.opensource.org/licenses/mit-license.html MIT License
* @copyright 2004-2007 Aidan Lister <aidan@php.net>, Arpad Ray <arpad@php.net> * @copyright 2004-2007 Aidan Lister <aidan@php.net>, Arpad Ray <arpad@php.net>
* @link http://php.net/function.array_fill * @link http://php.net/function.array_fill
* @author Jim Wigginton <terrafrost@php.net> * @author Jim Wigginton <terrafrost@php.net>