Skip to content

Instantly share code, notes, and snippets.

@jantzenw
Created January 9, 2020 19:50
Show Gist options
  • Save jantzenw/c51ff3eaa640fb097076f2fcef52dfc6 to your computer and use it in GitHub Desktop.
Save jantzenw/c51ff3eaa640fb097076f2fcef52dfc6 to your computer and use it in GitHub Desktop.
Index: lib/phpseclib/Net/SSH2.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- lib/phpseclib/Net/SSH2.php (date 1578598714509)
+++ lib/phpseclib/Net/SSH2.php (date 1578598714509)
@@ -969,22 +969,12 @@
{
// Include Math_BigInteger
// Used to do Diffie-Hellman key exchange and DSA/RSA signature verification.
- if (!class_exists('Math_BigInteger')) {
- include_once 'Math/BigInteger.php';
- }
-
- if (!function_exists('crypt_random_string')) {
- include_once 'Crypt/Random.php';
- }
-
- if (!class_exists('Crypt_Hash')) {
- include_once 'Crypt/Hash.php';
- }
+ require_once('phpseclib/Math/BigInteger.php');
+ require_once('phpseclib/Crypt/Random.php');
+ require_once('phpseclib/Crypt/Hash.php');
// include Crypt_Base so constants can be defined for setCryptoEngine()
- if (!class_exists('Crypt_Base')) {
- include_once 'Crypt/Base.php';
- }
+ require_once('phpseclib/Crypt/Base.php');
$this->message_numbers = array(
1 => 'NET_SSH2_MSG_DISCONNECT',
@@ -2005,69 +1995,51 @@
{
switch ($algorithm) {
case '3des-cbc':
- if (!class_exists('Crypt_TripleDES')) {
- include_once 'Crypt/TripleDES.php';
- }
+ require_once('phpseclib/Crypt/TripleDES.php');
return new Crypt_TripleDES();
break;
case '3des-ctr':
- if (!class_exists('Crypt_TripleDES')) {
- include_once 'Crypt/TripleDES.php';
- }
+ require_once('phpseclib/Crypt/TripleDES.php');
return new Crypt_TripleDES(CRYPT_DES_MODE_CTR);
break;
case 'aes256-cbc':
case 'aes192-cbc':
case 'aes128-cbc':
- if (!class_exists('Crypt_Rijndael')) {
- include_once 'Crypt/Rijndael.php';
- }
+ require_once('phpseclib/Crypt/Rijndael.php');
return new Crypt_Rijndael();
break;
case 'aes256-ctr':
case 'aes192-ctr':
case 'aes128-ctr':
- if (!class_exists('Crypt_Rijndael')) {
- include_once 'Crypt/Rijndael.php';
- }
+ require_once('phpseclib/Crypt/Rijndael.php');
return new Crypt_Rijndael(CRYPT_RIJNDAEL_MODE_CTR);
$this->encrypt_block_size = 16; // eg. 128 / 8
break;
case 'blowfish-cbc':
- if (!class_exists('Crypt_Blowfish')) {
- include_once 'Crypt/Blowfish.php';
- }
+ require_once('phpseclib/Crypt/Blowfish.php');
return new Crypt_Blowfish();
break;
case 'blowfish-ctr':
- if (!class_exists('Crypt_Blowfish')) {
- include_once 'Crypt/Blowfish.php';
- }
+ require_once('phpseclib/Crypt/Blowfish.php');
return new Crypt_Blowfish(CRYPT_BLOWFISH_MODE_CTR);
break;
case 'twofish128-cbc':
case 'twofish192-cbc':
case 'twofish256-cbc':
case 'twofish-cbc':
- if (!class_exists('Crypt_Twofish')) {
- include_once 'Crypt/Twofish.php';
- }
+ require_once('phpseclib/Crypt/Twofish.php');
return new Crypt_Twofish();
break;
case 'twofish128-ctr':
case 'twofish192-ctr':
case 'twofish256-ctr':
- if (!class_exists('Crypt_Twofish')) {
- include_once 'Crypt/Twofish.php';
- }
+ require_once('phpseclib/Crypt/Twofish.php');
return new Crypt_Twofish(CRYPT_TWOFISH_MODE_CTR);
break;
case 'arcfour':
case 'arcfour128':
case 'arcfour256':
- if (!class_exists('Crypt_RC4')) {
- include_once 'Crypt/RC4.php';
- }
+ require_once('phpseclib/Crypt/RC4.php');
return new Crypt_RC4();
break;
case 'none':
@@ -4916,7 +4888,7 @@
$signature = $this->_string_shift($signature, $temp['length']);
if (!class_exists('Crypt_RSA')) {
- include_once 'Crypt/RSA.php';
+ require_once('phpseclib/Crypt/RSA.php');
}
$rsa = new Crypt_RSA();
Index: lib/phpseclib/Crypt/TripleDES.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- lib/phpseclib/Crypt/TripleDES.php (date 1578598791281)
+++ lib/phpseclib/Crypt/TripleDES.php (date 1578598791281)
@@ -55,9 +55,7 @@
/**
* Include Crypt_DES
*/
-if (!class_exists('Crypt_DES')) {
- include_once 'DES.php';
-}
+require_once('phpseclib/Crypt/DES.php');
/**#@+
* @access public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment