aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r--apps/encryption/lib/AppInfo/Application.php2
-rw-r--r--apps/encryption/lib/Command/DisableMasterKey.php3
-rw-r--r--apps/encryption/lib/Command/EnableMasterKey.php1
-rw-r--r--apps/encryption/lib/Command/RecoverUser.php3
-rw-r--r--apps/encryption/lib/Command/ScanLegacyFormat.php3
-rw-r--r--apps/encryption/lib/Controller/RecoveryController.php2
-rw-r--r--apps/encryption/lib/Controller/SettingsController.php2
-rw-r--r--apps/encryption/lib/Controller/StatusController.php2
-rw-r--r--apps/encryption/lib/Crypto/Crypt.php8
-rw-r--r--apps/encryption/lib/Crypto/DecryptAll.php1
-rw-r--r--apps/encryption/lib/Crypto/EncryptAll.php1
-rw-r--r--apps/encryption/lib/Crypto/Encryption.php11
-rw-r--r--apps/encryption/lib/Exceptions/MultiKeyDecryptException.php2
-rw-r--r--apps/encryption/lib/Exceptions/MultiKeyEncryptException.php2
-rw-r--r--apps/encryption/lib/Exceptions/PrivateKeyMissingException.php1
-rw-r--r--apps/encryption/lib/Exceptions/PublicKeyMissingException.php2
-rw-r--r--apps/encryption/lib/HookManager.php1
-rw-r--r--apps/encryption/lib/Hooks/Contracts/IHook.php1
-rw-r--r--apps/encryption/lib/Hooks/UserHooks.php1
-rw-r--r--apps/encryption/lib/KeyManager.php1
-rw-r--r--apps/encryption/lib/Migration/SetMasterKeyStatus.php3
-rw-r--r--apps/encryption/lib/Recovery.php1
-rw-r--r--apps/encryption/lib/Session.php1
-rw-r--r--apps/encryption/lib/Settings/Admin.php3
-rw-r--r--apps/encryption/lib/Settings/Personal.php3
-rw-r--r--apps/encryption/lib/Users/Setup.php1
-rw-r--r--apps/encryption/lib/Util.php4
27 files changed, 17 insertions, 49 deletions
diff --git a/apps/encryption/lib/AppInfo/Application.php b/apps/encryption/lib/AppInfo/Application.php
index ac0f2ededd2..63239a1bf9b 100644
--- a/apps/encryption/lib/AppInfo/Application.php
+++ b/apps/encryption/lib/AppInfo/Application.php
@@ -7,7 +7,6 @@
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Clark Tomlinson <fallen013@gmail.com>
* @author Morris Jobke <hey@morrisjobke.de>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @license AGPL-3.0
@@ -25,7 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\AppInfo;
use OCA\Encryption\Crypto\Crypt;
diff --git a/apps/encryption/lib/Command/DisableMasterKey.php b/apps/encryption/lib/Command/DisableMasterKey.php
index 291ed6bbb04..6000d6021c8 100644
--- a/apps/encryption/lib/Command/DisableMasterKey.php
+++ b/apps/encryption/lib/Command/DisableMasterKey.php
@@ -15,14 +15,13 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-
namespace OCA\Encryption\Command;
use OCA\Encryption\Util;
diff --git a/apps/encryption/lib/Command/EnableMasterKey.php b/apps/encryption/lib/Command/EnableMasterKey.php
index c73d1b4ad1e..031f6e3fa4e 100644
--- a/apps/encryption/lib/Command/EnableMasterKey.php
+++ b/apps/encryption/lib/Command/EnableMasterKey.php
@@ -21,7 +21,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Command;
use OCA\Encryption\Util;
diff --git a/apps/encryption/lib/Command/RecoverUser.php b/apps/encryption/lib/Command/RecoverUser.php
index 800ddf66a8a..d3dd4a3612d 100644
--- a/apps/encryption/lib/Command/RecoverUser.php
+++ b/apps/encryption/lib/Command/RecoverUser.php
@@ -15,14 +15,13 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-
namespace OCA\Encryption\Command;
use OCA\Encryption\Util;
diff --git a/apps/encryption/lib/Command/ScanLegacyFormat.php b/apps/encryption/lib/Command/ScanLegacyFormat.php
index 425d0348006..dc6d43ee5b8 100644
--- a/apps/encryption/lib/Command/ScanLegacyFormat.php
+++ b/apps/encryption/lib/Command/ScanLegacyFormat.php
@@ -17,14 +17,13 @@ declare(strict_types=1);
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-
namespace OCA\Encryption\Command;
use OC\Files\View;
diff --git a/apps/encryption/lib/Controller/RecoveryController.php b/apps/encryption/lib/Controller/RecoveryController.php
index 6455700cd9b..c5f8a7e8d72 100644
--- a/apps/encryption/lib/Controller/RecoveryController.php
+++ b/apps/encryption/lib/Controller/RecoveryController.php
@@ -6,6 +6,7 @@
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Clark Tomlinson <fallen013@gmail.com>
* @author Lukas Reschke <lukas@statuscode.ch>
+ * @author Morris Jobke <hey@morrisjobke.de>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
@@ -23,7 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Controller;
use OCA\Encryption\Recovery;
diff --git a/apps/encryption/lib/Controller/SettingsController.php b/apps/encryption/lib/Controller/SettingsController.php
index 6ccfe51400e..eedbaea9d9d 100644
--- a/apps/encryption/lib/Controller/SettingsController.php
+++ b/apps/encryption/lib/Controller/SettingsController.php
@@ -4,6 +4,7 @@
*
* @author Björn Schießle <bjoern@schiessle.org>
* @author Joas Schilling <coding@schilljs.com>
+ * @author Morris Jobke <hey@morrisjobke.de>
*
* @license AGPL-3.0
*
@@ -20,7 +21,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Controller;
use OCA\Encryption\Crypto\Crypt;
diff --git a/apps/encryption/lib/Controller/StatusController.php b/apps/encryption/lib/Controller/StatusController.php
index a17023fdcfd..d07b4da794a 100644
--- a/apps/encryption/lib/Controller/StatusController.php
+++ b/apps/encryption/lib/Controller/StatusController.php
@@ -6,6 +6,7 @@
* @author Björn Schießle <bjoern@schiessle.org>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Joas Schilling <coding@schilljs.com>
+ * @author Morris Jobke <hey@morrisjobke.de>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @license AGPL-3.0
@@ -23,7 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Controller;
use OCA\Encryption\Session;
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php
index 0acf74baeca..a7d7c024cbb 100644
--- a/apps/encryption/lib/Crypto/Crypt.php
+++ b/apps/encryption/lib/Crypto/Crypt.php
@@ -28,7 +28,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Crypto;
use OC\Encryption\Exceptions\DecryptionFailedException;
@@ -268,13 +267,6 @@ class Crypt {
$cipher = self::DEFAULT_CIPHER;
}
- // Workaround for OpenSSL 0.9.8. Fallback to an old cipher that should work.
- if (OPENSSL_VERSION_NUMBER < 0x1000101f) {
- if ($cipher === 'AES-256-CTR' || $cipher === 'AES-128-CTR') {
- $cipher = self::LEGACY_CIPHER;
- }
- }
-
return $cipher;
}
diff --git a/apps/encryption/lib/Crypto/DecryptAll.php b/apps/encryption/lib/Crypto/DecryptAll.php
index 926d4b38db1..e982da72086 100644
--- a/apps/encryption/lib/Crypto/DecryptAll.php
+++ b/apps/encryption/lib/Crypto/DecryptAll.php
@@ -20,7 +20,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Crypto;
use OCA\Encryption\KeyManager;
diff --git a/apps/encryption/lib/Crypto/EncryptAll.php b/apps/encryption/lib/Crypto/EncryptAll.php
index 135a89c28bb..c8c302f10c7 100644
--- a/apps/encryption/lib/Crypto/EncryptAll.php
+++ b/apps/encryption/lib/Crypto/EncryptAll.php
@@ -25,7 +25,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Crypto;
use OC\Encryption\Exceptions\DecryptionFailedException;
diff --git a/apps/encryption/lib/Crypto/Encryption.php b/apps/encryption/lib/Crypto/Encryption.php
index 6fa388e8875..58cefcbe087 100644
--- a/apps/encryption/lib/Crypto/Encryption.php
+++ b/apps/encryption/lib/Crypto/Encryption.php
@@ -11,8 +11,10 @@
* @author Julius Härtl <jus@bitgrid.net>
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Morris Jobke <hey@morrisjobke.de>
+ * @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Valdnet <47037905+Valdnet@users.noreply.github.com>
*
* @license AGPL-3.0
*
@@ -29,7 +31,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Crypto;
use OC\Encryption\Exceptions\DecryptionFailedException;
@@ -366,8 +367,8 @@ class Encryption implements IEncryptionModule {
*/
public function decrypt($data, $position = 0) {
if (empty($this->fileKey)) {
- $msg = 'Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.';
- $hint = $this->l->t('Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.');
+ $msg = 'Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.';
+ $hint = $this->l->t('Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.');
$this->logger->error($msg);
throw new DecryptionFailedException($msg, $hint);
@@ -435,7 +436,7 @@ class Encryption implements IEncryptionModule {
public function shouldEncrypt($path) {
if ($this->util->shouldEncryptHomeStorage() === false) {
$storage = $this->util->getStorage($path);
- if ($storage->instanceOfStorage('\OCP\Files\IHomeStorage')) {
+ if ($storage && $storage->instanceOfStorage('\OCP\Files\IHomeStorage')) {
return false;
}
}
@@ -492,7 +493,7 @@ class Encryption implements IEncryptionModule {
// valid private/public key
$msg = 'Encryption module "' . $this->getDisplayName() .
'" is not able to read ' . $path;
- $hint = $this->l->t('Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you.');
+ $hint = $this->l->t('Cannot read this file, probably this is a shared file. Please ask the file owner to reshare the file with you.');
$this->logger->warning($msg);
throw new DecryptionFailedException($msg, $hint);
}
diff --git a/apps/encryption/lib/Exceptions/MultiKeyDecryptException.php b/apps/encryption/lib/Exceptions/MultiKeyDecryptException.php
index 79ec2c3c822..562f6955ae4 100644
--- a/apps/encryption/lib/Exceptions/MultiKeyDecryptException.php
+++ b/apps/encryption/lib/Exceptions/MultiKeyDecryptException.php
@@ -2,7 +2,6 @@
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
- * @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @license AGPL-3.0
@@ -20,7 +19,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Exceptions;
use OCP\Encryption\Exceptions\GenericEncryptionException;
diff --git a/apps/encryption/lib/Exceptions/MultiKeyEncryptException.php b/apps/encryption/lib/Exceptions/MultiKeyEncryptException.php
index 4916a4ceba5..3771e7e36ba 100644
--- a/apps/encryption/lib/Exceptions/MultiKeyEncryptException.php
+++ b/apps/encryption/lib/Exceptions/MultiKeyEncryptException.php
@@ -2,7 +2,6 @@
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
- * @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @license AGPL-3.0
@@ -20,7 +19,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Exceptions;
use OCP\Encryption\Exceptions\GenericEncryptionException;
diff --git a/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php b/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php
index 03d3aba8279..b8fd4fb9234 100644
--- a/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php
+++ b/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php
@@ -22,7 +22,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Exceptions;
use OCP\Encryption\Exceptions\GenericEncryptionException;
diff --git a/apps/encryption/lib/Exceptions/PublicKeyMissingException.php b/apps/encryption/lib/Exceptions/PublicKeyMissingException.php
index e4c739b3272..73edc5c710d 100644
--- a/apps/encryption/lib/Exceptions/PublicKeyMissingException.php
+++ b/apps/encryption/lib/Exceptions/PublicKeyMissingException.php
@@ -3,7 +3,6 @@
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @license AGPL-3.0
@@ -21,7 +20,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Exceptions;
use OCP\Encryption\Exceptions\GenericEncryptionException;
diff --git a/apps/encryption/lib/HookManager.php b/apps/encryption/lib/HookManager.php
index 5917a9f6e2a..0e7ec5cfd56 100644
--- a/apps/encryption/lib/HookManager.php
+++ b/apps/encryption/lib/HookManager.php
@@ -21,7 +21,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption;
use OCA\Encryption\Hooks\Contracts\IHook;
diff --git a/apps/encryption/lib/Hooks/Contracts/IHook.php b/apps/encryption/lib/Hooks/Contracts/IHook.php
index 02d26c4dea2..54128d10327 100644
--- a/apps/encryption/lib/Hooks/Contracts/IHook.php
+++ b/apps/encryption/lib/Hooks/Contracts/IHook.php
@@ -19,7 +19,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Hooks\Contracts;
interface IHook {
diff --git a/apps/encryption/lib/Hooks/UserHooks.php b/apps/encryption/lib/Hooks/UserHooks.php
index 399e2865d03..a719d7bc12e 100644
--- a/apps/encryption/lib/Hooks/UserHooks.php
+++ b/apps/encryption/lib/Hooks/UserHooks.php
@@ -25,7 +25,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Hooks;
use OC\Files\Filesystem;
diff --git a/apps/encryption/lib/KeyManager.php b/apps/encryption/lib/KeyManager.php
index 6dabca1729e..4a2c6c16e2b 100644
--- a/apps/encryption/lib/KeyManager.php
+++ b/apps/encryption/lib/KeyManager.php
@@ -29,7 +29,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption;
use OC\Encryption\Exceptions\DecryptionFailedException;
diff --git a/apps/encryption/lib/Migration/SetMasterKeyStatus.php b/apps/encryption/lib/Migration/SetMasterKeyStatus.php
index 322b991ae97..9e800ac7cd3 100644
--- a/apps/encryption/lib/Migration/SetMasterKeyStatus.php
+++ b/apps/encryption/lib/Migration/SetMasterKeyStatus.php
@@ -13,14 +13,13 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-
namespace OCA\Encryption\Migration;
use OCP\IConfig;
diff --git a/apps/encryption/lib/Recovery.php b/apps/encryption/lib/Recovery.php
index 7d7132999ea..22a668cd5b0 100644
--- a/apps/encryption/lib/Recovery.php
+++ b/apps/encryption/lib/Recovery.php
@@ -24,7 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption;
use OC\Files\View;
diff --git a/apps/encryption/lib/Session.php b/apps/encryption/lib/Session.php
index 262705e0be5..ad07008d480 100644
--- a/apps/encryption/lib/Session.php
+++ b/apps/encryption/lib/Session.php
@@ -24,7 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption;
use OCA\Encryption\Exceptions\PrivateKeyMissingException;
diff --git a/apps/encryption/lib/Settings/Admin.php b/apps/encryption/lib/Settings/Admin.php
index cfb04166635..e69379bb414 100644
--- a/apps/encryption/lib/Settings/Admin.php
+++ b/apps/encryption/lib/Settings/Admin.php
@@ -16,14 +16,13 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-
namespace OCA\Encryption\Settings;
use OC\Files\View;
diff --git a/apps/encryption/lib/Settings/Personal.php b/apps/encryption/lib/Settings/Personal.php
index 75354381993..70b85a667a9 100644
--- a/apps/encryption/lib/Settings/Personal.php
+++ b/apps/encryption/lib/Settings/Personal.php
@@ -14,14 +14,13 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-
namespace OCA\Encryption\Settings;
use OCA\Encryption\Session;
diff --git a/apps/encryption/lib/Users/Setup.php b/apps/encryption/lib/Users/Setup.php
index 947ca27dd06..c28a83d8115 100644
--- a/apps/encryption/lib/Users/Setup.php
+++ b/apps/encryption/lib/Users/Setup.php
@@ -25,7 +25,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption\Users;
use OCA\Encryption\Crypto\Crypt;
diff --git a/apps/encryption/lib/Util.php b/apps/encryption/lib/Util.php
index 2b11b8151c0..07bca9cbfdf 100644
--- a/apps/encryption/lib/Util.php
+++ b/apps/encryption/lib/Util.php
@@ -7,6 +7,7 @@
* @author Clark Tomlinson <fallen013@gmail.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Phil Davis <phil.davis@inf.org>
+ * @author Robin Appelman <robin@icewind.nl>
*
* @license AGPL-3.0
*
@@ -23,7 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OCA\Encryption;
use OC\Files\View;
@@ -191,7 +191,7 @@ class Util {
* get storage of path
*
* @param string $path
- * @return \OC\Files\Storage\Storage
+ * @return \OC\Files\Storage\Storage|null
*/
public function getStorage($path) {
return $this->files->getMount($path)->getStorage();