Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid - Version 1.15.2

Version Description

Release date: May 27th, 2022

  • Updpate: Updated dependencies.
Download this release

Release Info

Developer boldgrid
Plugin Icon 128x128 Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid
Version 1.15.2
Comparing to
See all releases

Code changes from version 1.15.1 to 1.15.2

boldgrid-backup.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Total Upkeep
17
  * Plugin URI: https://www.boldgrid.com/boldgrid-backup/
18
  * Description: Automated backups, remote backup to Amazon S3 and Google Drive, stop website crashes before they happen and more. Total Upkeep is the backup solution you need.
19
- * Version: 1.15.1
20
  * Author: BoldGrid
21
  * Author URI: https://www.boldgrid.com/
22
  * License: GPL-2.0+
16
  * Plugin Name: Total Upkeep
17
  * Plugin URI: https://www.boldgrid.com/boldgrid-backup/
18
  * Description: Automated backups, remote backup to Amazon S3 and Google Drive, stop website crashes before they happen and more. Total Upkeep is the backup solution you need.
19
+ * Version: 1.15.2
20
  * Author: BoldGrid
21
  * Author URI: https://www.boldgrid.com/
22
  * License: GPL-2.0+
cli/{verify-f8dd1223236165ea1d79b693ef5e7209.php → verify-852edb2c5781b6f633c8d8b96775d55c.php} RENAMED
File without changes
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: boldgrid, joemoto, imh_brad, rramo012, bgnicolepaschen, jamesros161, joe9663
3
  Tags: backup, cloud backup, database backup, restore, wordpress backup
4
  Requires at least: 4.4
5
- Tested up to: 6.0
6
  Requires PHP: 5.4
