From d6029bdb6a08be2a3846dcf01de166f673ee7884 Mon Sep 17 00:00:00 2001 From: Clint Nelissen Date: Tue, 2 Dec 2014 09:34:15 -0800 Subject: [PATCH] Removed includes for Random.php and fixed up user_error message --- phpseclib/Crypt/RSA.php | 7 ------- phpseclib/Crypt/Random.php | 2 +- phpseclib/Net/SSH1.php | 5 ----- phpseclib/Net/SSH2.php | 4 ---- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index da0c242c..168a18e5 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -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 */ diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index 48a6e982..308d3444 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -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; } diff --git a/phpseclib/Net/SSH1.php b/phpseclib/Net/SSH1.php index 7eaeb980..c3e741fb 100644 --- a/phpseclib/Net/SSH1.php +++ b/phpseclib/Net/SSH1.php @@ -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', diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index bc7d8a2e..e47c2a47 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -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'; }