Removed includes for Random.php and fixed up user_error message

This commit is contained in:
Clint Nelissen 2014-12-02 09:34:15 -08:00
parent f5ed86e385
commit d6029bdb6a
4 changed files with 1 additions and 17 deletions

View File

@ -70,13 +70,6 @@
use \phpseclib\Crypt\Random;
use \phpseclib\Math\BigInteger;
/**
* Include Crypt\Random
*/
if (!class_exists('phpseclib\Crypt\Random')) {
include_once 'Random.php';
}
/**
* Include Crypt_Hash
*/

View File

@ -228,7 +228,7 @@ class Random
$crypto = new Crypt_RC4();
break;
default:
user_error('string requires at least one symmetric cipher be loaded');
user_error(__CLASS__ . ' requires at least one symmetric cipher be loaded');
return false;
}

View File

@ -520,11 +520,6 @@ class Net_SSH1
*/
function __construct($host, $port = 22, $timeout = 10, $cipher = NET_SSH1_CIPHER_3DES)
{
// Include Crypt\Random
if (!class_exists('phpseclib\Crypt\Random')) {
include_once 'Crypt/Random.php';
}
$this->protocol_flags = array(
1 => 'NET_SSH1_MSG_DISCONNECT',
2 => 'NET_SSH1_SMSG_PUBLIC_KEY',

View File

@ -856,10 +856,6 @@ class Net_SSH2
*/
function __construct($host, $port = 22, $timeout = 10)
{
if (!class_exists('phpseclib\Crypt\Random')) {
include_once 'Crypt/Random.php';
}
if (!class_exists('Crypt_Hash')) {
include_once 'Crypt/Hash.php';
}