7
- Stable tag: 1.15.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -132,6 +132,12 @@ Have a problem? First, take a look at our [Getting Started](https://www.boldgrid
132
 
133
  == Changelog ==
134
 
 
 
 
 
 
 
135
  = 1.15.1 =
136
 
137
  Release date: May 18th, 2022
2
  Contributors: boldgrid, joemoto, imh_brad, rramo012, bgnicolepaschen, jamesros161, joe9663
3
  Tags: backup, cloud backup, database backup, restore, wordpress backup
4
  Requires at least: 4.4
5
+ Tested up to: 6.1
6
  Requires PHP: 5.4
7
+ Stable tag: 1.15.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
132
 
133
  == Changelog ==
134
 
135
+ = 1.15.2 =
136
+
137
+ Release date: May 27th, 2022
138
+
139
+ * Updpate: Updated dependencies.
140
+
141
  = 1.15.1 =
142
 
143
  Release date: May 18th, 2022
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit8d79154a46eda58f41153dbc5aafc250::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59::getLoader();
vendor/boldgrid/library/README.md CHANGED
@@ -11,6 +11,13 @@ composer require boldgrid/library
11
 
12
  ## Changelog ##
13
 
 
 
 
 
 
 
 
14
  ### 2.13.6 ###
15
 
16
  Release date: March 15th, 2022
11
 
12
  ## Changelog ##
13
 
14
+ ### 2.13.7 ###
15
+
16
+ Release date: May 25th, 2022
17
+
18
+ * Update: Add filters to premium urls.
19
+ * Update: Add fallback filters for IMH Central users when Boldgrid Connect plugin is inactive.
20
+
21
  ### 2.13.6 ###
22
 
23
  Release date: March 15th, 2022
vendor/boldgrid/library/src/Library/Configs/IMH_Central.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BoldGrid Library Configs IMH Central Class
4
+ *
5
+ * This class is used to add filters for IMH Central users
6
+ * in the event that the Boldgrid Connect plugin is not active to
7
+ * run the filters itself.
8
+ *
9
+ * @package Boldgrid\Library
10
+ * @subpackage \Library\Configs
11
+ *
12
+ * @version 1.0.0
13
+ * @author BoldGrid <wpb@boldgrid.com>
14
+ */
15
+
16
+ namespace Boldgrid\Library\Library\Configs;
17
+
18
+ class IMH_Central {
19
+ /**
20
+ * Constructor
21
+ *
22
+ * @since 1.0.0
23
+ */
24
+ public function __construct() {
25
+ if ( ! get_option( 'bg_connect_configs' ) ) {
26
+ return;
27
+ }
28
+
29
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
30
+
31
+ if ( \is_plugin_active( 'boldgrid-connect/boldgrid-connect.php' ) ) {
32
+ return;
33
+ }
34
+
35
+ self::imh_central_filters();
36
+ }
37
+
38
+ /**
39
+ * Add filters to the IMH Central plugin.
40
+ *
41
+ * @since 1.0.0
42
+ */
43
+ public static function imh_central_filters() {
44
+ $option_configs = get_option( 'bg_connect_configs' );
45
+
46
+ add_filter(
47
+ 'BoldgridDemo/configs',
48
+ function( $configs ) use ( $option_configs ) {
49
+ $configs['servers']['asset'] = ! empty( $option_configs['asset_server'] ) ? $option_configs['asset_server'] : $configs['servers']['asset'];
50
+ return $configs;
51
+ }
52
+ );
53
+
54
+ // Inspirations
55
+ add_filter(
56
+ 'boldgrid_inspirations_configs',
57
+ function ( $configs ) use ( $option_configs ) {
58
+ $configs['asset_server'] = ! empty( $option_configs['asset_server'] ) ? $option_configs['asset_server'] : $configs['servers']['asset'];
59
+ return $configs;
60
+ }
61
+ );
62
+
63
+ // BoldGrid Library
64
+ add_filter(
65
+ 'Boldgrid\Library\Configs\set',
66
+ function( $configs ) use ( $option_configs ) {
67
+ $configs['api'] = ! empty( $option_configs['asset_server'] ) ? $option_configs['asset_server'] : $configs['api'];
68
+ return $configs;
69
+ }
70
+ );
71
+
72
+ // BoldGrid Connect Plugin.
73
+ add_filter(
74
+ 'boldgrid_connect_config_setup_configs',
75
+ function( $configs ) use ( $option_configs ) {
76
+ $configs['asset_server'] = ! empty( $option_configs['asset_server'] ) ? $option_configs['asset_server'] : $configs['asset_server'];
77
+ $configs['central_url'] = ! empty( $option_configs['central_url'] ) ? $option_configs['central_url'] : $configs['central_url'];
78
+ return $configs;
79
+ }
80
+ );
81
+
82
+ /**
83
+ * Each of these filters represents a different premium url that can be overridden.
84
+ *
85
+ * To override these urls using the 'bg_connect_configs' option, add the url to the option
86
+ * array using the filter name as the key. For example, to override the boldgrid_editor_premium_url,
87
+ * we would set the following to the bg_connect_configs option:
88
+ * $options_configs[ 'boldgrid_editor_premium_url' ] = 'https://example.com/';
89
+ */
90
+ $premium_url_filters = array(
91
+ 'boldgrid_editor_premium_url',
92
+ 'boldgrid_editor_new_key_url',
93
+ 'boldgrid_editor_premium_download_url',
94
+ 'boldgrid_backup_premium_url',
95
+ 'bgtfw_premium_url',
96
+ 'boldgrid_library_new_key_url',
97
+ 'bgtfw_upgrade_url_pro_features',
98
+ );
99
+
100
+ foreach ( $premium_url_filters as $premium_url_filter ) {
101
+ add_filter(
102
+ $premium_url_filter,
103
+ function( $url ) use ( $option_configs, $premium_url_filter ) {
104
+ return ! empty( $option_configs[ $premium_url_filter ] ) ? $option_configs[ $premium_url_filter ] : $url;
105
+ }
106
+ );
107
+ }
108
+ }
109
+ }
110
+
vendor/boldgrid/library/src/Library/Key/PostNewKey.php CHANGED
@@ -106,12 +106,14 @@ class PostNewKey {
106
 
107
  $returnUrl = add_query_arg( 'nonce', wp_create_nonce( 'bglib-key-prompt' ), $returnUrl );
108
 
 
 
109
  // Create the final url and return it.
110
  return add_query_arg(
111
  array(
112
  'wp-url' => urlencode( $returnUrl ),
113
  ),
114
- Configs::get( 'getNewKey' )
115
  );
116
  }
117
 
106
 
107
  $returnUrl = add_query_arg( 'nonce', wp_create_nonce( 'bglib-key-prompt' ), $returnUrl );
108
 
109
+ $getNewKeyUrl = apply_filters( 'boldgrid_library_new_key_url', Configs::get( 'getNewKey' ) );
110
+
111
  // Create the final url and return it.
112
  return add_query_arg(
113
  array(
114
  'wp-url' => urlencode( $returnUrl ),
115
  ),
116
+ $getNewKeyUrl
117
  );
118
  }
119
 
vendor/boldgrid/library/src/Library/Start.php CHANGED
@@ -136,6 +136,8 @@ class Start {
136
  Configs::setItem( 'page-connect', new Page\Connect() );
137
  Configs::setItem( 'assets', new Asset() );
138
  new Editor();
 
 
139
  }
140
 
141
  /**
136
  Configs::setItem( 'page-connect', new Page\Connect() );
137
  Configs::setItem( 'assets', new Asset() );
138
  new Editor();
139
+
140
+ new Configs\IMH_Central();
141
  }
142
 
143
  /**
vendor/boldgrid/library/src/library.global.php CHANGED
@@ -7,7 +7,7 @@ defined( 'WPFORMS_SHAREASALE_ID' ) || define( 'WPFORMS_SHAREASALE_ID', '1581233'
7
 
8
  return array(
9
  // libraryVersion is used to put the version number on js/css files.
10
- 'libraryVersion' => '2.13.6',
11
  'api' => 'https://api.boldgrid.com',
12
  'option' => 'license',
13
  'key' => get_site_option( 'boldgrid_api_key', null ),
7
 
8
  return array(
9
  // libraryVersion is used to put the version number on js/css files.
10
+ 'libraryVersion' => '2.13.7',
11
  'api' => 'https://api.boldgrid.com',
12
  'option' => 'license',
13
  'key' => get_site_option( 'boldgrid_api_key', null ),
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit8d79154a46eda58f41153dbc5aafc250
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit8d79154a46eda58f41153dbc5aafc250
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit8d79154a46eda58f41153dbc5aafc250', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit8d79154a46eda58f41153dbc5aafc250', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit8d79154a46eda58f41153dbc5aafc250::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit8d79154a46eda58f41153dbc5aafc250
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit8d79154a46eda58f41153dbc5aafc250::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire8d79154a46eda58f41153dbc5aafc250($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire8d79154a46eda58f41153dbc5aafc250($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire26d4acbfedaf0bcf5650b36fab97aa59($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire26d4acbfedaf0bcf5650b36fab97aa59($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit8d79154a46eda58f41153dbc5aafc250
8
  {
9
  public static $files = array (
10
  'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
@@ -91,9 +91,9 @@ class ComposerStaticInit8d79154a46eda58f41153dbc5aafc250
91
  public static function getInitializer(ClassLoader $loader)
92
  {
93
  return \Closure::bind(function () use ($loader) {
94
- $loader->prefixLengthsPsr4 = ComposerStaticInit8d79154a46eda58f41153dbc5aafc250::$prefixLengthsPsr4;
95
- $loader->prefixDirsPsr4 = ComposerStaticInit8d79154a46eda58f41153dbc5aafc250::$prefixDirsPsr4;
96
- $loader->classMap = ComposerStaticInit8d79154a46eda58f41153dbc5aafc250::$classMap;
97
 
98
  }, null, ClassLoader::class);
99
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59
8
  {
9
  public static $files = array (
10
  'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
91
  public static function getInitializer(ClassLoader $loader)
92
  {
93
  return \Closure::bind(function () use ($loader) {
94
+ $loader->prefixLengthsPsr4 = ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::$prefixLengthsPsr4;
95
+ $loader->prefixDirsPsr4 = ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::$prefixDirsPsr4;
96
+ $loader->classMap = ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::$classMap;
97
 
98
  }, null, ClassLoader::class);
99
  }
vendor/composer/installed.json CHANGED
@@ -1,23 +1,23 @@
1
  [
2
  {
3
  "name": "boldgrid/library",
4
- "version": "2.13.6",
5
- "version_normalized": "2.13.6.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/BoldGrid/library.git",
9
- "reference": "f225b4cabbd3758b2beebf0ec890959c6bea2564"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/BoldGrid/library/zipball/f225b4cabbd3758b2beebf0ec890959c6bea2564",
14
- "reference": "f225b4cabbd3758b2beebf0ec890959c6bea2564",
15
  "shasum": ""
16
  },
17
  "require-dev": {
18
  "yoast/phpunit-polyfills": "^1.0"
19
  },
20
- "time": "2022-03-15T17:39:20+00:00",
21
  "type": "library",
22
  "installation-source": "dist",
23
  "autoload": {
@@ -127,17 +127,17 @@
127
  },
128
  {
129
  "name": "phpseclib/phpseclib",
130
- "version": "2.0.36",
131
- "version_normalized": "2.0.36.0",
132
  "source": {
133
  "type": "git",
134
  "url": "https://github.com/phpseclib/phpseclib.git",
135
- "reference": "a97547126396548c224703a267a30af1592be146"
136
  },
137
  "dist": {
138
  "type": "zip",
139
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/a97547126396548c224703a267a30af1592be146",
140
- "reference": "a97547126396548c224703a267a30af1592be146",
141
  "shasum": ""
142
  },
143
  "require": {
@@ -154,7 +154,7 @@
154
  "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
155
  "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
156
  },
157
- "time": "2022-01-30T08:48:36+00:00",
158
  "type": "library",
159
  "installation-source": "dist",
160
  "autoload": {
1
  [
2
  {
3
  "name": "boldgrid/library",
4
+ "version": "2.13.7",
5
+ "version_normalized": "2.13.7.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/BoldGrid/library.git",
9
+ "reference": "93602b2785b54a7439777822901ec3f66b6349e9"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/BoldGrid/library/zipball/93602b2785b54a7439777822901ec3f66b6349e9",
14
+ "reference": "93602b2785b54a7439777822901ec3f66b6349e9",
15
  "shasum": ""
16
  },
17
  "require-dev": {
18
  "yoast/phpunit-polyfills": "^1.0"
19
  },
20
+ "time": "2022-05-26T14:24:24+00:00",
21
  "type": "library",
22
  "installation-source": "dist",
23
  "autoload": {
127
  },
128
  {
129
  "name": "phpseclib/phpseclib",
130
+ "version": "2.0.37",
131
+ "version_normalized": "2.0.37.0",
132
  "source": {
133
  "type": "git",
134
  "url": "https://github.com/phpseclib/phpseclib.git",
135
+ "reference": "c812fbb4d6b4d7f30235ab7298a12f09ba13b37c"
136
  },
137
  "dist": {
138
  "type": "zip",
139
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/c812fbb4d6b4d7f30235ab7298a12f09ba13b37c",
140
+ "reference": "c812fbb4d6b4d7f30235ab7298a12f09ba13b37c",
141
  "shasum": ""
142
  },
143
  "require": {
154
  "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
155
  "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
156
  },
157
+ "time": "2022-04-04T04:57:45+00:00",
158
  "type": "library",
159
  "installation-source": "dist",
160
  "autoload": {
vendor/phpseclib/phpseclib/BACKERS.md CHANGED
@@ -5,6 +5,7 @@ phpseclib ongoing development is made possible by [Tidelift](https://tidelift.co
5
  ## Backers
6
 
7
  - Allan Simon
 
8
  - Raghu Veer Dendukuri
9
  - Zane Hooper
10
  - [Setasign](https://www.setasign.com/)
5
  ## Backers
6
 
7
  - Allan Simon
8
+ - [ChargeOver](https://chargeover.com/)
9
  - Raghu Veer Dendukuri
10
  - Zane Hooper
11
  - [Setasign](https://www.setasign.com/)
vendor/phpseclib/phpseclib/README.md CHANGED
@@ -68,9 +68,10 @@ Need Support?
68
 
69
  ## Special Thanks
70
 
71
- Special Thanks to our Patreon sponsors!:
72
 
73
  - Allan Simon
 
74
 
75
  ## Contributing
76
 
68
 
69
  ## Special Thanks
70
 
71
+ Special Thanks to our $50+ sponsors!:
72
 
73
  - Allan Simon
74
+ - [ChargeOver](https://chargeover.com/)
75
 
76
  ## Contributing
77
 
vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php CHANGED
@@ -156,7 +156,7 @@ abstract class Base
156
  * @var string
157
  * @access private
158
  */
159
- var $iv;
160
 
161
  /**
162
  * A "sliding" Initialization Vector
@@ -779,6 +779,7 @@ abstract class Base
779
  }
780
  return $ciphertext;
781
  case self::MODE_OFB8:
 
782
  $ciphertext = '';
783
  $len = strlen($plaintext);
784
  $iv = $this->encryptIV;
@@ -795,8 +796,6 @@ abstract class Base
795
  break;
796
  case self::MODE_OFB:
797
  return $this->_openssl_ofb_process($plaintext, $this->encryptIV, $this->enbuffer);
798
- case self::MODE_OFB8:
799
- // OpenSSL has built in support for cfb8 but not ofb8
800
  }
801
  }
802
 
@@ -918,8 +917,8 @@ abstract class Base
918
  $block = substr($plaintext, $i, $block_size);
919
  if (strlen($block) > strlen($buffer['ciphertext'])) {
920
  $buffer['ciphertext'].= $this->_encryptBlock($xor);
 
921
  }
922
- $this->_increment_str($xor);
923
  $key = $this->_string_shift($buffer['ciphertext'], $block_size);
924
  $ciphertext.= $block ^ $key;
925
  }
@@ -2079,6 +2078,13 @@ abstract class Base
2079
  */
2080
  function _increment_str(&$var)
2081
  {
 
 
 
 
 
 
 
2082
  for ($i = 4; $i <= strlen($var); $i+= 4) {
2083
  $temp = substr($var, -$i, 4);
2084
  switch ($temp) {
156
  * @var string
157
  * @access private
158
  */
159
+ var $iv = '';
160
 
161
  /**
162
  * A "sliding" Initialization Vector
779
  }
780
  return $ciphertext;
781
  case self::MODE_OFB8:
782
+ // OpenSSL has built in support for cfb8 but not ofb8
783
  $ciphertext = '';
784
  $len = strlen($plaintext);
785
  $iv = $this->encryptIV;
796
  break;
797
  case self::MODE_OFB:
798
  return $this->_openssl_ofb_process($plaintext, $this->encryptIV, $this->enbuffer);
 
 
799
  }
800
  }
801
 
917
  $block = substr($plaintext, $i, $block_size);
918
  if (strlen($block) > strlen($buffer['ciphertext'])) {
919
  $buffer['ciphertext'].= $this->_encryptBlock($xor);
920
+ $this->_increment_str($xor);
921
  }
 
922
  $key = $this->_string_shift($buffer['ciphertext'], $block_size);
923
  $ciphertext.= $block ^ $key;
924
  }
2078
  */
2079
  function _increment_str(&$var)
2080
  {
2081
+ if (function_exists('sodium_increment')) {
2082
+ $var = strrev($var);
2083
+ sodium_increment($var);
2084
+ $var = strrev($var);
2085
+ return;
2086
+ }
2087
+
2088
  for ($i = 4; $i <= strlen($var); $i+= 4) {
2089
  $temp = substr($var, -$i, 4);
2090
  switch ($temp) {
vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php CHANGED
@@ -1405,11 +1405,18 @@ class RSA
1405
  unset($xml);
1406
 
1407
  return isset($this->components['modulus']) && isset($this->components['publicExponent']) ? $this->components : false;
1408
- // from PuTTY's SSHPUBK.C
1409
  case self::PRIVATE_FORMAT_PUTTY:
1410
  $components = array();
1411
  $key = preg_split('#\r\n|\r|\n#', $key);
1412
- $type = trim(preg_replace('#PuTTY-User-Key-File-2: (.+)#', '$1', $key[0]));
 
 
 
 
 
 
 
1413
  if ($type != 'ssh-rsa') {
1414
  return false;
1415
  }
@@ -1424,23 +1431,55 @@ class RSA
1424
  extract(unpack('Nlength', $this->_string_shift($public, 4)));
1425
  $components['modulus'] = new BigInteger($this->_string_shift($public, $length), -256);
1426
 
1427
- $privateLength = trim(preg_replace('#Private-Lines: (\d+)#', '$1', $key[$publicLength + 4]));
1428
- $private = base64_decode(implode('', array_map('trim', array_slice($key, $publicLength + 5, $privateLength))));
1429
-
1430
  switch ($encryption) {
1431
  case 'aes256-cbc':
1432
- $symkey = '';
1433
- $sequence = 0;
1434
- while (strlen($symkey) < 32) {
1435
- $temp = pack('Na*', $sequence++, $this->password);
1436
- $symkey.= pack('H*', sha1($temp));
1437
- }
1438
- $symkey = substr($symkey, 0, 32);
1439
  $crypto = new AES();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1440
  }
1441
 
 
 
 
1442
  if ($encryption != 'none') {
1443
  $crypto->setKey($symkey);
 
1444
  $crypto->disablePadding();
1445
  $private = $crypto->decrypt($private);
1446
  if ($private === false) {
1405
  unset($xml);
1406
 
1407
  return isset($this->components['modulus']) && isset($this->components['publicExponent']) ? $this->components : false;
1408
+ // see PuTTY's SSHPUBK.C and https://tartarus.org/~simon/putty-snapshots/htmldoc/AppendixC.html
1409
  case self::PRIVATE_FORMAT_PUTTY:
1410
  $components = array();
1411
  $key = preg_split('#\r\n|\r|\n#', $key);
1412
+ if ($this->_string_shift($key[0], strlen('PuTTY-User-Key-File-')) != 'PuTTY-User-Key-File-') {
1413
+ return false;
1414
+ }
1415
+ $version = (int) $this->_string_shift($key[0], 3); // should be either "2: " or "3: 0" prior to int casting
1416
+ if ($version != 2 && $version != 3) {
1417
+ return false;
1418
+ }
1419
+ $type = rtrim($key[0]);
1420
  if ($type != 'ssh-rsa') {
1421
  return false;
1422
  }
1431
  extract(unpack('Nlength', $this->_string_shift($public, 4)));
1432
  $components['modulus'] = new BigInteger($this->_string_shift($public, $length), -256);
1433
 
1434
+ $offset = $publicLength + 4;
 
 
1435
  switch ($encryption) {
1436
  case 'aes256-cbc':
 
 
 
 
 
 
 
1437
  $crypto = new AES();
1438
+ switch ($version) {
1439
+ case 3:
1440
+ if (!function_exists('sodium_crypto_pwhash')) {
1441
+ return false;
1442
+ }
1443
+ $flavour = trim(preg_replace('#Key-Derivation: (.*)#', '$1', $key[$offset++]));
1444
+ switch ($flavour) {
1445
+ case 'Argon2i':
1446
+ $flavour = SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13;
1447
+ break;
1448
+ case 'Argon2id':
1449
+ $flavour = SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13;
1450
+ break;
1451
+ default:
1452
+ return false;
1453
+ }
1454
+ $memory = trim(preg_replace('#Argon2-Memory: (\d+)#', '$1', $key[$offset++]));
1455
+ $passes = trim(preg_replace('#Argon2-Passes: (\d+)#', '$1', $key[$offset++]));
1456
+ $parallelism = trim(preg_replace('#Argon2-Parallelism: (\d+)#', '$1', $key[$offset++]));
1457
+ $salt = pack('H*', trim(preg_replace('#Argon2-Salt: ([0-9a-f]+)#', '$1', $key[$offset++])));
1458
+
1459
+ $length = 80; // keylen + ivlen + mac_keylen
1460
+ $temp = sodium_crypto_pwhash($length, $this->password, $salt, $passes, $memory << 10, $flavour);
1461
+
1462
+ $symkey = substr($temp, 0, 32);
1463
+ $symiv = substr($temp, 32, 16);
1464
+ break;
1465
+ case 2:
1466
+ $symkey = '';
1467
+ $sequence = 0;
1468
+ while (strlen($symkey) < 32) {
1469
+ $temp = pack('Na*', $sequence++, $this->password);
1470
+ $symkey.= pack('H*', sha1($temp));
1471
+ }
1472
+ $symkey = substr($symkey, 0, 32);
1473
+ $symiv = str_repeat("\0", 16);
1474
+ }
1475
  }
1476
 
1477
+ $privateLength = trim(preg_replace('#Private-Lines: (\d+)#', '$1', $key[$offset++]));
1478
+ $private = base64_decode(implode('', array_map('trim', array_slice($key, $offset, $privateLength))));
1479
+
1480
  if ($encryption != 'none') {
1481
  $crypto->setKey($symkey);
1482
+ $crypto->setIV($symiv);
1483
  $crypto->disablePadding();
1484
  $private = $crypto->decrypt($private);
1485
  if ($private === false) {
vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php CHANGED
@@ -234,11 +234,10 @@ class Agent
234
  * Signal that agent forwarding should
235
  * be requested when a channel is opened
236
  *
237
- * @param Net_SSH2 $ssh
238
  * @return bool
239
  * @access public
240
  */
241
- function startSSHForwarding($ssh)
242
  {
243
  if ($this->forward_status == self::FORWARD_NONE) {
244
  $this->forward_status = self::FORWARD_REQUEST;
234
  * Signal that agent forwarding should
235
  * be requested when a channel is opened
236
  *
 
237
  * @return bool
238
  * @access public
239
  */
240
+ function startSSHForwarding()
241
  {
242
  if ($this->forward_status == self::FORWARD_NONE) {
243
  $this->forward_status = self::FORWARD_REQUEST;