aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/ajax/adminrecovery.php7
-rw-r--r--apps/files_encryption/ajax/changeRecoveryPassword.php15
-rw-r--r--apps/files_encryption/ajax/getMigrationStatus.php3
-rw-r--r--apps/files_encryption/ajax/updatePrivateKeyPassword.php21
-rw-r--r--apps/files_encryption/ajax/userrecovery.php4
-rw-r--r--apps/files_encryption/appinfo/app.php26
-rw-r--r--apps/files_encryption/appinfo/routes.php2
-rw-r--r--apps/files_encryption/appinfo/update.php5
-rw-r--r--apps/files_encryption/appinfo/version2
-rw-r--r--apps/files_encryption/exception/encryptionexception.php50
-rw-r--r--apps/files_encryption/exception/multikeydecryptexception.php (renamed from apps/files_encryption/lib/exceptions.php)33
-rw-r--r--apps/files_encryption/exception/multikeyencryptexception.php34
-rw-r--r--apps/files_encryption/files/error.php8
-rw-r--r--apps/files_encryption/js/encryption.js4
-rw-r--r--apps/files_encryption/l10n/ar.js2
-rw-r--r--apps/files_encryption/l10n/ar.json2
-rw-r--r--apps/files_encryption/l10n/ast.js2
-rw-r--r--apps/files_encryption/l10n/ast.json2
-rw-r--r--apps/files_encryption/l10n/bg_BG.js5
-rw-r--r--apps/files_encryption/l10n/bg_BG.json5
-rw-r--r--apps/files_encryption/l10n/bs.js10
-rw-r--r--apps/files_encryption/l10n/bs.json8
-rw-r--r--apps/files_encryption/l10n/ca.js2
-rw-r--r--apps/files_encryption/l10n/ca.json2
-rw-r--r--apps/files_encryption/l10n/cs_CZ.js14
-rw-r--r--apps/files_encryption/l10n/cs_CZ.json14
-rw-r--r--apps/files_encryption/l10n/da.js6
-rw-r--r--apps/files_encryption/l10n/da.json6
-rw-r--r--apps/files_encryption/l10n/de.js6
-rw-r--r--apps/files_encryption/l10n/de.json6
-rw-r--r--apps/files_encryption/l10n/de_DE.js6
-rw-r--r--apps/files_encryption/l10n/de_DE.json6
-rw-r--r--apps/files_encryption/l10n/el.js8
-rw-r--r--apps/files_encryption/l10n/el.json8
-rw-r--r--apps/files_encryption/l10n/en_GB.js6
-rw-r--r--apps/files_encryption/l10n/en_GB.json6
-rw-r--r--apps/files_encryption/l10n/es.js24
-rw-r--r--apps/files_encryption/l10n/es.json24
-rw-r--r--apps/files_encryption/l10n/es_AR.js2
-rw-r--r--apps/files_encryption/l10n/es_AR.json2
-rw-r--r--apps/files_encryption/l10n/es_MX.js2
-rw-r--r--apps/files_encryption/l10n/es_MX.json2
-rw-r--r--apps/files_encryption/l10n/et_EE.js5
-rw-r--r--apps/files_encryption/l10n/et_EE.json5
-rw-r--r--apps/files_encryption/l10n/eu.js2
-rw-r--r--apps/files_encryption/l10n/eu.json2
-rw-r--r--apps/files_encryption/l10n/fa.js1
-rw-r--r--apps/files_encryption/l10n/fa.json1
-rw-r--r--apps/files_encryption/l10n/fi_FI.js6
-rw-r--r--apps/files_encryption/l10n/fi_FI.json6
-rw-r--r--apps/files_encryption/l10n/fr.js20
-rw-r--r--apps/files_encryption/l10n/fr.json20
-rw-r--r--apps/files_encryption/l10n/gl.js18
-rw-r--r--apps/files_encryption/l10n/gl.json18
-rw-r--r--apps/files_encryption/l10n/hr.js2
-rw-r--r--apps/files_encryption/l10n/hr.json2
-rw-r--r--apps/files_encryption/l10n/hu_HU.js2
-rw-r--r--apps/files_encryption/l10n/hu_HU.json2
-rw-r--r--apps/files_encryption/l10n/id.js2
-rw-r--r--apps/files_encryption/l10n/id.json2
-rw-r--r--apps/files_encryption/l10n/it.js6
-rw-r--r--apps/files_encryption/l10n/it.json6
-rw-r--r--apps/files_encryption/l10n/ja.js10
-rw-r--r--apps/files_encryption/l10n/ja.json10
-rw-r--r--apps/files_encryption/l10n/kn.js9
-rw-r--r--apps/files_encryption/l10n/kn.json7
-rw-r--r--apps/files_encryption/l10n/ko.js2
-rw-r--r--apps/files_encryption/l10n/ko.json2
-rw-r--r--apps/files_encryption/l10n/lt_LT.js2
-rw-r--r--apps/files_encryption/l10n/lt_LT.json2
-rw-r--r--apps/files_encryption/l10n/lv.js4
-rw-r--r--apps/files_encryption/l10n/lv.json4
-rw-r--r--apps/files_encryption/l10n/nb_NO.js16
-rw-r--r--apps/files_encryption/l10n/nb_NO.json16
-rw-r--r--apps/files_encryption/l10n/nl.js6
-rw-r--r--apps/files_encryption/l10n/nl.json6
-rw-r--r--apps/files_encryption/l10n/pl.js10
-rw-r--r--apps/files_encryption/l10n/pl.json10
-rw-r--r--apps/files_encryption/l10n/pt_BR.js6
-rw-r--r--apps/files_encryption/l10n/pt_BR.json6
-rw-r--r--apps/files_encryption/l10n/pt_PT.js11
-rw-r--r--apps/files_encryption/l10n/pt_PT.json11
-rw-r--r--apps/files_encryption/l10n/ro.js1
-rw-r--r--apps/files_encryption/l10n/ro.json1
-rw-r--r--apps/files_encryption/l10n/ru.js66
-rw-r--r--apps/files_encryption/l10n/ru.json66
-rw-r--r--apps/files_encryption/l10n/sk_SK.js7
-rw-r--r--apps/files_encryption/l10n/sk_SK.json7
-rw-r--r--apps/files_encryption/l10n/sl.js6
-rw-r--r--apps/files_encryption/l10n/sl.json6
-rw-r--r--apps/files_encryption/l10n/sq.js3
-rw-r--r--apps/files_encryption/l10n/sq.json3
-rw-r--r--apps/files_encryption/l10n/sv.js18
-rw-r--r--apps/files_encryption/l10n/sv.json18
-rw-r--r--apps/files_encryption/l10n/tr.js6
-rw-r--r--apps/files_encryption/l10n/tr.json6
-rw-r--r--apps/files_encryption/l10n/uk.js5
-rw-r--r--apps/files_encryption/l10n/uk.json5
-rw-r--r--apps/files_encryption/l10n/vi.js1
-rw-r--r--apps/files_encryption/l10n/vi.json1
-rw-r--r--apps/files_encryption/l10n/zh_CN.js2
-rw-r--r--apps/files_encryption/l10n/zh_CN.json2
-rw-r--r--apps/files_encryption/l10n/zh_TW.js2
-rw-r--r--apps/files_encryption/l10n/zh_TW.json2
-rw-r--r--apps/files_encryption/lib/capabilities.php2
-rw-r--r--apps/files_encryption/lib/crypt.php41
-rw-r--r--apps/files_encryption/lib/helper.php161
-rw-r--r--apps/files_encryption/lib/hooks.php (renamed from apps/files_encryption/hooks/hooks.php)270
-rw-r--r--apps/files_encryption/lib/keymanager.php594
-rw-r--r--apps/files_encryption/lib/migration.php264
-rw-r--r--apps/files_encryption/lib/proxy.php27
-rw-r--r--apps/files_encryption/lib/session.php75
-rw-r--r--apps/files_encryption/lib/stream.php51
-rw-r--r--apps/files_encryption/lib/util.php211
-rw-r--r--apps/files_encryption/settings-admin.php2
-rw-r--r--apps/files_encryption/settings-personal.php5
-rw-r--r--apps/files_encryption/templates/invalid_private_key.php2
-rw-r--r--apps/files_encryption/templates/settings-admin.php2
-rw-r--r--apps/files_encryption/templates/settings-personal.php6
-rwxr-xr-xapps/files_encryption/tests/crypt.php204
-rw-r--r--apps/files_encryption/tests/helper.php123
-rw-r--r--apps/files_encryption/tests/hooks.php240
-rw-r--r--apps/files_encryption/tests/keymanager.php400
-rw-r--r--apps/files_encryption/tests/migration.php271
-rw-r--r--apps/files_encryption/tests/proxy.php64
-rwxr-xr-xapps/files_encryption/tests/share.php660
-rw-r--r--apps/files_encryption/tests/stream.php76
-rw-r--r--apps/files_encryption/tests/testcase.php96
-rwxr-xr-xapps/files_encryption/tests/trashbin.php184
-rwxr-xr-xapps/files_encryption/tests/util.php264
-rwxr-xr-xapps/files_encryption/tests/webdav.php80
131 files changed, 2714 insertions, 2575 deletions
diff --git a/apps/files_encryption/ajax/adminrecovery.php b/apps/files_encryption/ajax/adminrecovery.php
index 684fd51ae13..503c15b53a9 100644
--- a/apps/files_encryption/ajax/adminrecovery.php
+++ b/apps/files_encryption/ajax/adminrecovery.php
@@ -7,7 +7,8 @@
*
* Script to handle admin settings for encrypted key recovery
*/
-use OCA\Encryption;
+
+use OCA\Files_Encryption\Helper;
\OCP\JSON::checkAdminUser();
\OCP\JSON::checkAppEnabled('files_encryption');
@@ -42,7 +43,7 @@ $recoveryKeyId = \OC::$server->getAppConfig()->getValue('files_encryption', 'rec
if (isset($_POST['adminEnableRecovery']) && $_POST['adminEnableRecovery'] === '1') {
- $return = \OCA\Encryption\Helper::adminEnableRecovery($recoveryKeyId, $_POST['recoveryPassword']);
+ $return = Helper::adminEnableRecovery($recoveryKeyId, $_POST['recoveryPassword']);
// Return success or failure
if ($return) {
@@ -56,7 +57,7 @@ if (isset($_POST['adminEnableRecovery']) && $_POST['adminEnableRecovery'] === '1
isset($_POST['adminEnableRecovery'])
&& '0' === $_POST['adminEnableRecovery']
) {
- $return = \OCA\Encryption\Helper::adminDisableRecovery($_POST['recoveryPassword']);
+ $return = Helper::adminDisableRecovery($_POST['recoveryPassword']);
if ($return) {
$successMessage = $l->t('Recovery key successfully disabled');
diff --git a/apps/files_encryption/ajax/changeRecoveryPassword.php b/apps/files_encryption/ajax/changeRecoveryPassword.php
index bf647f2c8fa..3d31b12af7c 100644
--- a/apps/files_encryption/ajax/changeRecoveryPassword.php
+++ b/apps/files_encryption/ajax/changeRecoveryPassword.php
@@ -9,8 +9,6 @@
*
*/
-use OCA\Encryption;
-
\OCP\JSON::checkAdminUser();
\OCP\JSON::checkAppEnabled('files_encryption');
\OCP\JSON::callCheck();
@@ -49,22 +47,21 @@ if ($_POST['newPassword'] !== $_POST['confirmPassword']) {
}
$view = new \OC\Files\View('/');
-$util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser());
+$util = new \OCA\Files_Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser());
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$keyId = $util->getRecoveryKeyId();
-$keyPath = '/owncloud_private_key/' . $keyId . '.private.key';
-$encryptedRecoveryKey = $view->file_get_contents($keyPath);
-$decryptedRecoveryKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedRecoveryKey, $oldPassword);
+$encryptedRecoveryKey = \OCA\Files_Encryption\Keymanager::getPrivateSystemKey($keyId);
+$decryptedRecoveryKey = $encryptedRecoveryKey ? \OCA\Files_Encryption\Crypt::decryptPrivateKey($encryptedRecoveryKey, $oldPassword) : false;
if ($decryptedRecoveryKey) {
- $cipher = \OCA\Encryption\Helper::getCipher();
- $encryptedKey = \OCA\Encryption\Crypt::symmetricEncryptFileContent($decryptedRecoveryKey, $newPassword, $cipher);
+ $cipher = \OCA\Files_Encryption\Helper::getCipher();
+ $encryptedKey = \OCA\Files_Encryption\Crypt::symmetricEncryptFileContent($decryptedRecoveryKey, $newPassword, $cipher);
if ($encryptedKey) {
- \OCA\Encryption\Keymanager::setPrivateSystemKey($encryptedKey, $keyId . '.private.key');
+ \OCA\Files_Encryption\Keymanager::setPrivateSystemKey($encryptedKey, $keyId);
$return = true;
}
}
diff --git a/apps/files_encryption/ajax/getMigrationStatus.php b/apps/files_encryption/ajax/getMigrationStatus.php
index adceb949044..bb260199b19 100644
--- a/apps/files_encryption/ajax/getMigrationStatus.php
+++ b/apps/files_encryption/ajax/getMigrationStatus.php
@@ -6,7 +6,8 @@
*
* check migration status
*/
-use OCA\Encryption\Util;
+
+use OCA\Files_Encryption\Util;
\OCP\JSON::checkAppEnabled('files_encryption');
diff --git a/apps/files_encryption/ajax/updatePrivateKeyPassword.php b/apps/files_encryption/ajax/updatePrivateKeyPassword.php
index 0f182e93831..7161b0cff92 100644
--- a/apps/files_encryption/ajax/updatePrivateKeyPassword.php
+++ b/apps/files_encryption/ajax/updatePrivateKeyPassword.php
@@ -9,8 +9,6 @@
*
*/
-use OCA\Encryption;
-
\OCP\JSON::checkLoggedIn();
\OCP\JSON::checkAppEnabled('files_encryption');
\OCP\JSON::callCheck();
@@ -24,27 +22,26 @@ $oldPassword = $_POST['oldPassword'];
$newPassword = $_POST['newPassword'];
$view = new \OC\Files\View('/');
-$session = new \OCA\Encryption\Session($view);
+$session = new \OCA\Files_Encryption\Session($view);
$user = \OCP\User::getUser();
+$loginName = \OC::$server->getUserSession()->getLoginName();
// check new password
-$passwordCorrect = \OCP\User::checkPassword($user, $newPassword);
+$passwordCorrect = \OCP\User::checkPassword($loginName, $newPassword);
if ($passwordCorrect !== false) {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
-$keyPath = '/' . $user . '/files_encryption/' . $user . '.private.key';
-
-$encryptedKey = $view->file_get_contents($keyPath);
-$decryptedKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, $oldPassword);
+$encryptedKey = \OCA\Files_Encryption\Keymanager::getPrivateKey($view, $user);
+$decryptedKey = $encryptedKey ? \OCA\Files_Encryption\Crypt::decryptPrivateKey($encryptedKey, $oldPassword) : false;
if ($decryptedKey) {
- $cipher = \OCA\Encryption\Helper::getCipher();
- $encryptedKey = \OCA\Encryption\Crypt::symmetricEncryptFileContent($decryptedKey, $newPassword, $cipher);
+ $cipher = \OCA\Files_Encryption\Helper::getCipher();
+ $encryptedKey = \OCA\Files_Encryption\Crypt::symmetricEncryptFileContent($decryptedKey, $newPassword, $cipher);
if ($encryptedKey) {
- \OCA\Encryption\Keymanager::setPrivateKey($encryptedKey, $user);
+ \OCA\Files_Encryption\Keymanager::setPrivateKey($encryptedKey, $user);
$session->setPrivateKey($decryptedKey);
$return = true;
}
@@ -62,7 +59,7 @@ if ($decryptedKey) {
// success or failure
if ($return) {
- $session->setInitialized(\OCA\Encryption\Session::INIT_SUCCESSFUL);
+ $session->setInitialized(\OCA\Files_Encryption\Session::INIT_SUCCESSFUL);
\OCP\JSON::success(array('data' => array('message' => $l->t('Private key password successfully updated.'))));
} else {
\OCP\JSON::error(array('data' => array('message' => $errorMessage)));
diff --git a/apps/files_encryption/ajax/userrecovery.php b/apps/files_encryption/ajax/userrecovery.php
index a5b89fa7233..e49fee83a36 100644
--- a/apps/files_encryption/ajax/userrecovery.php
+++ b/apps/files_encryption/ajax/userrecovery.php
@@ -7,8 +7,6 @@
* Script to handle admin settings for encrypted key recovery
*/
-use OCA\Encryption;
-
\OCP\JSON::checkLoggedIn();
\OCP\JSON::checkAppEnabled('files_encryption');
\OCP\JSON::callCheck();
@@ -22,7 +20,7 @@ if (
$userId = \OCP\USER::getUser();
$view = new \OC\Files\View('/');
- $util = new \OCA\Encryption\Util($view, $userId);
+ $util = new \OCA\Files_Encryption\Util($view, $userId);
// Save recovery preference to DB
$return = $util->setRecoveryForUser($_POST['userEnableRecovery']);
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index aa709fbac65..f2dc63c340d 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -1,40 +1,26 @@
<?php
-OC::$CLASSPATH['OCA\Encryption\Crypt'] = 'files_encryption/lib/crypt.php';
-OC::$CLASSPATH['OCA\Encryption\Hooks'] = 'files_encryption/hooks/hooks.php';
-OC::$CLASSPATH['OCA\Encryption\Util'] = 'files_encryption/lib/util.php';
-OC::$CLASSPATH['OCA\Encryption\Keymanager'] = 'files_encryption/lib/keymanager.php';
-OC::$CLASSPATH['OCA\Encryption\Stream'] = 'files_encryption/lib/stream.php';
-OC::$CLASSPATH['OCA\Encryption\Proxy'] = 'files_encryption/lib/proxy.php';
-OC::$CLASSPATH['OCA\Encryption\Session'] = 'files_encryption/lib/session.php';
-OC::$CLASSPATH['OCA\Encryption\Capabilities'] = 'files_encryption/lib/capabilities.php';
-OC::$CLASSPATH['OCA\Encryption\Helper'] = 'files_encryption/lib/helper.php';
-
-// Exceptions
-OC::$CLASSPATH['OCA\Encryption\Exceptions\MultiKeyEncryptException'] = 'files_encryption/lib/exceptions.php';
-OC::$CLASSPATH['OCA\Encryption\Exceptions\MultiKeyDecryptException'] = 'files_encryption/lib/exceptions.php';
-
\OCP\Util::addTranslations('files_encryption');
\OCP\Util::addscript('files_encryption', 'encryption');
\OCP\Util::addscript('files_encryption', 'detect-migration');
if (!OC_Config::getValue('maintenance', false)) {
- OC_FileProxy::register(new OCA\Encryption\Proxy());
+ OC_FileProxy::register(new OCA\Files_Encryption\Proxy());
// User related hooks
- OCA\Encryption\Helper::registerUserHooks();
+ OCA\Files_Encryption\Helper::registerUserHooks();
// Sharing related hooks
- OCA\Encryption\Helper::registerShareHooks();
+ OCA\Files_Encryption\Helper::registerShareHooks();
// Filesystem related hooks
- OCA\Encryption\Helper::registerFilesystemHooks();
+ OCA\Files_Encryption\Helper::registerFilesystemHooks();
// App manager related hooks
- OCA\Encryption\Helper::registerAppHooks();
+ OCA\Files_Encryption\Helper::registerAppHooks();
if(!in_array('crypt', stream_get_wrappers())) {
- stream_wrapper_register('crypt', 'OCA\Encryption\Stream');
+ stream_wrapper_register('crypt', 'OCA\Files_Encryption\Stream');
}
} else {
// logout user if we are in maintenance to force re-login
diff --git a/apps/files_encryption/appinfo/routes.php b/apps/files_encryption/appinfo/routes.php
index 97635ae1236..9733c17fe95 100644
--- a/apps/files_encryption/appinfo/routes.php
+++ b/apps/files_encryption/appinfo/routes.php
@@ -19,4 +19,4 @@ $this->create('files_encryption_ajax_userrecovery', 'ajax/userrecovery.php')
->actionInclude('files_encryption/ajax/userrecovery.php');
// Register with the capabilities API
-OC_API::register('get', '/cloud/capabilities', array('OCA\Encryption\Capabilities', 'getCapabilities'), 'files_encryption', OC_API::USER_AUTH);
+OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Encryption\Capabilities', 'getCapabilities'), 'files_encryption', OC_API::USER_AUTH);
diff --git a/apps/files_encryption/appinfo/update.php b/apps/files_encryption/appinfo/update.php
index a29667ec6b6..957cf746974 100644
--- a/apps/files_encryption/appinfo/update.php
+++ b/apps/files_encryption/appinfo/update.php
@@ -4,7 +4,8 @@ use OCA\Files_Encryption\Migration;
$installedVersion=OCP\Config::getAppValue('files_encryption', 'installed_version');
-if (version_compare($installedVersion, '0.6', '<')) {
+// Migration OC7 -> OC8
+if (version_compare($installedVersion, '0.7', '<')) {
$m = new Migration();
- $m->dropTableEncryption();
+ $m->reorganizeFolderStructure();
}
diff --git a/apps/files_encryption/appinfo/version b/apps/files_encryption/appinfo/version
index ee6cdce3c29..faef31a4357 100644
--- a/apps/files_encryption/appinfo/version
+++ b/apps/files_encryption/appinfo/version
@@ -1 +1 @@
-0.6.1
+0.7.0
diff --git a/apps/files_encryption/exception/encryptionexception.php b/apps/files_encryption/exception/encryptionexception.php
new file mode 100644
index 00000000000..2fb679e91d2
--- /dev/null
+++ b/apps/files_encryption/exception/encryptionexception.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library 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
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Files_Encryption\Exception;
+
+/**
+ * Base class for all encryption exception
+ *
+ * Possible Error Codes:
+ * 10 - generic error
+ * 20 - unexpected end of encryption header
+ * 30 - unexpected blog size
+ * 40 - encryption header to large
+ * 50 - unknown cipher
+ * 60 - encryption failed
+ * 70 - decryption failed
+ * 80 - empty data
+ * 90 - private key missing
+ */
+class EncryptionException extends \Exception {
+ const GENERIC = 10;
+ const UNEXPECTED_END_OF_ENCRYPTION_HEADER = 20;
+ const UNEXPECTED_BLOG_SIZE = 30;
+ const ENCRYPTION_HEADER_TO_LARGE = 40;
+ const UNKNOWN_CIPHER = 50;
+ const ENCRYPTION_FAILED = 60;
+ const DECRYPTION_FAILED = 70;
+ const EMPTY_DATA = 80;
+ const PRIVATE_KEY_MISSING = 90;
+}
diff --git a/apps/files_encryption/lib/exceptions.php b/apps/files_encryption/exception/multikeydecryptexception.php
index 3ea27faf406..9ab10fd3e63 100644
--- a/apps/files_encryption/lib/exceptions.php
+++ b/apps/files_encryption/exception/multikeydecryptexception.php
@@ -2,8 +2,9 @@
/**
* ownCloud
*
- * @author Bjoern Schiessle
- * @copyright 2014 Bjoern Schiessle <schiessle@owncloud.com>
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -20,36 +21,14 @@
*
*/
-namespace OCA\Encryption\Exceptions;
-
-/**
- * General encryption exception
- * Possible Error Codes:
- * 10 - unexpected end of encryption header
- * 20 - unexpected blog size
- * 30 - encryption header to large
- * 40 - unknown cipher
- * 50 - encryption failed
- */
-class EncryptionException extends \Exception {
-}
-
-/**
- * Throw this exception if multi key encrytion fails
- *
- * Possible error codes:
- * 10 - empty plain content was given
- * 20 - openssl_seal failed
- */
-class MultiKeyEncryptException extends EncryptionException {
-}
+namespace OCA\Files_Encryption\Exception;
/**
* Throw this encryption if multi key decryption failed
*
* Possible error codes:
- * 10 - empty encrypted content was given
- * 20 - openssl_open failed
+ * 110 - openssl_open failed
*/
class MultiKeyDecryptException extends EncryptionException {
+ const OPENSSL_OPEN_FAILED = 110;
}
diff --git a/apps/files_encryption/exception/multikeyencryptexception.php b/apps/files_encryption/exception/multikeyencryptexception.php
new file mode 100644
index 00000000000..2dc8216abaa
--- /dev/null
+++ b/apps/files_encryption/exception/multikeyencryptexception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library 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
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Files_Encryption\Exception;
+
+/**
+ * Throw this exception if multi key encrytion fails
+ *
+ * Possible error codes:
+ * 110 - openssl_seal failed
+ */
+class MultiKeyEncryptException extends EncryptionException {
+ const OPENSSL_SEAL_FAILED = 110;
+}
diff --git a/apps/files_encryption/files/error.php b/apps/files_encryption/files/error.php
index b801c17bd40..4a1ed021f7c 100644
--- a/apps/files_encryption/files/error.php
+++ b/apps/files_encryption/files/error.php
@@ -12,14 +12,14 @@ if (!isset($_)) { //also provide standalone error page
if (isset($_GET['errorCode'])) {
$errorCode = $_GET['errorCode'];
switch ($errorCode) {
- case \OCA\Encryption\Crypt::ENCRYPTION_NOT_INITIALIZED_ERROR:
+ case \OCA\Files_Encryption\Crypt::ENCRYPTION_NOT_INITIALIZED_ERROR:
$errorMsg = $l->t('Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app.');
break;
- case \OCA\Encryption\Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR:
+ case \OCA\Files_Encryption\Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR:
$theme = new OC_Defaults();
$errorMsg = $l->t('Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.', array($theme->getName()));
break;
- case \OCA\Encryption\Crypt::ENCRYPTION_NO_SHARE_KEY_FOUND:
+ case \OCA\Files_Encryption\Crypt::ENCRYPTION_NO_SHARE_KEY_FOUND:
$errorMsg = $l->t('Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.');
break;
default:
@@ -27,7 +27,7 @@ if (!isset($_)) { //also provide standalone error page
break;
}
} else {
- $errorCode = \OCA\Encryption\Crypt::ENCRYPTION_UNKNOWN_ERROR;
+ $errorCode = \OCA\Files_Encryption\Crypt::ENCRYPTION_UNKNOWN_ERROR;
$errorMsg = $l->t("Unknown error. Please check your system settings or contact your administrator");
}
diff --git a/apps/files_encryption/js/encryption.js b/apps/files_encryption/js/encryption.js
index 65ffabe55e6..d2d1c3a1fc5 100644
--- a/apps/files_encryption/js/encryption.js
+++ b/apps/files_encryption/js/encryption.js
@@ -5,6 +5,10 @@
* See the COPYING-README file.
*/
+/**
+ * @namespace
+ * @memberOf OC
+ */
OC.Encryption={
MIGRATION_OPEN:0,
MIGRATION_COMPLETED:1,
diff --git a/apps/files_encryption/l10n/ar.js b/apps/files_encryption/l10n/ar.js
index b1af4358241..ce9c2e91fb8 100644
--- a/apps/files_encryption/l10n/ar.js
+++ b/apps/files_encryption/l10n/ar.js
@@ -8,7 +8,6 @@ OC.L10N.register(
"Password successfully changed." : "تم تغيير كلمة المرور بنجاح.",
"Could not change the password. Maybe the old password was not correct." : "تعذر تغيير كلمة المرور. من الممكن ان كلمة المرور القديمة غير صحيحة.",
"Private key password successfully updated." : "تم تحديث كلمة المرور للمفتاح الخاص بنجاح.",
- "Could not update the private key password. Maybe the old password was not correct." : "لا يمكن تحديث كلمة مرور المفتاح الخاص. من الممكن ان كلمة المرور القديمة غير صحيحة.",
"File recovery settings updated" : "اعدادات ملف الاستعادة تم تحديثه",
"Could not update file recovery" : "تعذر تحديث ملف الاستعادة",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "برنامج التشفير لم يتم تهيئتة ! من الممكن ان برنامج التشفير تم اعادة تفعيلة خلال الجلسة. يرجى تسجيل الخروج ومن ثم تسجيل الدخول مجددا لتهيئة برنامج التشفير.",
@@ -16,7 +15,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "لا يمكن فك التشفير من هذا الملف, من الممكن ان يكون هذا الملف مُشارك. يرجى سؤال صاحب الملف لإعادة مشاركتة معك.",
"Unknown error. Please check your system settings or contact your administrator" : "خطأ غير معروف, الرجاء التحقق من إعدادات نظامك أو راسل المدير",
"Missing requirements." : "متطلبات ناقصة.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "يرجى التاكد من ان اصدار PHP 5.3.3 او احدث , مثبت و التاكد من ان OpenSSL مفعل و مهيئ بشكل صحيح. حتى الان برنامج التتشفير تم تعطيلة.",
"Following users are not set up for encryption:" : "المستخدمين التاليين لم يتم تعيين لهم التشفيير:",
"Initial encryption started... This can take some time. Please wait." : "بدأ التشفير... من الممكن ان ياخذ بعض الوقت. يرجى الانتظار.",
"Initial encryption running... Please try again later." : "جاري تفعيل التشفير المبدئي ، الرجاء المحاولة لاحقا",
diff --git a/apps/files_encryption/l10n/ar.json b/apps/files_encryption/l10n/ar.json
index f65d0c7b327..d43201b8cd5 100644
--- a/apps/files_encryption/l10n/ar.json
+++ b/apps/files_encryption/l10n/ar.json
@@ -6,7 +6,6 @@
"Password successfully changed." : "تم تغيير كلمة المرور بنجاح.",
"Could not change the password. Maybe the old password was not correct." : "تعذر تغيير كلمة المرور. من الممكن ان كلمة المرور القديمة غير صحيحة.",
"Private key password successfully updated." : "تم تحديث كلمة المرور للمفتاح الخاص بنجاح.",
- "Could not update the private key password. Maybe the old password was not correct." : "لا يمكن تحديث كلمة مرور المفتاح الخاص. من الممكن ان كلمة المرور القديمة غير صحيحة.",
"File recovery settings updated" : "اعدادات ملف الاستعادة تم تحديثه",
"Could not update file recovery" : "تعذر تحديث ملف الاستعادة",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "برنامج التشفير لم يتم تهيئتة ! من الممكن ان برنامج التشفير تم اعادة تفعيلة خلال الجلسة. يرجى تسجيل الخروج ومن ثم تسجيل الدخول مجددا لتهيئة برنامج التشفير.",
@@ -14,7 +13,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "لا يمكن فك التشفير من هذا الملف, من الممكن ان يكون هذا الملف مُشارك. يرجى سؤال صاحب الملف لإعادة مشاركتة معك.",
"Unknown error. Please check your system settings or contact your administrator" : "خطأ غير معروف, الرجاء التحقق من إعدادات نظامك أو راسل المدير",
"Missing requirements." : "متطلبات ناقصة.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "يرجى التاكد من ان اصدار PHP 5.3.3 او احدث , مثبت و التاكد من ان OpenSSL مفعل و مهيئ بشكل صحيح. حتى الان برنامج التتشفير تم تعطيلة.",
"Following users are not set up for encryption:" : "المستخدمين التاليين لم يتم تعيين لهم التشفيير:",
"Initial encryption started... This can take some time. Please wait." : "بدأ التشفير... من الممكن ان ياخذ بعض الوقت. يرجى الانتظار.",
"Initial encryption running... Please try again later." : "جاري تفعيل التشفير المبدئي ، الرجاء المحاولة لاحقا",
diff --git a/apps/files_encryption/l10n/ast.js b/apps/files_encryption/l10n/ast.js
index 2252f302aaa..c350f3605c2 100644
--- a/apps/files_encryption/l10n/ast.js
+++ b/apps/files_encryption/l10n/ast.js
@@ -8,7 +8,6 @@ OC.L10N.register(
"Password successfully changed." : "Camudóse la contraseña",
"Could not change the password. Maybe the old password was not correct." : "Nun pudo camudase la contraseña. Comprueba que la contraseña actual seya correuta.",
"Private key password successfully updated." : "Contraseña de clave privada anovada correchamente.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nun pudo camudase la contraseña. Pue que la contraseña antigua nun seya correuta.",
"File recovery settings updated" : "Opciones de recuperación de ficheros anovada",
"Could not update file recovery" : "Nun pudo anovase la recuperación de ficheros",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "¡L'aplicación de cifráu nun s'anició! Seique se restableciera mentanto la sesión. Por favor intenta zarrar la sesión y volver a aniciala p'aniciar l'aplicación de cifráu.",
@@ -16,7 +15,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Nun pudo descifrase esti ficheru, dablemente seya un ficheru compartíu. Solicita al propietariu del mesmu que vuelva a compartilu contigo.",
"Unknown error. Please check your system settings or contact your administrator" : "Fallu desconocíu. Por favor, comprueba los axustes del sistema o contauta col alministrador",
"Missing requirements." : "Requisitos incompletos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, asegúrate de que PHP 5.3.3 o postreru ta instaláu y que la estensión OpenSSL de PHP ta habilitada y configurada correutamente. Pel momentu, l'aplicación de cifráu deshabilitóse.",
"Following users are not set up for encryption:" : "Los siguientes usuarios nun se configuraron pal cifráu:",
"Initial encryption started... This can take some time. Please wait." : "Cifráu aniciáu..... Esto pue llevar un tiempu. Por favor espera.",
"Initial encryption running... Please try again later." : "Cifráu inicial en cursu... Inténtalo dempués.",
diff --git a/apps/files_encryption/l10n/ast.json b/apps/files_encryption/l10n/ast.json
index 4c1edefea97..6418e044717 100644
--- a/apps/files_encryption/l10n/ast.json
+++ b/apps/files_encryption/l10n/ast.json
@@ -6,7 +6,6 @@
"Password successfully changed." : "Camudóse la contraseña",
"Could not change the password. Maybe the old password was not correct." : "Nun pudo camudase la contraseña. Comprueba que la contraseña actual seya correuta.",
"Private key password successfully updated." : "Contraseña de clave privada anovada correchamente.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nun pudo camudase la contraseña. Pue que la contraseña antigua nun seya correuta.",
"File recovery settings updated" : "Opciones de recuperación de ficheros anovada",
"Could not update file recovery" : "Nun pudo anovase la recuperación de ficheros",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "¡L'aplicación de cifráu nun s'anició! Seique se restableciera mentanto la sesión. Por favor intenta zarrar la sesión y volver a aniciala p'aniciar l'aplicación de cifráu.",
@@ -14,7 +13,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Nun pudo descifrase esti ficheru, dablemente seya un ficheru compartíu. Solicita al propietariu del mesmu que vuelva a compartilu contigo.",
"Unknown error. Please check your system settings or contact your administrator" : "Fallu desconocíu. Por favor, comprueba los axustes del sistema o contauta col alministrador",
"Missing requirements." : "Requisitos incompletos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, asegúrate de que PHP 5.3.3 o postreru ta instaláu y que la estensión OpenSSL de PHP ta habilitada y configurada correutamente. Pel momentu, l'aplicación de cifráu deshabilitóse.",
"Following users are not set up for encryption:" : "Los siguientes usuarios nun se configuraron pal cifráu:",
"Initial encryption started... This can take some time. Please wait." : "Cifráu aniciáu..... Esto pue llevar un tiempu. Por favor espera.",
"Initial encryption running... Please try again later." : "Cifráu inicial en cursu... Inténtalo dempués.",
diff --git a/apps/files_encryption/l10n/bg_BG.js b/apps/files_encryption/l10n/bg_BG.js
index a117818ba84..258c9d2723e 100644
--- a/apps/files_encryption/l10n/bg_BG.js
+++ b/apps/files_encryption/l10n/bg_BG.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Моля, въведи повторна новата парола за възстановяване",
"Password successfully changed." : "Паролата е успешно променена.",
"Could not change the password. Maybe the old password was not correct." : "Грешка при промяна на паролата. Може би старата ти парола е сгрешена.",
+ "Could not update the private key password." : "Неуспешна промяна на паролата на личния ключ",
+ "The old password was not correct, please try again." : "Старата парола е грешна, опитай отново.",
+ "The current log-in password was not correct, please try again." : "Грешна парола за вписване, опитай отново.",
"Private key password successfully updated." : "Успешно променена тайната парола за ключа.",
- "Could not update the private key password. Maybe the old password was not correct." : "Неуспешна промяна на тайната парола за ключа. Може би старата парола е грешно въведена.",
"File recovery settings updated" : "Настройките за възстановяване на файлове са променени.",
"Could not update file recovery" : "Неуспешна промяна на настройките за възстановяване на файлове.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Неуспешна инициализация на криптиращото приложение! Може би криптиращото приложение бе включено по време на твоята сесия. Отпиши се и се впиши обратно за да инциализираш криптиращото приложение.",
@@ -22,7 +24,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Неуспешно разшифроване на този файл, вероятно това е споделен файл. Моля, поискай собственика на файла да го сподели повторно с теб.",
"Unknown error. Please check your system settings or contact your administrator" : "Непозната грешка. Моля, провери системните настройки или се свържи с администратора.",
"Missing requirements." : "Липсва задължителна информация.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Моля, увери се, че PHP 5.3.3 или по-нова версия е инсталирана, и че OpenSSL заедно съответната PHP добавка са включени и правилно настроени. За сега, криптиращото приложение ще бъде изключено.",
"Following users are not set up for encryption:" : "Следните потребители не са настроени за криптиране:",
"Initial encryption started... This can take some time. Please wait." : "Първоначалното криптиране започна... Това може да отнеме време. Моля изчакай.",
"Initial encryption running... Please try again later." : "Тече първоначално криптиране... Моля опитай по-късно.",
diff --git a/apps/files_encryption/l10n/bg_BG.json b/apps/files_encryption/l10n/bg_BG.json
index 74ac2593091..8a2abbfc5c4 100644
--- a/apps/files_encryption/l10n/bg_BG.json
+++ b/apps/files_encryption/l10n/bg_BG.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Моля, въведи повторна новата парола за възстановяване",
"Password successfully changed." : "Паролата е успешно променена.",
"Could not change the password. Maybe the old password was not correct." : "Грешка при промяна на паролата. Може би старата ти парола е сгрешена.",
+ "Could not update the private key password." : "Неуспешна промяна на паролата на личния ключ",
+ "The old password was not correct, please try again." : "Старата парола е грешна, опитай отново.",
+ "The current log-in password was not correct, please try again." : "Грешна парола за вписване, опитай отново.",
"Private key password successfully updated." : "Успешно променена тайната парола за ключа.",
- "Could not update the private key password. Maybe the old password was not correct." : "Неуспешна промяна на тайната парола за ключа. Може би старата парола е грешно въведена.",
"File recovery settings updated" : "Настройките за възстановяване на файлове са променени.",
"Could not update file recovery" : "Неуспешна промяна на настройките за възстановяване на файлове.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Неуспешна инициализация на криптиращото приложение! Може би криптиращото приложение бе включено по време на твоята сесия. Отпиши се и се впиши обратно за да инциализираш криптиращото приложение.",
@@ -20,7 +22,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Неуспешно разшифроване на този файл, вероятно това е споделен файл. Моля, поискай собственика на файла да го сподели повторно с теб.",
"Unknown error. Please check your system settings or contact your administrator" : "Непозната грешка. Моля, провери системните настройки или се свържи с администратора.",
"Missing requirements." : "Липсва задължителна информация.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Моля, увери се, че PHP 5.3.3 или по-нова версия е инсталирана, и че OpenSSL заедно съответната PHP добавка са включени и правилно настроени. За сега, криптиращото приложение ще бъде изключено.",
"Following users are not set up for encryption:" : "Следните потребители не са настроени за криптиране:",
"Initial encryption started... This can take some time. Please wait." : "Първоначалното криптиране започна... Това може да отнеме време. Моля изчакай.",
"Initial encryption running... Please try again later." : "Тече първоначално криптиране... Моля опитай по-късно.",
diff --git a/apps/files_encryption/l10n/bs.js b/apps/files_encryption/l10n/bs.js
new file mode 100644
index 00000000000..1dc094cc436
--- /dev/null
+++ b/apps/files_encryption/l10n/bs.js
@@ -0,0 +1,10 @@
+OC.L10N.register(
+ "files_encryption",
+ {
+ "Unknown error" : "Nepoznata greška",
+ "Encryption" : "Šifriranje",
+ "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikacija šifriranja je uključena, ali vaši ključevi nisu inicializirani, molim odjavite se i ponovno prijavite",
+ "Enabled" : "Aktivirano",
+ "Disabled" : "Onemogućeno"
+},
+"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);");
diff --git a/apps/files_encryption/l10n/bs.json b/apps/files_encryption/l10n/bs.json
new file mode 100644
index 00000000000..e2085f953cc
--- /dev/null
+++ b/apps/files_encryption/l10n/bs.json
@@ -0,0 +1,8 @@
+{ "translations": {
+ "Unknown error" : "Nepoznata greška",
+ "Encryption" : "Šifriranje",
+ "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikacija šifriranja je uključena, ali vaši ključevi nisu inicializirani, molim odjavite se i ponovno prijavite",
+ "Enabled" : "Aktivirano",
+ "Disabled" : "Onemogućeno"
+},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"
+} \ No newline at end of file
diff --git a/apps/files_encryption/l10n/ca.js b/apps/files_encryption/l10n/ca.js
index e443d384ac2..033792d4233 100644
--- a/apps/files_encryption/l10n/ca.js
+++ b/apps/files_encryption/l10n/ca.js
@@ -8,7 +8,6 @@ OC.L10N.register(
"Password successfully changed." : "La contrasenya s'ha canviat.",
"Could not change the password. Maybe the old password was not correct." : "No s'ha pogut canviar la contrasenya. Potser la contrasenya anterior no era correcta.",
"Private key password successfully updated." : "La contrasenya de la clau privada s'ha actualitzat.",
- "Could not update the private key password. Maybe the old password was not correct." : "No s'ha pogut actualitzar la contrasenya de la clau privada. Potser la contrasenya anterior no era correcta.",
"File recovery settings updated" : "S'han actualitzat els arranjaments de recuperació de fitxers",
"Could not update file recovery" : "No s'ha pogut actualitzar la recuperació de fitxers",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "L'aplicació d'encriptació no està inicialitzada! Potser l'aplicació d'encriptació ha estat reiniciada durant la sessió. Intenteu sortir i acreditar-vos de nou per reinicialitzar l'aplicació d'encriptació.",
@@ -16,7 +15,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "No es pot desencriptar aquest fitxer, probablement és un fitxer compartit. Demaneu al propietari del fitxer que el comparteixi de nou amb vós.",
"Unknown error. Please check your system settings or contact your administrator" : "Error desconegut. Comproveu l'arranjament del sistema o aviseu a l'administrador",
"Missing requirements." : "Manca de requisits.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Assegureu-vos que teniu instal·lat PHP 5.3.3 o una versió superior i que està activat Open SSL i habilitada i configurada correctament l'extensió de PHP. De moment, l'aplicació d'encriptació s'ha desactivat.",
"Following users are not set up for encryption:" : "Els usuaris següents no estan configurats per a l'encriptació:",
"Initial encryption started... This can take some time. Please wait." : "La encriptació inicial ha començat... Pot trigar una estona, espereu.",
"Initial encryption running... Please try again later." : "encriptació inicial en procés... Proveu-ho més tard.",
diff --git a/apps/files_encryption/l10n/ca.json b/apps/files_encryption/l10n/ca.json
index a65fbf9c88e..85130ff900e 100644
--- a/apps/files_encryption/l10n/ca.json
+++ b/apps/files_encryption/l10n/ca.json
@@ -6,7 +6,6 @@
"Password successfully changed." : "La contrasenya s'ha canviat.",
"Could not change the password. Maybe the old password was not correct." : "No s'ha pogut canviar la contrasenya. Potser la contrasenya anterior no era correcta.",
"Private key password successfully updated." : "La contrasenya de la clau privada s'ha actualitzat.",
- "Could not update the private key password. Maybe the old password was not correct." : "No s'ha pogut actualitzar la contrasenya de la clau privada. Potser la contrasenya anterior no era correcta.",
"File recovery settings updated" : "S'han actualitzat els arranjaments de recuperació de fitxers",
"Could not update file recovery" : "No s'ha pogut actualitzar la recuperació de fitxers",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "L'aplicació d'encriptació no està inicialitzada! Potser l'aplicació d'encriptació ha estat reiniciada durant la sessió. Intenteu sortir i acreditar-vos de nou per reinicialitzar l'aplicació d'encriptació.",
@@ -14,7 +13,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "No es pot desencriptar aquest fitxer, probablement és un fitxer compartit. Demaneu al propietari del fitxer que el comparteixi de nou amb vós.",
"Unknown error. Please check your system settings or contact your administrator" : "Error desconegut. Comproveu l'arranjament del sistema o aviseu a l'administrador",
"Missing requirements." : "Manca de requisits.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Assegureu-vos que teniu instal·lat PHP 5.3.3 o una versió superior i que està activat Open SSL i habilitada i configurada correctament l'extensió de PHP. De moment, l'aplicació d'encriptació s'ha desactivat.",
"Following users are not set up for encryption:" : "Els usuaris següents no estan configurats per a l'encriptació:",
"Initial encryption started... This can take some time. Please wait." : "La encriptació inicial ha començat... Pot trigar una estona, espereu.",
"Initial encryption running... Please try again later." : "encriptació inicial en procés... Proveu-ho més tard.",
diff --git a/apps/files_encryption/l10n/cs_CZ.js b/apps/files_encryption/l10n/cs_CZ.js
index 3c3b54e67f3..d25536cfd7b 100644
--- a/apps/files_encryption/l10n/cs_CZ.js
+++ b/apps/files_encryption/l10n/cs_CZ.js
@@ -8,24 +8,26 @@ OC.L10N.register(
"Recovery key successfully enabled" : "Záchranný klíč byl úspěšně povolen",
"Could not disable recovery key. Please check your recovery key password!" : "Nelze zakázat záchranný klíč. Zkontrolujte prosím heslo vašeho záchranného klíče!",
"Recovery key successfully disabled" : "Záchranný klíč byl úspěšně zakázán",
- "Please provide the old recovery password" : "Zapište prosím staré heslo pro obnovu",
- "Please provide a new recovery password" : "Zapište prosím nové heslo pro obnovu",
+ "Please provide the old recovery password" : "Zadejte prosím staré heslo pro obnovu",
+ "Please provide a new recovery password" : "Zadejte prosím nové heslo pro obnovu",
"Please repeat the new recovery password" : "Zopakujte prosím nové heslo pro obnovu",
"Password successfully changed." : "Heslo bylo úspěšně změněno.",
"Could not change the password. Maybe the old password was not correct." : "Změna hesla se nezdařila. Pravděpodobně nebylo stávající heslo zadáno správně.",
+ "Could not update the private key password." : "Nelze aktualizovat heslo soukromého klíče.",
+ "The old password was not correct, please try again." : "Staré heslo nebylo zadáno správně, zkuste to prosím znovu.",
+ "The current log-in password was not correct, please try again." : "Současné přihlašovací heslo nebylo zadáno správně, zkuste to prosím znovu.",
"Private key password successfully updated." : "Heslo soukromého klíče úspěšně aktualizováno.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nelze aktualizovat heslo soukromého klíče. Možná nebylo staré heslo správně.",
"File recovery settings updated" : "Možnosti záchrany souborů aktualizovány",
"Could not update file recovery" : "Nelze nastavit záchranu souborů",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Aplikace pro šifrování není inicializována! Je možné, že aplikace byla znovu aktivována během vašeho přihlášení. Zkuste se prosím odhlásit a znovu přihlásit pro provedení inicializace šifrovací aplikace.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Váš soukromý klíč není platný! Pravděpodobně bylo vaše heslo změněno vně systému %s (např. ve vašem firemním adresáři). Heslo vašeho soukromého klíče můžete změnit ve svém osobním nastavení pro obnovení přístupu k vašim zašifrovaným souborům.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tento soubor se nepodařilo dešifrovat, pravděpodobně je sdílený. Požádejte prosím majitele souboru, aby jej s vámi znovu sdílel.",
"Unknown error. Please check your system settings or contact your administrator" : "Neznámá chyba. Zkontrolujte nastavení systému nebo kontaktujte vašeho správce.",
- "Missing requirements." : "Nesplněné závislosti.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Ujistěte se prosím, že máte nainstalované PHP 5.3.3 nebo novější a že máte povolené a správně nakonfigurované OpenSSL včetně jeho rozšíření pro PHP. Prozatím byla aplikace pro šifrování vypnuta.",
- "Following users are not set up for encryption:" : "Následující uživatelé nemají nastavené šifrování:",
"Initial encryption started... This can take some time. Please wait." : "Počáteční šifrování zahájeno... Toto může chvíli trvat. Počkejte prosím.",
"Initial encryption running... Please try again later." : "Probíhá počáteční šifrování... Zkuste to prosím znovu později.",
+ "Missing requirements." : "Nesplněné závislosti.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Ujistěte se prosím, že máte povolené a správně nakonfigurované OpenSSL včetně jeho rozšíření pro PHP. Aplikace pro šifrování byla prozatím vypnuta.",
+ "Following users are not set up for encryption:" : "Následující uživatelé nemají nastavené šifrování:",
"Go directly to your %spersonal settings%s." : "Přejít přímo do svého %sosobního nastavení%s.",
"Encryption" : "Šifrování",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikace pro šifrování je zapnuta, ale vaše klíče nejsou inicializované. Prosím odhlaste se a znovu přihlaste",
diff --git a/apps/files_encryption/l10n/cs_CZ.json b/apps/files_encryption/l10n/cs_CZ.json
index 5bd5bb54f01..2dad822877d 100644
--- a/apps/files_encryption/l10n/cs_CZ.json
+++ b/apps/files_encryption/l10n/cs_CZ.json
@@ -6,24 +6,26 @@
"Recovery key successfully enabled" : "Záchranný klíč byl úspěšně povolen",
"Could not disable recovery key. Please check your recovery key password!" : "Nelze zakázat záchranný klíč. Zkontrolujte prosím heslo vašeho záchranného klíče!",
"Recovery key successfully disabled" : "Záchranný klíč byl úspěšně zakázán",
- "Please provide the old recovery password" : "Zapište prosím staré heslo pro obnovu",
- "Please provide a new recovery password" : "Zapište prosím nové heslo pro obnovu",
+ "Please provide the old recovery password" : "Zadejte prosím staré heslo pro obnovu",
+ "Please provide a new recovery password" : "Zadejte prosím nové heslo pro obnovu",
"Please repeat the new recovery password" : "Zopakujte prosím nové heslo pro obnovu",
"Password successfully changed." : "Heslo bylo úspěšně změněno.",
"Could not change the password. Maybe the old password was not correct." : "Změna hesla se nezdařila. Pravděpodobně nebylo stávající heslo zadáno správně.",
+ "Could not update the private key password." : "Nelze aktualizovat heslo soukromého klíče.",
+ "The old password was not correct, please try again." : "Staré heslo nebylo zadáno správně, zkuste to prosím znovu.",
+ "The current log-in password was not correct, please try again." : "Současné přihlašovací heslo nebylo zadáno správně, zkuste to prosím znovu.",
"Private key password successfully updated." : "Heslo soukromého klíče úspěšně aktualizováno.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nelze aktualizovat heslo soukromého klíče. Možná nebylo staré heslo správně.",
"File recovery settings updated" : "Možnosti záchrany souborů aktualizovány",
"Could not update file recovery" : "Nelze nastavit záchranu souborů",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Aplikace pro šifrování není inicializována! Je možné, že aplikace byla znovu aktivována během vašeho přihlášení. Zkuste se prosím odhlásit a znovu přihlásit pro provedení inicializace šifrovací aplikace.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Váš soukromý klíč není platný! Pravděpodobně bylo vaše heslo změněno vně systému %s (např. ve vašem firemním adresáři). Heslo vašeho soukromého klíče můžete změnit ve svém osobním nastavení pro obnovení přístupu k vašim zašifrovaným souborům.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tento soubor se nepodařilo dešifrovat, pravděpodobně je sdílený. Požádejte prosím majitele souboru, aby jej s vámi znovu sdílel.",
"Unknown error. Please check your system settings or contact your administrator" : "Neznámá chyba. Zkontrolujte nastavení systému nebo kontaktujte vašeho správce.",
- "Missing requirements." : "Nesplněné závislosti.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Ujistěte se prosím, že máte nainstalované PHP 5.3.3 nebo novější a že máte povolené a správně nakonfigurované OpenSSL včetně jeho rozšíření pro PHP. Prozatím byla aplikace pro šifrování vypnuta.",
- "Following users are not set up for encryption:" : "Následující uživatelé nemají nastavené šifrování:",
"Initial encryption started... This can take some time. Please wait." : "Počáteční šifrování zahájeno... Toto může chvíli trvat. Počkejte prosím.",
"Initial encryption running... Please try again later." : "Probíhá počáteční šifrování... Zkuste to prosím znovu později.",
+ "Missing requirements." : "Nesplněné závislosti.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Ujistěte se prosím, že máte povolené a správně nakonfigurované OpenSSL včetně jeho rozšíření pro PHP. Aplikace pro šifrování byla prozatím vypnuta.",
+ "Following users are not set up for encryption:" : "Následující uživatelé nemají nastavené šifrování:",
"Go directly to your %spersonal settings%s." : "Přejít přímo do svého %sosobního nastavení%s.",
"Encryption" : "Šifrování",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikace pro šifrování je zapnuta, ale vaše klíče nejsou inicializované. Prosím odhlaste se a znovu přihlaste",
diff --git a/apps/files_encryption/l10n/da.js b/apps/files_encryption/l10n/da.js
index 9c12271be0b..93c718357c9 100644
--- a/apps/files_encryption/l10n/da.js
+++ b/apps/files_encryption/l10n/da.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Gentag venligst det nye kodeord til gendannelse",
"Password successfully changed." : "Kodeordet blev ændret succesfuldt",
"Could not change the password. Maybe the old password was not correct." : "Kunne ikke ændre kodeordet. Måske var det gamle kodeord ikke korrekt.",
+ "Could not update the private key password." : "Kunne ikke opdatere kodeordet til den private nøgle.",
+ "The old password was not correct, please try again." : "Det gamle kodeord var ikke korrekt, prøv venligst igen.",
+ "The current log-in password was not correct, please try again." : "Det nuværende kodeord til log-in var ikke korrekt, prøv venligst igen.",
"Private key password successfully updated." : "Privat nøgle kodeord succesfuldt opdateret.",
- "Could not update the private key password. Maybe the old password was not correct." : "Kunne ikke opdatere det private nøgle kodeord-. Måske var det gamle kodeord forkert.",
"File recovery settings updated" : "Filgendannelsesindstillinger opdateret",
"Could not update file recovery" : "Kunne ikke opdatere filgendannelse",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Krypteringsprogrammet er ikke igangsat. Det kan skyldes at krypteringsprogrammet er blevet genaktiveret under din session. Prøv at logge ud og ind igen for at aktivere krypteringsprogrammet. ",
@@ -22,7 +24,7 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan ikke kryptere denne fil, sandsynligvis fordi felen er delt. Bed venligst filens ejer om at dele den med dig på ny.",
"Unknown error. Please check your system settings or contact your administrator" : "Ukendt fejl. Venligst tjek dine systemindstillinger eller kontakt din systemadministrator",
"Missing requirements." : "Manglende betingelser.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Sørg for at PHP 5.3.3 eller nyere er installeret og at OpenSSL sammen med PHP-udvidelsen er aktiveret og korrekt konfigureret. Indtil videre er krypteringsprogrammet deaktiveret.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Sørg for at OpenSSL, sammen med PHP-udvidelsen, er aktiveret og korrekt konfigureret. Indtil videre er krypteringsprogrammet deaktiveret.",
"Following users are not set up for encryption:" : "Følgende brugere er ikke sat op til kryptering:",
"Initial encryption started... This can take some time. Please wait." : "Førstegangskrypteringen er påbegyndt... Dette kan tage nogen tid. Vent venligst.",
"Initial encryption running... Please try again later." : "Kryptering foretages... Prøv venligst igen senere.",
diff --git a/apps/files_encryption/l10n/da.json b/apps/files_encryption/l10n/da.json
index 65a64a95d33..cd77a31993e 100644
--- a/apps/files_encryption/l10n/da.json
+++ b/apps/files_encryption/l10n/da.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Gentag venligst det nye kodeord til gendannelse",
"Password successfully changed." : "Kodeordet blev ændret succesfuldt",
"Could not change the password. Maybe the old password was not correct." : "Kunne ikke ændre kodeordet. Måske var det gamle kodeord ikke korrekt.",
+ "Could not update the private key password." : "Kunne ikke opdatere kodeordet til den private nøgle.",
+ "The old password was not correct, please try again." : "Det gamle kodeord var ikke korrekt, prøv venligst igen.",
+ "The current log-in password was not correct, please try again." : "Det nuværende kodeord til log-in var ikke korrekt, prøv venligst igen.",
"Private key password successfully updated." : "Privat nøgle kodeord succesfuldt opdateret.",
- "Could not update the private key password. Maybe the old password was not correct." : "Kunne ikke opdatere det private nøgle kodeord-. Måske var det gamle kodeord forkert.",
"File recovery settings updated" : "Filgendannelsesindstillinger opdateret",
"Could not update file recovery" : "Kunne ikke opdatere filgendannelse",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Krypteringsprogrammet er ikke igangsat. Det kan skyldes at krypteringsprogrammet er blevet genaktiveret under din session. Prøv at logge ud og ind igen for at aktivere krypteringsprogrammet. ",
@@ -20,7 +22,7 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan ikke kryptere denne fil, sandsynligvis fordi felen er delt. Bed venligst filens ejer om at dele den med dig på ny.",
"Unknown error. Please check your system settings or contact your administrator" : "Ukendt fejl. Venligst tjek dine systemindstillinger eller kontakt din systemadministrator",
"Missing requirements." : "Manglende betingelser.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Sørg for at PHP 5.3.3 eller nyere er installeret og at OpenSSL sammen med PHP-udvidelsen er aktiveret og korrekt konfigureret. Indtil videre er krypteringsprogrammet deaktiveret.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Sørg for at OpenSSL, sammen med PHP-udvidelsen, er aktiveret og korrekt konfigureret. Indtil videre er krypteringsprogrammet deaktiveret.",
"Following users are not set up for encryption:" : "Følgende brugere er ikke sat op til kryptering:",
"Initial encryption started... This can take some time. Please wait." : "Førstegangskrypteringen er påbegyndt... Dette kan tage nogen tid. Vent venligst.",
"Initial encryption running... Please try again later." : "Kryptering foretages... Prøv venligst igen senere.",
diff --git a/apps/files_encryption/l10n/de.js b/apps/files_encryption/l10n/de.js
index 2c680836cb5..9687e081c76 100644
--- a/apps/files_encryption/l10n/de.js
+++ b/apps/files_encryption/l10n/de.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Bitte das neue Passwort zur Wiederherstellung wiederholen",
"Password successfully changed." : "Dein Passwort wurde geändert.",
"Could not change the password. Maybe the old password was not correct." : "Das Passwort konnte nicht geändert werden. Vielleicht war das alte Passwort falsch.",
+ "Could not update the private key password." : "Das Passwort des privaten Schlüssels konnte nicht aktualisiert werden.",
+ "The old password was not correct, please try again." : "Das alte Passwort war nicht korrekt, bitte versuche es noch einmal.",
+ "The current log-in password was not correct, please try again." : "Das aktuelle Anmeldepasswort war nicht korrekt, bitte versuche es noch einmal.",
"Private key password successfully updated." : "Passwort des privaten Schlüssels erfolgreich aktualisiert",
- "Could not update the private key password. Maybe the old password was not correct." : "Das Passwort des privaten Schlüssels konnte nicht aktualisiert werden. Eventuell war das alte Passwort falsch.",
"File recovery settings updated" : "Einstellungen zur Wiederherstellung von Dateien wurden aktualisiert",
"Could not update file recovery" : "Dateiwiederherstellung konnte nicht aktualisiert werden",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Verschlüsselung-App ist nicht initialisiert! Vielleicht wurde die Verschlüsselung-App in der aktuellen Sitzung reaktiviert. Bitte versuche Dich ab- und wieder anzumelden, um die Verschlüsselung-App zu initialisieren.",
@@ -22,7 +24,7 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Die Datei kann nicht entschlüsselt werden, da die Datei möglicherweise eine geteilte Datei ist. Bitte frage den Dateibesitzer, ob er die Datei nochmals mit Dir teilt.",
"Unknown error. Please check your system settings or contact your administrator" : "Unbekannter Fehler. Bitte prüfe Deine Systemeinstellungen oder kontaktiere Deinen Administrator",
"Missing requirements." : "Fehlende Vorraussetzungen",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Bitte stelle sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Bitte stelle sicher, dass OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Die Verschlüsselungsanwendung ist vorerst deaktiviert.",
"Following users are not set up for encryption:" : "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:",
"Initial encryption started... This can take some time. Please wait." : "Initialverschlüsselung gestartet... Dies kann einige Zeit dauern. Bitte warten.",
"Initial encryption running... Please try again later." : "Anfangsverschlüsselung läuft … Bitte versuche es später wieder.",
diff --git a/apps/files_encryption/l10n/de.json b/apps/files_encryption/l10n/de.json
index ce5b6e81af1..5fc3fb822fd 100644
--- a/apps/files_encryption/l10n/de.json
+++ b/apps/files_encryption/l10n/de.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Bitte das neue Passwort zur Wiederherstellung wiederholen",
"Password successfully changed." : "Dein Passwort wurde geändert.",
"Could not change the password. Maybe the old password was not correct." : "Das Passwort konnte nicht geändert werden. Vielleicht war das alte Passwort falsch.",
+ "Could not update the private key password." : "Das Passwort des privaten Schlüssels konnte nicht aktualisiert werden.",
+ "The old password was not correct, please try again." : "Das alte Passwort war nicht korrekt, bitte versuche es noch einmal.",
+ "The current log-in password was not correct, please try again." : "Das aktuelle Anmeldepasswort war nicht korrekt, bitte versuche es noch einmal.",
"Private key password successfully updated." : "Passwort des privaten Schlüssels erfolgreich aktualisiert",
- "Could not update the private key password. Maybe the old password was not correct." : "Das Passwort des privaten Schlüssels konnte nicht aktualisiert werden. Eventuell war das alte Passwort falsch.",
"File recovery settings updated" : "Einstellungen zur Wiederherstellung von Dateien wurden aktualisiert",
"Could not update file recovery" : "Dateiwiederherstellung konnte nicht aktualisiert werden",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Verschlüsselung-App ist nicht initialisiert! Vielleicht wurde die Verschlüsselung-App in der aktuellen Sitzung reaktiviert. Bitte versuche Dich ab- und wieder anzumelden, um die Verschlüsselung-App zu initialisieren.",
@@ -20,7 +22,7 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Die Datei kann nicht entschlüsselt werden, da die Datei möglicherweise eine geteilte Datei ist. Bitte frage den Dateibesitzer, ob er die Datei nochmals mit Dir teilt.",
"Unknown error. Please check your system settings or contact your administrator" : "Unbekannter Fehler. Bitte prüfe Deine Systemeinstellungen oder kontaktiere Deinen Administrator",
"Missing requirements." : "Fehlende Vorraussetzungen",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Bitte stelle sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Bitte stelle sicher, dass OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Die Verschlüsselungsanwendung ist vorerst deaktiviert.",
"Following users are not set up for encryption:" : "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:",
"Initial encryption started... This can take some time. Please wait." : "Initialverschlüsselung gestartet... Dies kann einige Zeit dauern. Bitte warten.",
"Initial encryption running... Please try again later." : "Anfangsverschlüsselung läuft … Bitte versuche es später wieder.",
diff --git a/apps/files_encryption/l10n/de_DE.js b/apps/files_encryption/l10n/de_DE.js
index f24b4a74358..01420b52e8d 100644
--- a/apps/files_encryption/l10n/de_DE.js
+++ b/apps/files_encryption/l10n/de_DE.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Bitte das neue Passwort zur Wiederherstellung wiederholen",
"Password successfully changed." : "Das Passwort wurde erfolgreich geändert.",
"Could not change the password. Maybe the old password was not correct." : "Das Passwort konnte nicht geändert werden. Vielleicht war das alte Passwort nicht richtig.",
+ "Could not update the private key password." : "Das Passwort des privaten Schlüssels konnte nicht aktualisiert werden.",
+ "The old password was not correct, please try again." : "Das alte Passwort war nicht korrekt, bitte versuchen Sie es noch einmal.",
+ "The current log-in password was not correct, please try again." : "Das aktuelle Anmeldepasswort war nicht korrekt, bitte versuchen Sie es noch einmal.",
"Private key password successfully updated." : "Das Passwort des privaten Schlüssels wurde erfolgreich aktualisiert.",
- "Could not update the private key password. Maybe the old password was not correct." : "Das Passwort des privaten Schlüssels konnte nicht aktualisiert werden. Vielleicht war das alte Passwort nicht richtig.",
"File recovery settings updated" : "Die Einstellungen für die Dateiwiederherstellung wurden aktualisiert.",
"Could not update file recovery" : "Die Dateiwiederherstellung konnte nicht aktualisiert werden.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Verschlüsselung-App ist nicht initialisiert! Vielleicht wurde die Verschlüsselung-App in der aktuellen Sitzung reaktiviert. Bitte versuchen Sie sich ab- und wieder anzumelden, um die Verschlüsselung-App zu initialisieren.",
@@ -22,7 +24,7 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Die Datei kann nicht entschlüsselt werden, da die Datei möglicherweise eine geteilte Datei ist. Bitte fragen Sie den Dateibesitzer, dass er die Datei nochmals mit Ihnen teilt.",
"Unknown error. Please check your system settings or contact your administrator" : "Unbekannter Fehler. Bitte prüfen Sie die Systemeinstellungen oder kontaktieren Sie Ihren Administrator",
"Missing requirements." : "Fehlende Voraussetzungen",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Bitte stellen Sie sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Bitte stellen Sie sicher, dass OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Die Verschlüsselungsanwendung ist vorerst deaktiviert.",
"Following users are not set up for encryption:" : "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:",
"Initial encryption started... This can take some time. Please wait." : "Anfangsverschlüsselung gestartet … Dieses kann einige Zeit dauern. Bitte warten.",
"Initial encryption running... Please try again later." : "Anfangsverschlüsselung läuft … Bitte versuchen Sie es später wieder.",
diff --git a/apps/files_encryption/l10n/de_DE.json b/apps/files_encryption/l10n/de_DE.json
index 0bbba2a50df..9105dc1e4c3 100644
--- a/apps/files_encryption/l10n/de_DE.json
+++ b/apps/files_encryption/l10n/de_DE.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Bitte das neue Passwort zur Wiederherstellung wiederholen",
"Password successfully changed." : "Das Passwort wurde erfolgreich geändert.",
"Could not change the password. Maybe the old password was not correct." : "Das Passwort konnte nicht geändert werden. Vielleicht war das alte Passwort nicht richtig.",
+ "Could not update the private key password." : "Das Passwort des privaten Schlüssels konnte nicht aktualisiert werden.",
+ "The old password was not correct, please try again." : "Das alte Passwort war nicht korrekt, bitte versuchen Sie es noch einmal.",
+ "The current log-in password was not correct, please try again." : "Das aktuelle Anmeldepasswort war nicht korrekt, bitte versuchen Sie es noch einmal.",
"Private key password successfully updated." : "Das Passwort des privaten Schlüssels wurde erfolgreich aktualisiert.",
- "Could not update the private key password. Maybe the old password was not correct." : "Das Passwort des privaten Schlüssels konnte nicht aktualisiert werden. Vielleicht war das alte Passwort nicht richtig.",
"File recovery settings updated" : "Die Einstellungen für die Dateiwiederherstellung wurden aktualisiert.",
"Could not update file recovery" : "Die Dateiwiederherstellung konnte nicht aktualisiert werden.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Verschlüsselung-App ist nicht initialisiert! Vielleicht wurde die Verschlüsselung-App in der aktuellen Sitzung reaktiviert. Bitte versuchen Sie sich ab- und wieder anzumelden, um die Verschlüsselung-App zu initialisieren.",
@@ -20,7 +22,7 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Die Datei kann nicht entschlüsselt werden, da die Datei möglicherweise eine geteilte Datei ist. Bitte fragen Sie den Dateibesitzer, dass er die Datei nochmals mit Ihnen teilt.",
"Unknown error. Please check your system settings or contact your administrator" : "Unbekannter Fehler. Bitte prüfen Sie die Systemeinstellungen oder kontaktieren Sie Ihren Administrator",
"Missing requirements." : "Fehlende Voraussetzungen",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Bitte stellen Sie sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Bitte stellen Sie sicher, dass OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Die Verschlüsselungsanwendung ist vorerst deaktiviert.",
"Following users are not set up for encryption:" : "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:",
"Initial encryption started... This can take some time. Please wait." : "Anfangsverschlüsselung gestartet … Dieses kann einige Zeit dauern. Bitte warten.",
"Initial encryption running... Please try again later." : "Anfangsverschlüsselung läuft … Bitte versuchen Sie es später wieder.",
diff --git a/apps/files_encryption/l10n/el.js b/apps/files_encryption/l10n/el.js
index a39a0c867f3..bb12d05f049 100644
--- a/apps/files_encryption/l10n/el.js
+++ b/apps/files_encryption/l10n/el.js
@@ -13,19 +13,19 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Παρακαλώ επαναλάβετε το νέο κωδικό επαναφοράς",
"Password successfully changed." : "Ο κωδικός αλλάχτηκε επιτυχώς.",
"Could not change the password. Maybe the old password was not correct." : "Αποτυχία αλλαγής κωδικού ίσως ο παλιός κωδικός να μην ήταν σωστός.",
+ "The old password was not correct, please try again." : "Το παλαιό συνθηματικό δεν είναι σωστό, παρακαλώ δοκιμάστε ξανά.",
+ "The current log-in password was not correct, please try again." : "Το τρέχον συνθηματικό δεν είναι σωστό, παρακαλώ δοκιμάστε ξανά.",
"Private key password successfully updated." : "Το Προσωπικό κλειδί πρόσβασης ενημερώθηκε επιτυχώς",
- "Could not update the private key password. Maybe the old password was not correct." : "Αποτυχία ενημέρωσης του κωδικού για το προσωπικό κλειδί. Ενδεχομένως ο παλιός κωδικός δεν ήταν σωστός.",
"File recovery settings updated" : "Οι ρυθμίσεις επαναφοράς αρχείων ανανεώθηκαν",
"Could not update file recovery" : "Αποτυχία ενημέρωσης ανάκτησης αρχείων",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Η εφαρμογή κρυπτογράφησης δεν έχει εκκινήσει! Ίσως η εφαρμογή κρυπτογράφησης επανενεργοποιήθηκε κατά τη διάρκεια της τρέχουσας σύνδεσής σας. Παρακαλώ προσπαθήστε να αποσυνδεθείτε και να ξανασυνδεθείτε για να εκκινήσετε την εφαρμογή κρυπτογράφησης.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Το προσωπικό σας κλειδί δεν είναι έγκυρο! Πιθανόν ο κωδικός σας να άλλαξε έξω από το %s (π.χ. τη λίστα διευθύνσεων της εταιρείας σας). Μπορείτε να ενημερώσετε το προσωπικό σας κλειδί επαναφοράς κωδικού στις προσωπικές σας ρυθμίσεις για να επανακτήσετε πρόσβαση στα κρυπτογραφημένα σας αρχεία.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Δεν ήταν δυνατό να αποκρυπτογραφηθεί αυτό το αρχείο, πιθανόν πρόκειται για κοινόχρηστο αρχείο. Παρακαλώ ζητήστε από τον ιδιοκτήτη του αρχείου να το ξαναμοιραστεί μαζί σας.",
"Unknown error. Please check your system settings or contact your administrator" : "Άγνωστο σφάλμα. Παρακαλώ ελέγξτε τις ρυθμίσεις του συστήματό σας ή επικοινωνήστε με τον διαχειριστή συστημάτων σας",
- "Missing requirements." : "Προαπαιτούμενα που απουσιάζουν.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Παρακαλώ επιβεβαιώστε ότι η PHP 5.3.3 ή νεότερη είναι εγκατεστημένη και ότι το OpenSSL μαζί με το PHP extension είναι ενεργοποιήμένο και έχει ρυθμιστεί σωστά. Προς το παρόν, η εφαρμογή κρυπτογράφησης είναι απενεργοποιημένη.",
- "Following users are not set up for encryption:" : "Οι κάτωθι χρήστες δεν έχουν ρυθμιστεί για κρυπογράφηση:",
"Initial encryption started... This can take some time. Please wait." : "Η αρχική κρυπτογράφηση άρχισε... Αυτό μπορεί να πάρει κάποια ώρα. Παρακαλώ περιμένετε.",
"Initial encryption running... Please try again later." : "Εκτέλεση αρχικής κρυπτογράφησης... Παρακαλώ προσπαθήστε αργότερα.",
+ "Missing requirements." : "Προαπαιτούμενα που απουσιάζουν.",
+ "Following users are not set up for encryption:" : "Οι κάτωθι χρήστες δεν έχουν ρυθμιστεί για κρυπογράφηση:",
"Go directly to your %spersonal settings%s." : "Πηγαίνετε κατ'ευθείαν στις %sπροσωπικές ρυθμίσεις%s σας.",
"Encryption" : "Κρυπτογράφηση",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Η εφαρμογή κρυπτογράφησης είναι ενεργοποιημένη αλλά τα κλειδιά σας δεν έχουν καταγραφεί, παρακαλώ αποσυνδεθείτε και επανασυνδεθείτε.",
diff --git a/apps/files_encryption/l10n/el.json b/apps/files_encryption/l10n/el.json
index 0ebf52e3f88..18cf819643b 100644
--- a/apps/files_encryption/l10n/el.json
+++ b/apps/files_encryption/l10n/el.json
@@ -11,19 +11,19 @@
"Please repeat the new recovery password" : "Παρακαλώ επαναλάβετε το νέο κωδικό επαναφοράς",
"Password successfully changed." : "Ο κωδικός αλλάχτηκε επιτυχώς.",
"Could not change the password. Maybe the old password was not correct." : "Αποτυχία αλλαγής κωδικού ίσως ο παλιός κωδικός να μην ήταν σωστός.",
+ "The old password was not correct, please try again." : "Το παλαιό συνθηματικό δεν είναι σωστό, παρακαλώ δοκιμάστε ξανά.",
+ "The current log-in password was not correct, please try again." : "Το τρέχον συνθηματικό δεν είναι σωστό, παρακαλώ δοκιμάστε ξανά.",
"Private key password successfully updated." : "Το Προσωπικό κλειδί πρόσβασης ενημερώθηκε επιτυχώς",
- "Could not update the private key password. Maybe the old password was not correct." : "Αποτυχία ενημέρωσης του κωδικού για το προσωπικό κλειδί. Ενδεχομένως ο παλιός κωδικός δεν ήταν σωστός.",
"File recovery settings updated" : "Οι ρυθμίσεις επαναφοράς αρχείων ανανεώθηκαν",
"Could not update file recovery" : "Αποτυχία ενημέρωσης ανάκτησης αρχείων",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Η εφαρμογή κρυπτογράφησης δεν έχει εκκινήσει! Ίσως η εφαρμογή κρυπτογράφησης επανενεργοποιήθηκε κατά τη διάρκεια της τρέχουσας σύνδεσής σας. Παρακαλώ προσπαθήστε να αποσυνδεθείτε και να ξανασυνδεθείτε για να εκκινήσετε την εφαρμογή κρυπτογράφησης.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Το προσωπικό σας κλειδί δεν είναι έγκυρο! Πιθανόν ο κωδικός σας να άλλαξε έξω από το %s (π.χ. τη λίστα διευθύνσεων της εταιρείας σας). Μπορείτε να ενημερώσετε το προσωπικό σας κλειδί επαναφοράς κωδικού στις προσωπικές σας ρυθμίσεις για να επανακτήσετε πρόσβαση στα κρυπτογραφημένα σας αρχεία.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Δεν ήταν δυνατό να αποκρυπτογραφηθεί αυτό το αρχείο, πιθανόν πρόκειται για κοινόχρηστο αρχείο. Παρακαλώ ζητήστε από τον ιδιοκτήτη του αρχείου να το ξαναμοιραστεί μαζί σας.",
"Unknown error. Please check your system settings or contact your administrator" : "Άγνωστο σφάλμα. Παρακαλώ ελέγξτε τις ρυθμίσεις του συστήματό σας ή επικοινωνήστε με τον διαχειριστή συστημάτων σας",
- "Missing requirements." : "Προαπαιτούμενα που απουσιάζουν.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Παρακαλώ επιβεβαιώστε ότι η PHP 5.3.3 ή νεότερη είναι εγκατεστημένη και ότι το OpenSSL μαζί με το PHP extension είναι ενεργοποιήμένο και έχει ρυθμιστεί σωστά. Προς το παρόν, η εφαρμογή κρυπτογράφησης είναι απενεργοποιημένη.",
- "Following users are not set up for encryption:" : "Οι κάτωθι χρήστες δεν έχουν ρυθμιστεί για κρυπογράφηση:",
"Initial encryption started... This can take some time. Please wait." : "Η αρχική κρυπτογράφηση άρχισε... Αυτό μπορεί να πάρει κάποια ώρα. Παρακαλώ περιμένετε.",
"Initial encryption running... Please try again later." : "Εκτέλεση αρχικής κρυπτογράφησης... Παρακαλώ προσπαθήστε αργότερα.",
+ "Missing requirements." : "Προαπαιτούμενα που απουσιάζουν.",
+ "Following users are not set up for encryption:" : "Οι κάτωθι χρήστες δεν έχουν ρυθμιστεί για κρυπογράφηση:",
"Go directly to your %spersonal settings%s." : "Πηγαίνετε κατ'ευθείαν στις %sπροσωπικές ρυθμίσεις%s σας.",
"Encryption" : "Κρυπτογράφηση",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Η εφαρμογή κρυπτογράφησης είναι ενεργοποιημένη αλλά τα κλειδιά σας δεν έχουν καταγραφεί, παρακαλώ αποσυνδεθείτε και επανασυνδεθείτε.",
diff --git a/apps/files_encryption/l10n/en_GB.js b/apps/files_encryption/l10n/en_GB.js
index 126d901b24f..1e5e07d450d 100644
--- a/apps/files_encryption/l10n/en_GB.js
+++ b/apps/files_encryption/l10n/en_GB.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Please repeat the new recovery password",
"Password successfully changed." : "Password changed successfully.",
"Could not change the password. Maybe the old password was not correct." : "Could not change the password. Maybe the old password was incorrect.",
+ "Could not update the private key password." : "Could not update the private key password.",
+ "The old password was not correct, please try again." : "The old password was not correct, please try again.",
+ "The current log-in password was not correct, please try again." : "The current log-in password was not correct, please try again.",
"Private key password successfully updated." : "Private key password updated successfully.",
- "Could not update the private key password. Maybe the old password was not correct." : "Could not update the private key password. Maybe the old password was not correct.",
"File recovery settings updated" : "File recovery settings updated",
"Could not update file recovery" : "Could not update file recovery",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Encryption app not initialised! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialise the encryption app.",
@@ -22,7 +24,7 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Cannot decrypt this file, which is probably a shared file. Please ask the file owner to reshare the file with you.",
"Unknown error. Please check your system settings or contact your administrator" : "Unknown error. Please check your system settings or contact your administrator",
"Missing requirements." : "Missing requirements.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Please make sure that OpenSSL together with the PHP extension is enabled and properly configured. For now, the encryption app has been disabled.",
"Following users are not set up for encryption:" : "Following users are not set up for encryption:",
"Initial encryption started... This can take some time. Please wait." : "Initial encryption started... This can take some time. Please wait.",
"Initial encryption running... Please try again later." : "Initial encryption running... Please try again later.",
diff --git a/apps/files_encryption/l10n/en_GB.json b/apps/files_encryption/l10n/en_GB.json
index e81b4088055..68478b60d68 100644
--- a/apps/files_encryption/l10n/en_GB.json
+++ b/apps/files_encryption/l10n/en_GB.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Please repeat the new recovery password",
"Password successfully changed." : "Password changed successfully.",
"Could not change the password. Maybe the old password was not correct." : "Could not change the password. Maybe the old password was incorrect.",
+ "Could not update the private key password." : "Could not update the private key password.",
+ "The old password was not correct, please try again." : "The old password was not correct, please try again.",
+ "The current log-in password was not correct, please try again." : "The current log-in password was not correct, please try again.",
"Private key password successfully updated." : "Private key password updated successfully.",
- "Could not update the private key password. Maybe the old password was not correct." : "Could not update the private key password. Maybe the old password was not correct.",
"File recovery settings updated" : "File recovery settings updated",
"Could not update file recovery" : "Could not update file recovery",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Encryption app not initialised! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialise the encryption app.",
@@ -20,7 +22,7 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Cannot decrypt this file, which is probably a shared file. Please ask the file owner to reshare the file with you.",
"Unknown error. Please check your system settings or contact your administrator" : "Unknown error. Please check your system settings or contact your administrator",
"Missing requirements." : "Missing requirements.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Please make sure that OpenSSL together with the PHP extension is enabled and properly configured. For now, the encryption app has been disabled.",
"Following users are not set up for encryption:" : "Following users are not set up for encryption:",
"Initial encryption started... This can take some time. Please wait." : "Initial encryption started... This can take some time. Please wait.",
"Initial encryption running... Please try again later." : "Initial encryption running... Please try again later.",
diff --git a/apps/files_encryption/l10n/es.js b/apps/files_encryption/l10n/es.js
index 8101c9f4663..38433330ce0 100644
--- a/apps/files_encryption/l10n/es.js
+++ b/apps/files_encryption/l10n/es.js
@@ -2,33 +2,35 @@ OC.L10N.register(
"files_encryption",
{
"Unknown error" : "Error desconocido",
- "Missing recovery key password" : "Falta contraseña de recuperacion.",
- "Please repeat the recovery key password" : "Por favor repita la contraseña de recuperacion",
- "Repeated recovery key password does not match the provided recovery key password" : "la contraseña de recuperacion repetida no es igual a la contraseña de recuperacion",
+ "Missing recovery key password" : "Falta contraseña de recuperación.",
+ "Please repeat the recovery key password" : "Por favor, repita la contraseña de recuperación",
+ "Repeated recovery key password does not match the provided recovery key password" : "La contraseña de recuperación reintroducida no coincide con la contraseña de recuperación proporcionada.",
"Recovery key successfully enabled" : "Se ha habilitado la recuperación de archivos",
"Could not disable recovery key. Please check your recovery key password!" : "No se pudo deshabilitar la clave de recuperación. Por favor compruebe su contraseña!",
"Recovery key successfully disabled" : "Clave de recuperación deshabilitada",
- "Please provide the old recovery password" : "Por favor ingrese su antigua contraseña de recuperacion",
- "Please provide a new recovery password" : "Por favor ingrese una nueva contraseña de recuperacion",
+ "Please provide the old recovery password" : "Por favor, ingrese su antigua contraseña de recuperación",
+ "Please provide a new recovery password" : "Por favor, ingrese una nueva contraseña de recuperación",
"Please repeat the new recovery password" : "Por favor repita su nueva contraseña de recuperacion",
"Password successfully changed." : "Su contraseña ha sido cambiada",
"Could not change the password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Compruebe que la contraseña actual sea correcta.",
+ "Could not update the private key password." : "No se pudo actualizar la contraseña de clave privada.",
+ "The old password was not correct, please try again." : "La antigua contraseña no es correcta, por favor intente de nuevo.",
+ "The current log-in password was not correct, please try again." : "La contraseña de inicio de sesión actual no es correcto, por favor intente de nuevo.",
"Private key password successfully updated." : "Contraseña de clave privada actualizada con éxito.",
- "Could not update the private key password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Puede que la contraseña antigua no sea correcta.",
"File recovery settings updated" : "Opciones de recuperación de archivos actualizada",
"Could not update file recovery" : "No se pudo actualizar la recuperación de archivos",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "¡La aplicación de cifrado no ha sido inicializada! Quizá fue restablecida durante tu sesión. Por favor intenta cerrar la sesión y volver a iniciarla para inicializar la aplicación de cifrado.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "¡Su clave privada no es válida! Tal vez su contraseña ha sido cambiada desde fuera. de %s (Ej:Su directorio corporativo). Puede actualizar la contraseña de su clave privada en sus opciones personales para recuperar el acceso a sus archivos.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "No fue posible descifrar este archivo, probablemente se trate de un archivo compartido. Solicite al propietario del mismo que vuelva a compartirlo con usted.",
"Unknown error. Please check your system settings or contact your administrator" : "Error desconocido. Revise la configuración de su sistema o contacte a su administrador",
- "Missing requirements." : "Requisitos incompletos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, asegúrese de que PHP 5.3.3 o posterior está instalado y que la extensión OpenSSL de PHP está habilitada y configurada correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.",
- "Following users are not set up for encryption:" : "Los siguientes usuarios no han sido configurados para el cifrado:",
"Initial encryption started... This can take some time. Please wait." : "Encriptación iniciada..... Esto puede tomar un tiempo. Por favor espere.",
"Initial encryption running... Please try again later." : "Cifrado inicial en curso... Inténtelo más tarde.",
+ "Missing requirements." : "Requisitos incompletos.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Asegúrese de que OpenSSL y la extensión de PHP estén habilitados y configurados correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.",
+ "Following users are not set up for encryption:" : "Los siguientes usuarios no han sido configurados para el cifrado:",
"Go directly to your %spersonal settings%s." : "Ir directamente a %sOpciones%s.",
"Encryption" : "Cifrado",
- "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "La app de crifrado está habilitada pero tus claves no han sido inicializadas, por favor, cierra la sesión y vuelva a iniciarla de nuevo.",
+ "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "La app de crifrado está habilitada pero sus claves no han sido inicializadas, por favor, cierre la sesión y vuelva a iniciarla de nuevo.",
"Enable recovery key (allow to recover users files in case of password loss):" : "Habilitar la clave de recuperación (permite recuperar los ficheros del usuario en caso de pérdida de la contraseña);",
"Recovery key password" : "Contraseña de clave de recuperación",
"Repeat Recovery key password" : "Repite la contraseña de clave de recuperación",
@@ -39,7 +41,7 @@ OC.L10N.register(
"New Recovery key password" : "Nueva clave de recuperación",
"Repeat New Recovery key password" : "Repetir la nueva clave de recuperación",
"Change Password" : "Cambiar contraseña",
- "Your private key password no longer matches your log-in password." : "Tu contraseña de clave privada ya no concuerda con tu contraseña de inicio.",
+ "Your private key password no longer matches your log-in password." : "Su contraseña de clave privada ya no coincide con su contraseña de acceso.",
"Set your old private key password to your current log-in password:" : "Establezca la contraseña de clave privada antigua para su contraseña de inicio de sesión actual:",
" If you don't remember your old password you can ask your administrator to recover your files." : "Si no recuerda su antigua contraseña puede pedir a su administrador que le recupere sus ficheros.",
"Old log-in password" : "Contraseña de acceso antigua",
diff --git a/apps/files_encryption/l10n/es.json b/apps/files_encryption/l10n/es.json
index 16cdc6b40a0..001b981978f 100644
--- a/apps/files_encryption/l10n/es.json
+++ b/apps/files_encryption/l10n/es.json
@@ -1,32 +1,34 @@
{ "translations": {
"Unknown error" : "Error desconocido",
- "Missing recovery key password" : "Falta contraseña de recuperacion.",
- "Please repeat the recovery key password" : "Por favor repita la contraseña de recuperacion",
- "Repeated recovery key password does not match the provided recovery key password" : "la contraseña de recuperacion repetida no es igual a la contraseña de recuperacion",
+ "Missing recovery key password" : "Falta contraseña de recuperación.",
+ "Please repeat the recovery key password" : "Por favor, repita la contraseña de recuperación",
+ "Repeated recovery key password does not match the provided recovery key password" : "La contraseña de recuperación reintroducida no coincide con la contraseña de recuperación proporcionada.",
"Recovery key successfully enabled" : "Se ha habilitado la recuperación de archivos",
"Could not disable recovery key. Please check your recovery key password!" : "No se pudo deshabilitar la clave de recuperación. Por favor compruebe su contraseña!",
"Recovery key successfully disabled" : "Clave de recuperación deshabilitada",
- "Please provide the old recovery password" : "Por favor ingrese su antigua contraseña de recuperacion",
- "Please provide a new recovery password" : "Por favor ingrese una nueva contraseña de recuperacion",
+ "Please provide the old recovery password" : "Por favor, ingrese su antigua contraseña de recuperación",
+ "Please provide a new recovery password" : "Por favor, ingrese una nueva contraseña de recuperación",
"Please repeat the new recovery password" : "Por favor repita su nueva contraseña de recuperacion",
"Password successfully changed." : "Su contraseña ha sido cambiada",
"Could not change the password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Compruebe que la contraseña actual sea correcta.",
+ "Could not update the private key password." : "No se pudo actualizar la contraseña de clave privada.",
+ "The old password was not correct, please try again." : "La antigua contraseña no es correcta, por favor intente de nuevo.",
+ "The current log-in password was not correct, please try again." : "La contraseña de inicio de sesión actual no es correcto, por favor intente de nuevo.",
"Private key password successfully updated." : "Contraseña de clave privada actualizada con éxito.",
- "Could not update the private key password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Puede que la contraseña antigua no sea correcta.",
"File recovery settings updated" : "Opciones de recuperación de archivos actualizada",
"Could not update file recovery" : "No se pudo actualizar la recuperación de archivos",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "¡La aplicación de cifrado no ha sido inicializada! Quizá fue restablecida durante tu sesión. Por favor intenta cerrar la sesión y volver a iniciarla para inicializar la aplicación de cifrado.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "¡Su clave privada no es válida! Tal vez su contraseña ha sido cambiada desde fuera. de %s (Ej:Su directorio corporativo). Puede actualizar la contraseña de su clave privada en sus opciones personales para recuperar el acceso a sus archivos.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "No fue posible descifrar este archivo, probablemente se trate de un archivo compartido. Solicite al propietario del mismo que vuelva a compartirlo con usted.",
"Unknown error. Please check your system settings or contact your administrator" : "Error desconocido. Revise la configuración de su sistema o contacte a su administrador",
- "Missing requirements." : "Requisitos incompletos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, asegúrese de que PHP 5.3.3 o posterior está instalado y que la extensión OpenSSL de PHP está habilitada y configurada correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.",
- "Following users are not set up for encryption:" : "Los siguientes usuarios no han sido configurados para el cifrado:",
"Initial encryption started... This can take some time. Please wait." : "Encriptación iniciada..... Esto puede tomar un tiempo. Por favor espere.",
"Initial encryption running... Please try again later." : "Cifrado inicial en curso... Inténtelo más tarde.",
+ "Missing requirements." : "Requisitos incompletos.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Asegúrese de que OpenSSL y la extensión de PHP estén habilitados y configurados correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.",
+ "Following users are not set up for encryption:" : "Los siguientes usuarios no han sido configurados para el cifrado:",
"Go directly to your %spersonal settings%s." : "Ir directamente a %sOpciones%s.",
"Encryption" : "Cifrado",
- "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "La app de crifrado está habilitada pero tus claves no han sido inicializadas, por favor, cierra la sesión y vuelva a iniciarla de nuevo.",
+ "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "La app de crifrado está habilitada pero sus claves no han sido inicializadas, por favor, cierre la sesión y vuelva a iniciarla de nuevo.",
"Enable recovery key (allow to recover users files in case of password loss):" : "Habilitar la clave de recuperación (permite recuperar los ficheros del usuario en caso de pérdida de la contraseña);",
"Recovery key password" : "Contraseña de clave de recuperación",
"Repeat Recovery key password" : "Repite la contraseña de clave de recuperación",
@@ -37,7 +39,7 @@
"New Recovery key password" : "Nueva clave de recuperación",
"Repeat New Recovery key password" : "Repetir la nueva clave de recuperación",
"Change Password" : "Cambiar contraseña",
- "Your private key password no longer matches your log-in password." : "Tu contraseña de clave privada ya no concuerda con tu contraseña de inicio.",
+ "Your private key password no longer matches your log-in password." : "Su contraseña de clave privada ya no coincide con su contraseña de acceso.",
"Set your old private key password to your current log-in password:" : "Establezca la contraseña de clave privada antigua para su contraseña de inicio de sesión actual:",
" If you don't remember your old password you can ask your administrator to recover your files." : "Si no recuerda su antigua contraseña puede pedir a su administrador que le recupere sus ficheros.",
"Old log-in password" : "Contraseña de acceso antigua",
diff --git a/apps/files_encryption/l10n/es_AR.js b/apps/files_encryption/l10n/es_AR.js
index 86ac5977f7f..e0da73dae9b 100644
--- a/apps/files_encryption/l10n/es_AR.js
+++ b/apps/files_encryption/l10n/es_AR.js
@@ -8,14 +8,12 @@ OC.L10N.register(
"Password successfully changed." : "Tu contraseña fue cambiada",
"Could not change the password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Comprobá que la contraseña actual sea correcta.",
"Private key password successfully updated." : "Contraseña de clave privada actualizada con éxito.",
- "Could not update the private key password. Maybe the old password was not correct." : "No fue posible actualizar la contraseña de clave privada. Tal vez la contraseña anterior no es correcta.",
"File recovery settings updated" : "Las opciones de recuperación de archivos fueron actualizadas",
"Could not update file recovery" : "No fue posible actualizar la recuperación de archivos",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "¡La aplicación de encriptación no está inicializada! Es probable que la aplicación fue re-habilitada durante tu sesión. Intenta salir y iniciar sesión para volverla a iniciar.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "¡Tu llave privada no es válida! Aparenta que tu clave fue cambiada fuera de %s (de tus directorios). Puedes actualizar la contraseña de tu clave privadaen las configuraciones personales para recobrar el acceso a tus archivos encriptados.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "No se puede descibrar este archivo, probablemente sea un archivo compartido. Por favor pídele al dueño que recomparta el archivo contigo.",
"Missing requirements." : "Requisitos incompletos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, asegúrese de que PHP 5.3.3 o una versión más reciente esté instalado y que OpenSSL junto con la extensión PHP esté habilitado y configurado apropiadamente. Por ahora, la aplicación de encriptación ha sido deshabilitada.",
"Following users are not set up for encryption:" : "Los siguientes usuarios no fueron configurados para encriptar:",
"Initial encryption started... This can take some time. Please wait." : "Encriptación inicial comenzada... Esto puede durar un tiempo. Por favor espere.",
"Initial encryption running... Please try again later." : "Encriptación inicial corriendo... Por favor intente mas tarde. ",
diff --git a/apps/files_encryption/l10n/es_AR.json b/apps/files_encryption/l10n/es_AR.json
index 07dab2694bd..ac76c994787 100644
--- a/apps/files_encryption/l10n/es_AR.json
+++ b/apps/files_encryption/l10n/es_AR.json
@@ -6,14 +6,12 @@
"Password successfully changed." : "Tu contraseña fue cambiada",
"Could not change the password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Comprobá que la contraseña actual sea correcta.",
"Private key password successfully updated." : "Contraseña de clave privada actualizada con éxito.",
- "Could not update the private key password. Maybe the old password was not correct." : "No fue posible actualizar la contraseña de clave privada. Tal vez la contraseña anterior no es correcta.",
"File recovery settings updated" : "Las opciones de recuperación de archivos fueron actualizadas",
"Could not update file recovery" : "No fue posible actualizar la recuperación de archivos",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "¡La aplicación de encriptación no está inicializada! Es probable que la aplicación fue re-habilitada durante tu sesión. Intenta salir y iniciar sesión para volverla a iniciar.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "¡Tu llave privada no es válida! Aparenta que tu clave fue cambiada fuera de %s (de tus directorios). Puedes actualizar la contraseña de tu clave privadaen las configuraciones personales para recobrar el acceso a tus archivos encriptados.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "No se puede descibrar este archivo, probablemente sea un archivo compartido. Por favor pídele al dueño que recomparta el archivo contigo.",
"Missing requirements." : "Requisitos incompletos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, asegúrese de que PHP 5.3.3 o una versión más reciente esté instalado y que OpenSSL junto con la extensión PHP esté habilitado y configurado apropiadamente. Por ahora, la aplicación de encriptación ha sido deshabilitada.",
"Following users are not set up for encryption:" : "Los siguientes usuarios no fueron configurados para encriptar:",
"Initial encryption started... This can take some time. Please wait." : "Encriptación inicial comenzada... Esto puede durar un tiempo. Por favor espere.",
"Initial encryption running... Please try again later." : "Encriptación inicial corriendo... Por favor intente mas tarde. ",
diff --git a/apps/files_encryption/l10n/es_MX.js b/apps/files_encryption/l10n/es_MX.js
index 02af0608ab1..e445cd03b05 100644
--- a/apps/files_encryption/l10n/es_MX.js
+++ b/apps/files_encryption/l10n/es_MX.js
@@ -8,14 +8,12 @@ OC.L10N.register(
"Password successfully changed." : "Su contraseña ha sido cambiada",
"Could not change the password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Compruebe que la contraseña actual sea correcta.",
"Private key password successfully updated." : "Contraseña de clave privada actualizada con éxito.",
- "Could not update the private key password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Puede que la contraseña antigua no sea correcta.",
"File recovery settings updated" : "Opciones de recuperación de archivos actualizada",
"Could not update file recovery" : "No se pudo actualizar la recuperación de archivos",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "¡La aplicación de cifrado no ha sido inicializada! Quizá fue restablecida durante tu sesión. Por favor intenta cerrar la sesión y volver a iniciarla para inicializar la aplicación de cifrado.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "¡Su clave privada no es válida! Tal vez su contraseña ha sido cambiada desde fuera. de %s (Ej:Su directorio corporativo). Puede actualizar la contraseña de su clave privada en sus opciones personales para recuperar el acceso a sus archivos.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "No fue posible descifrar este archivo, probablemente se trate de un archivo compartido. Solicite al propietario del mismo que vuelva a compartirlo con usted.",
"Missing requirements." : "Requisitos incompletos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, asegúrese de que PHP 5.3.3 o posterior está instalado y que la extensión OpenSSL de PHP está habilitada y configurada correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.",
"Following users are not set up for encryption:" : "Los siguientes usuarios no han sido configurados para el cifrado:",
"Initial encryption started... This can take some time. Please wait." : "Encriptación iniciada... Esto puede tomar un tiempo. Por favor espere.",
"Encryption" : "Cifrado",
diff --git a/apps/files_encryption/l10n/es_MX.json b/apps/files_encryption/l10n/es_MX.json
index 1ff89da3d8f..3ca4e51a139 100644
--- a/apps/files_encryption/l10n/es_MX.json
+++ b/apps/files_encryption/l10n/es_MX.json
@@ -6,14 +6,12 @@
"Password successfully changed." : "Su contraseña ha sido cambiada",
"Could not change the password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Compruebe que la contraseña actual sea correcta.",
"Private key password successfully updated." : "Contraseña de clave privada actualizada con éxito.",
- "Could not update the private key password. Maybe the old password was not correct." : "No se pudo cambiar la contraseña. Puede que la contraseña antigua no sea correcta.",
"File recovery settings updated" : "Opciones de recuperación de archivos actualizada",
"Could not update file recovery" : "No se pudo actualizar la recuperación de archivos",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "¡La aplicación de cifrado no ha sido inicializada! Quizá fue restablecida durante tu sesión. Por favor intenta cerrar la sesión y volver a iniciarla para inicializar la aplicación de cifrado.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "¡Su clave privada no es válida! Tal vez su contraseña ha sido cambiada desde fuera. de %s (Ej:Su directorio corporativo). Puede actualizar la contraseña de su clave privada en sus opciones personales para recuperar el acceso a sus archivos.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "No fue posible descifrar este archivo, probablemente se trate de un archivo compartido. Solicite al propietario del mismo que vuelva a compartirlo con usted.",
"Missing requirements." : "Requisitos incompletos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, asegúrese de que PHP 5.3.3 o posterior está instalado y que la extensión OpenSSL de PHP está habilitada y configurada correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.",
"Following users are not set up for encryption:" : "Los siguientes usuarios no han sido configurados para el cifrado:",
"Initial encryption started... This can take some time. Please wait." : "Encriptación iniciada... Esto puede tomar un tiempo. Por favor espere.",
"Encryption" : "Cifrado",
diff --git a/apps/files_encryption/l10n/et_EE.js b/apps/files_encryption/l10n/et_EE.js
index a4edf9950a6..57297e8b9a3 100644
--- a/apps/files_encryption/l10n/et_EE.js
+++ b/apps/files_encryption/l10n/et_EE.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Palun korda uut taastevõtme parooli",
"Password successfully changed." : "Parool edukalt vahetatud.",
"Could not change the password. Maybe the old password was not correct." : "Ei suutnud vahetada parooli. Võib-olla on vana parool valesti sisestatud.",
+ "Could not update the private key password." : "Ei suutnud uuendada privaatse võtme parooli.",
+ "The old password was not correct, please try again." : "Vana parool polnud õige, palun proovi uuesti.",
+ "The current log-in password was not correct, please try again." : "Praeguse sisselogimise parool polnud õige, palun proovi uuesti.",
"Private key password successfully updated." : "Privaatse võtme parool edukalt uuendatud.",
- "Could not update the private key password. Maybe the old password was not correct." : "Ei suutnud uuendada privaatse võtme parooli. Võib-olla polnud vana parool õige.",
"File recovery settings updated" : "Faili taaste seaded uuendatud",
"Could not update file recovery" : "Ei suuda uuendada taastefaili",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Krüpteerimise rakend pole käivitatud. Võib-olla krüpteerimise rakend taaskäivitati sinu sessiooni kestel. Palun proovi logida välja ning uuesti sisse käivitamaks krüpteerimise rakendit.",
@@ -22,7 +24,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Sa ei saa seda faili dekrüpteerida, see on tõenäoliselt jagatud fail. Palun lase omanikul seda faili sinuga uuesti jagada.",
"Unknown error. Please check your system settings or contact your administrator" : "Tundmatu viga. Palun võta ühendust oma administraatoriga.",
"Missing requirements." : "Nõutavad on puudu.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Palun veendu, et on paigaldatud PHP 5.3.3 või uuem ning PHP OpenSSL laiendus on lubatud ning seadistatud korrektselt. Hetkel krüpteerimise rakendus on peatatud.",
"Following users are not set up for encryption:" : "Järgmised kasutajad pole seadistatud krüpteeringuks:",
"Initial encryption started... This can take some time. Please wait." : "Algne krüpteerimine käivitati... See võib võtta natuke aega. Palun oota.",
"Initial encryption running... Please try again later." : "Toimub esmane krüpteerimine... Palun proovi hiljem uuesti.",
diff --git a/apps/files_encryption/l10n/et_EE.json b/apps/files_encryption/l10n/et_EE.json
index df58c8f11fb..364eb02ef4f 100644
--- a/apps/files_encryption/l10n/et_EE.json
+++ b/apps/files_encryption/l10n/et_EE.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Palun korda uut taastevõtme parooli",
"Password successfully changed." : "Parool edukalt vahetatud.",
"Could not change the password. Maybe the old password was not correct." : "Ei suutnud vahetada parooli. Võib-olla on vana parool valesti sisestatud.",
+ "Could not update the private key password." : "Ei suutnud uuendada privaatse võtme parooli.",
+ "The old password was not correct, please try again." : "Vana parool polnud õige, palun proovi uuesti.",
+ "The current log-in password was not correct, please try again." : "Praeguse sisselogimise parool polnud õige, palun proovi uuesti.",
"Private key password successfully updated." : "Privaatse võtme parool edukalt uuendatud.",
- "Could not update the private key password. Maybe the old password was not correct." : "Ei suutnud uuendada privaatse võtme parooli. Võib-olla polnud vana parool õige.",
"File recovery settings updated" : "Faili taaste seaded uuendatud",
"Could not update file recovery" : "Ei suuda uuendada taastefaili",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Krüpteerimise rakend pole käivitatud. Võib-olla krüpteerimise rakend taaskäivitati sinu sessiooni kestel. Palun proovi logida välja ning uuesti sisse käivitamaks krüpteerimise rakendit.",
@@ -20,7 +22,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Sa ei saa seda faili dekrüpteerida, see on tõenäoliselt jagatud fail. Palun lase omanikul seda faili sinuga uuesti jagada.",
"Unknown error. Please check your system settings or contact your administrator" : "Tundmatu viga. Palun võta ühendust oma administraatoriga.",
"Missing requirements." : "Nõutavad on puudu.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Palun veendu, et on paigaldatud PHP 5.3.3 või uuem ning PHP OpenSSL laiendus on lubatud ning seadistatud korrektselt. Hetkel krüpteerimise rakendus on peatatud.",
"Following users are not set up for encryption:" : "Järgmised kasutajad pole seadistatud krüpteeringuks:",
"Initial encryption started... This can take some time. Please wait." : "Algne krüpteerimine käivitati... See võib võtta natuke aega. Palun oota.",
"Initial encryption running... Please try again later." : "Toimub esmane krüpteerimine... Palun proovi hiljem uuesti.",
diff --git a/apps/files_encryption/l10n/eu.js b/apps/files_encryption/l10n/eu.js
index 84d446313a1..65242e2da90 100644
--- a/apps/files_encryption/l10n/eu.js
+++ b/apps/files_encryption/l10n/eu.js
@@ -14,7 +14,6 @@ OC.L10N.register(
"Password successfully changed." : "Pasahitza behar bezala aldatu da.",
"Could not change the password. Maybe the old password was not correct." : "Ezin izan da pasahitza aldatu. Agian pasahitz zaharra okerrekoa da.",
"Private key password successfully updated." : "Gako pasahitz pribatu behar bezala eguneratu da.",
- "Could not update the private key password. Maybe the old password was not correct." : "Ezin izan da gako pribatu pasahitza eguneratu. Agian pasahitz zaharra okerrekoa da.",
"File recovery settings updated" : "Fitxategi berreskuratze ezarpenak eguneratuak",
"Could not update file recovery" : "Ezin da fitxategi berreskuratzea eguneratu",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Enkriptazio aplikazioa ez dago hasieratuta! Agian aplikazioa birgaitu egin da zure saioa bitartean. Mesdez atear eta sartu berriz enkriptazio aplikazioa hasierarazteko.",
@@ -22,7 +21,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Ezin izan da fitxategi hau deszifratu, ziurrenik elkarbanatutako fitxategi bat da. Mesdez, eskatu fitxategiaren jabeari fitxategia zurekin berriz elkarbana dezan.",
"Unknown error. Please check your system settings or contact your administrator" : "Errore ezezaguna. Mesedez, egiaztatu zure sistemaren ezarpenak edo jarri zure administrariarekin kontaktuan.",
"Missing requirements." : "Eskakizun batzuk ez dira betetzen.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Mesedez ziurtatu PHP 5.3.3 edo berriago bat instalatuta dagoela eta OpenSSL PHP hedapenarekin gaitua eta ongi konfiguratuta dagoela. Oraingoz, enkriptazio aplikazioa desgaituta dago.",
"Following users are not set up for encryption:" : "Hurrengo erabiltzaileak ez daude enktriptatzeko konfiguratutak:",
"Initial encryption started... This can take some time. Please wait." : "Hasierako enkriptazioa hasi da... Honek denbora har dezake. Mesedez itxaron.",
"Initial encryption running... Please try again later." : "Hasierako enkriptaketa abian... mesedez, saiatu beranduago.",
diff --git a/apps/files_encryption/l10n/eu.json b/apps/files_encryption/l10n/eu.json
index c18cebad99d..961ffe3270a 100644
--- a/apps/files_encryption/l10n/eu.json
+++ b/apps/files_encryption/l10n/eu.json
@@ -12,7 +12,6 @@
"Password successfully changed." : "Pasahitza behar bezala aldatu da.",
"Could not change the password. Maybe the old password was not correct." : "Ezin izan da pasahitza aldatu. Agian pasahitz zaharra okerrekoa da.",
"Private key password successfully updated." : "Gako pasahitz pribatu behar bezala eguneratu da.",
- "Could not update the private key password. Maybe the old password was not correct." : "Ezin izan da gako pribatu pasahitza eguneratu. Agian pasahitz zaharra okerrekoa da.",
"File recovery settings updated" : "Fitxategi berreskuratze ezarpenak eguneratuak",
"Could not update file recovery" : "Ezin da fitxategi berreskuratzea eguneratu",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Enkriptazio aplikazioa ez dago hasieratuta! Agian aplikazioa birgaitu egin da zure saioa bitartean. Mesdez atear eta sartu berriz enkriptazio aplikazioa hasierarazteko.",
@@ -20,7 +19,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Ezin izan da fitxategi hau deszifratu, ziurrenik elkarbanatutako fitxategi bat da. Mesdez, eskatu fitxategiaren jabeari fitxategia zurekin berriz elkarbana dezan.",
"Unknown error. Please check your system settings or contact your administrator" : "Errore ezezaguna. Mesedez, egiaztatu zure sistemaren ezarpenak edo jarri zure administrariarekin kontaktuan.",
"Missing requirements." : "Eskakizun batzuk ez dira betetzen.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Mesedez ziurtatu PHP 5.3.3 edo berriago bat instalatuta dagoela eta OpenSSL PHP hedapenarekin gaitua eta ongi konfiguratuta dagoela. Oraingoz, enkriptazio aplikazioa desgaituta dago.",
"Following users are not set up for encryption:" : "Hurrengo erabiltzaileak ez daude enktriptatzeko konfiguratutak:",
"Initial encryption started... This can take some time. Please wait." : "Hasierako enkriptazioa hasi da... Honek denbora har dezake. Mesedez itxaron.",
"Initial encryption running... Please try again later." : "Hasierako enkriptaketa abian... mesedez, saiatu beranduago.",
diff --git a/apps/files_encryption/l10n/fa.js b/apps/files_encryption/l10n/fa.js
index 541b19c695c..037dc26e681 100644
--- a/apps/files_encryption/l10n/fa.js
+++ b/apps/files_encryption/l10n/fa.js
@@ -8,7 +8,6 @@ OC.L10N.register(
"Password successfully changed." : "رمزعبور با موفقیت تغییر یافت.",
"Could not change the password. Maybe the old password was not correct." : "رمزعبور را نمیتواند تغییر دهد. شاید رمزعبورقدیمی صحیح نمی باشد.",
"Private key password successfully updated." : "رمزعبور کلید خصوصی با موفقیت به روز شد.",
- "Could not update the private key password. Maybe the old password was not correct." : "رمزعبور کلید خصوصی را نمی تواند به روز کند. شاید رمزعبور قدیمی صحیح نمی باشد.",
"File recovery settings updated" : "تنظیمات بازیابی فایل به روز شده است.",
"Could not update file recovery" : "به روز رسانی بازیابی فایل را نمی تواند انجام دهد.",
"Missing requirements." : "نیازمندی های گمشده",
diff --git a/apps/files_encryption/l10n/fa.json b/apps/files_encryption/l10n/fa.json
index 30b0faa5ec8..0c89886d412 100644
--- a/apps/files_encryption/l10n/fa.json
+++ b/apps/files_encryption/l10n/fa.json
@@ -6,7 +6,6 @@
"Password successfully changed." : "رمزعبور با موفقیت تغییر یافت.",
"Could not change the password. Maybe the old password was not correct." : "رمزعبور را نمیتواند تغییر دهد. شاید رمزعبورقدیمی صحیح نمی باشد.",
"Private key password successfully updated." : "رمزعبور کلید خصوصی با موفقیت به روز شد.",
- "Could not update the private key password. Maybe the old password was not correct." : "رمزعبور کلید خصوصی را نمی تواند به روز کند. شاید رمزعبور قدیمی صحیح نمی باشد.",
"File recovery settings updated" : "تنظیمات بازیابی فایل به روز شده است.",
"Could not update file recovery" : "به روز رسانی بازیابی فایل را نمی تواند انجام دهد.",
"Missing requirements." : "نیازمندی های گمشده",
diff --git a/apps/files_encryption/l10n/fi_FI.js b/apps/files_encryption/l10n/fi_FI.js
index bf1afbb1129..aff16f1fcdd 100644
--- a/apps/files_encryption/l10n/fi_FI.js
+++ b/apps/files_encryption/l10n/fi_FI.js
@@ -5,9 +5,11 @@ OC.L10N.register(
"Recovery key successfully enabled" : "Palautusavain kytketty päälle onnistuneesti",
"Password successfully changed." : "Salasana vaihdettiin onnistuneesti.",
"Could not change the password. Maybe the old password was not correct." : "Salasanan vaihto epäonnistui. Kenties vanha salasana oli väärin.",
+ "The old password was not correct, please try again." : "Vanha salasana oli väärin, yritä uudelleen.",
"Private key password successfully updated." : "Yksityisen avaimen salasana päivitetty onnistuneesti.",
"File recovery settings updated" : "Tiedostopalautuksen asetukset päivitetty",
"Unknown error. Please check your system settings or contact your administrator" : "Tuntematon virhe. Tarkista järjestelmän asetukset tai ole yhteydessä ylläpitäjään.",
+ "Missing requirements." : "Puuttuvat vaatimukset.",
"Following users are not set up for encryption:" : "Seuraavat käyttäjät eivät ole määrittäneet salausta:",
"Initial encryption started... This can take some time. Please wait." : "Ensimmäinen salauskerta käynnistetty... Tämä saattaa kestää hetken.",
"Initial encryption running... Please try again later." : "Ensimmäinen salauskerta on meneillään... Yritä myöhemmin uudelleen.",
@@ -25,8 +27,8 @@ OC.L10N.register(
"Repeat New Recovery key password" : "Toista uusi palautusavaimen salasana",
"Change Password" : "Vaihda salasana",
" If you don't remember your old password you can ask your administrator to recover your files." : "Jos et muista vanhaa salasanaasi, voit pyytää ylläpitäjää palauttamaan tiedostosi.",
- "Old log-in password" : "Vanha kirjautumis-salasana",
- "Current log-in password" : "Nykyinen kirjautumis-salasana",
+ "Old log-in password" : "Vanha kirjautumissalasana",
+ "Current log-in password" : "Nykyinen kirjautumissalasana",
"Update Private Key Password" : "Päivitä yksityisen avaimen salasana",
"Enable password recovery:" : "Ota salasanan palautus käyttöön:"
},
diff --git a/apps/files_encryption/l10n/fi_FI.json b/apps/files_encryption/l10n/fi_FI.json
index 2b91a4388d0..348f8aeb1fe 100644
--- a/apps/files_encryption/l10n/fi_FI.json
+++ b/apps/files_encryption/l10n/fi_FI.json
@@ -3,9 +3,11 @@
"Recovery key successfully enabled" : "Palautusavain kytketty päälle onnistuneesti",
"Password successfully changed." : "Salasana vaihdettiin onnistuneesti.",
"Could not change the password. Maybe the old password was not correct." : "Salasanan vaihto epäonnistui. Kenties vanha salasana oli väärin.",
+ "The old password was not correct, please try again." : "Vanha salasana oli väärin, yritä uudelleen.",
"Private key password successfully updated." : "Yksityisen avaimen salasana päivitetty onnistuneesti.",
"File recovery settings updated" : "Tiedostopalautuksen asetukset päivitetty",
"Unknown error. Please check your system settings or contact your administrator" : "Tuntematon virhe. Tarkista järjestelmän asetukset tai ole yhteydessä ylläpitäjään.",
+ "Missing requirements." : "Puuttuvat vaatimukset.",
"Following users are not set up for encryption:" : "Seuraavat käyttäjät eivät ole määrittäneet salausta:",
"Initial encryption started... This can take some time. Please wait." : "Ensimmäinen salauskerta käynnistetty... Tämä saattaa kestää hetken.",
"Initial encryption running... Please try again later." : "Ensimmäinen salauskerta on meneillään... Yritä myöhemmin uudelleen.",
@@ -23,8 +25,8 @@
"Repeat New Recovery key password" : "Toista uusi palautusavaimen salasana",
"Change Password" : "Vaihda salasana",
" If you don't remember your old password you can ask your administrator to recover your files." : "Jos et muista vanhaa salasanaasi, voit pyytää ylläpitäjää palauttamaan tiedostosi.",
- "Old log-in password" : "Vanha kirjautumis-salasana",
- "Current log-in password" : "Nykyinen kirjautumis-salasana",
+ "Old log-in password" : "Vanha kirjautumissalasana",
+ "Current log-in password" : "Nykyinen kirjautumissalasana",
"Update Private Key Password" : "Päivitä yksityisen avaimen salasana",
"Enable password recovery:" : "Ota salasanan palautus käyttöön:"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
diff --git a/apps/files_encryption/l10n/fr.js b/apps/files_encryption/l10n/fr.js
index 68d07143f73..b0f4d1d5edf 100644
--- a/apps/files_encryption/l10n/fr.js
+++ b/apps/files_encryption/l10n/fr.js
@@ -11,29 +11,31 @@ OC.L10N.register(
"Please provide the old recovery password" : "Veuillez entrer l'ancien mot de passe de récupération",
"Please provide a new recovery password" : "Veuillez entrer un nouveau mot de passe de récupération",
"Please repeat the new recovery password" : "Veuillez répéter le nouveau mot de passe de récupération",
- "Password successfully changed." : "Mot de passe changé avec succès ",
- "Could not change the password. Maybe the old password was not correct." : "Ne peut pas changer le mot de passe. L'ancien mot de passe est peut-être incorrect.",
+ "Password successfully changed." : "Mot de passe changé avec succès.",
+ "Could not change the password. Maybe the old password was not correct." : "Erreur lors du changement de mot de passe. L'ancien mot de passe est peut-être incorrect.",
+ "Could not update the private key password." : "Impossible de mettre à jour le mot de passe de la clé privée.",
+ "The old password was not correct, please try again." : "L'ancien mot de passe est incorrect. Veuillez réessayer.",
+ "The current log-in password was not correct, please try again." : "Le mot de passe actuel n'est pas correct, veuillez réessayer.",
"Private key password successfully updated." : "Mot de passe de la clé privé mis à jour avec succès.",
- "Could not update the private key password. Maybe the old password was not correct." : "Impossible de mettre à jour le mot de passe de la clé privé. Peut-être que l'ancien mot de passe n'était pas correcte.",
"File recovery settings updated" : "Paramètres de récupération de fichiers mis à jour",
- "Could not update file recovery" : "Ne peut pas remettre à jour les fichiers de récupération",
+ "Could not update file recovery" : "Impossible de mettre à jour les fichiers de récupération",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "L'application de chiffrement n'est pas initialisée ! Peut-être que cette application a été réactivée pendant votre session. Veuillez essayer de vous déconnecter et ensuite de vous reconnecter pour initialiser l'application de chiffrement.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Votre clef privée est invalide ! Votre mot de passe a probablement été modifié hors de %s (ex. votre annuaire d'entreprise). Vous pouvez mettre à jour le mot de passe de votre clef privée dans les paramètres personnels pour pouvoir récupérer l'accès à vos fichiers chiffrés.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Impossible de déchiffrer ce fichier, il s'agit probablement d'un fichier partagé. Veuillez demander au propriétaire de ce fichier de le repartager avec vous.",
"Unknown error. Please check your system settings or contact your administrator" : "Erreur inconnue. Veuillez vérifier vos paramètres système ou contacter un administrateur.",
- "Missing requirements." : "Système minimum requis non respecté.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Veuillez vous assurer qu'une version de PHP 5.3.3 ou supérieure est installée et qu'OpenSSL et son extension PHP sont activés et configurés correctement. En attendant, l'application de chiffrement été désactivée.",
- "Following users are not set up for encryption:" : "Les utilisateurs suivants ne sont pas configurés pour le chiffrement :",
"Initial encryption started... This can take some time. Please wait." : "Chiffrement initial démarré... Cela peut prendre un certain temps. Veuillez patienter.",
"Initial encryption running... Please try again later." : "Chiffrement initial en cours... Veuillez re-essayer ultérieurement.",
+ "Missing requirements." : "Système minimum requis non respecté.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Merci de vous assurer que OpenSSL et son extension PHP sont activés et configurés correctement. Pour l'instant, l'application de chiffrement a été désactivée.",
+ "Following users are not set up for encryption:" : "Les utilisateurs suivants ne sont pas configurés pour le chiffrement :",
"Go directly to your %spersonal settings%s." : "Allerz directement à vos %spersonal settings%s.",
"Encryption" : "Chiffrement",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "L'application de chiffrement est activée mais vos clés ne sont pas initialisées, veuillez vous déconnecter et ensuite vous reconnecter.",
"Enable recovery key (allow to recover users files in case of password loss):" : "Activer la clef de récupération (permet de récupérer les fichiers des utilisateurs en cas de perte de mot de passe).",
"Recovery key password" : "Mot de passe de la clef de récupération",
"Repeat Recovery key password" : "Répétez le mot de passe de la clé de récupération",
- "Enabled" : "Activer",
- "Disabled" : "Désactiver",
+ "Enabled" : "Activé",
+ "Disabled" : "Désactivé",
"Change recovery key password:" : "Modifier le mot de passe de la clef de récupération :",
"Old Recovery key password" : "Ancien mot de passe de la clef de récupération",
"New Recovery key password" : "Nouveau mot de passe de la clef de récupération",
diff --git a/apps/files_encryption/l10n/fr.json b/apps/files_encryption/l10n/fr.json
index 707583f7c80..fffe581ac5e 100644
--- a/apps/files_encryption/l10n/fr.json
+++ b/apps/files_encryption/l10n/fr.json
@@ -9,29 +9,31 @@
"Please provide the old recovery password" : "Veuillez entrer l'ancien mot de passe de récupération",
"Please provide a new recovery password" : "Veuillez entrer un nouveau mot de passe de récupération",
"Please repeat the new recovery password" : "Veuillez répéter le nouveau mot de passe de récupération",
- "Password successfully changed." : "Mot de passe changé avec succès ",
- "Could not change the password. Maybe the old password was not correct." : "Ne peut pas changer le mot de passe. L'ancien mot de passe est peut-être incorrect.",
+ "Password successfully changed." : "Mot de passe changé avec succès.",
+ "Could not change the password. Maybe the old password was not correct." : "Erreur lors du changement de mot de passe. L'ancien mot de passe est peut-être incorrect.",
+ "Could not update the private key password." : "Impossible de mettre à jour le mot de passe de la clé privée.",
+ "The old password was not correct, please try again." : "L'ancien mot de passe est incorrect. Veuillez réessayer.",
+ "The current log-in password was not correct, please try again." : "Le mot de passe actuel n'est pas correct, veuillez réessayer.",
"Private key password successfully updated." : "Mot de passe de la clé privé mis à jour avec succès.",
- "Could not update the private key password. Maybe the old password was not correct." : "Impossible de mettre à jour le mot de passe de la clé privé. Peut-être que l'ancien mot de passe n'était pas correcte.",
"File recovery settings updated" : "Paramètres de récupération de fichiers mis à jour",
- "Could not update file recovery" : "Ne peut pas remettre à jour les fichiers de récupération",
+ "Could not update file recovery" : "Impossible de mettre à jour les fichiers de récupération",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "L'application de chiffrement n'est pas initialisée ! Peut-être que cette application a été réactivée pendant votre session. Veuillez essayer de vous déconnecter et ensuite de vous reconnecter pour initialiser l'application de chiffrement.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Votre clef privée est invalide ! Votre mot de passe a probablement été modifié hors de %s (ex. votre annuaire d'entreprise). Vous pouvez mettre à jour le mot de passe de votre clef privée dans les paramètres personnels pour pouvoir récupérer l'accès à vos fichiers chiffrés.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Impossible de déchiffrer ce fichier, il s'agit probablement d'un fichier partagé. Veuillez demander au propriétaire de ce fichier de le repartager avec vous.",
"Unknown error. Please check your system settings or contact your administrator" : "Erreur inconnue. Veuillez vérifier vos paramètres système ou contacter un administrateur.",
- "Missing requirements." : "Système minimum requis non respecté.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Veuillez vous assurer qu'une version de PHP 5.3.3 ou supérieure est installée et qu'OpenSSL et son extension PHP sont activés et configurés correctement. En attendant, l'application de chiffrement été désactivée.",
- "Following users are not set up for encryption:" : "Les utilisateurs suivants ne sont pas configurés pour le chiffrement :",
"Initial encryption started... This can take some time. Please wait." : "Chiffrement initial démarré... Cela peut prendre un certain temps. Veuillez patienter.",
"Initial encryption running... Please try again later." : "Chiffrement initial en cours... Veuillez re-essayer ultérieurement.",
+ "Missing requirements." : "Système minimum requis non respecté.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Merci de vous assurer que OpenSSL et son extension PHP sont activés et configurés correctement. Pour l'instant, l'application de chiffrement a été désactivée.",
+ "Following users are not set up for encryption:" : "Les utilisateurs suivants ne sont pas configurés pour le chiffrement :",
"Go directly to your %spersonal settings%s." : "Allerz directement à vos %spersonal settings%s.",
"Encryption" : "Chiffrement",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "L'application de chiffrement est activée mais vos clés ne sont pas initialisées, veuillez vous déconnecter et ensuite vous reconnecter.",
"Enable recovery key (allow to recover users files in case of password loss):" : "Activer la clef de récupération (permet de récupérer les fichiers des utilisateurs en cas de perte de mot de passe).",
"Recovery key password" : "Mot de passe de la clef de récupération",
"Repeat Recovery key password" : "Répétez le mot de passe de la clé de récupération",
- "Enabled" : "Activer",
- "Disabled" : "Désactiver",
+ "Enabled" : "Activé",
+ "Disabled" : "Désactivé",
"Change recovery key password:" : "Modifier le mot de passe de la clef de récupération :",
"Old Recovery key password" : "Ancien mot de passe de la clef de récupération",
"New Recovery key password" : "Nouveau mot de passe de la clef de récupération",
diff --git a/apps/files_encryption/l10n/gl.js b/apps/files_encryption/l10n/gl.js
index c04a1c1a5ea..9b14a4455b5 100644
--- a/apps/files_encryption/l10n/gl.js
+++ b/apps/files_encryption/l10n/gl.js
@@ -3,29 +3,31 @@ OC.L10N.register(
{
"Unknown error" : "Produciuse un erro descoñecido",
"Missing recovery key password" : "Falta a chave de recuperación",
- "Please repeat the recovery key password" : "Por favor repita a chave de recuperación",
- "Repeated recovery key password does not match the provided recovery key password" : "A repetición da chave de recuperación non coincide coa chave de recuperación establecida",
+ "Please repeat the recovery key password" : "Repita a chave de recuperación",
+ "Repeated recovery key password does not match the provided recovery key password" : "A repetición da chave de recuperación non coincide coa chave de recuperación estabelecida",
"Recovery key successfully enabled" : "Activada satisfactoriamente a chave de recuperación",
"Could not disable recovery key. Please check your recovery key password!" : "Non foi posíbel desactivar a chave de recuperación. Comprobe o contrasinal da chave de recuperación!",
"Recovery key successfully disabled" : "Desactivada satisfactoriamente a chave de recuperación",
- "Please provide the old recovery password" : "Por favor introduza a chave de recuperación anterior",
- "Please provide a new recovery password" : "Por favor introduza a nova chave de recuperación",
+ "Please provide the old recovery password" : "Introduza a chave de recuperación antiga",
+ "Please provide a new recovery password" : "Introduza a nova chave de recuperación",
"Please repeat the new recovery password" : "Por favor repita a nova chave de recuperación",
"Password successfully changed." : "O contrasinal foi cambiado satisfactoriamente",
"Could not change the password. Maybe the old password was not correct." : "Non foi posíbel cambiar o contrasinal. Probabelmente o contrasinal antigo non é o correcto.",
+ "Could not update the private key password." : "Non foi posíbel actualizar o contrasinal da chave privada.",
+ "The old password was not correct, please try again." : "O contrasinal antigo non é correcto, ténteo de novo.",
+ "The current log-in password was not correct, please try again." : "O actual contrasinal de acceso non é correcto, ténteo de novo.",
"Private key password successfully updated." : "A chave privada foi actualizada correctamente.",
- "Could not update the private key password. Maybe the old password was not correct." : "Non foi posíbel actualizar o contrasinal da chave privada. É probábel que o contrasinal antigo non sexa correcto.",
"File recovery settings updated" : "Actualizouse o ficheiro de axustes de recuperación",
"Could not update file recovery" : "Non foi posíbel actualizar o ficheiro de recuperación",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Non se iniciou a aplicación de cifrado! Quizais volva a activarse durante a sesión. Tente pechar a sesión e volver iniciala para que tamén se inicie a aplicación de cifrado.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "A chave privada non é correcta! É probábel que o seu contrasinal teña sido cambiado desde o exterior do %s (p.ex. o seu directorio corporativo). Vostede pode actualizar o contrasinal da súa chave privada nos seus axustes persoais para recuperar o acceso aos seus ficheiros",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Non foi posíbel descifrar o ficheiro, probabelmente tratase dun ficheiro compartido. Pídalle ao propietario do ficheiro que volva compartir o ficheiro con vostede.",
"Unknown error. Please check your system settings or contact your administrator" : "Produciuse un erro descoñecido. Comprobe os axustes do sistema ou contacte co administrador",
- "Missing requirements." : "Non se cumpren os requisitos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Asegúrese de que está instalado o PHP 5.3.3 ou posterior e de que o OpenSSL xunto coa extensión PHP estean activados e configurados correctamente. Polo de agora foi desactivada a aplicación de cifrado.",
- "Following users are not set up for encryption:" : "Os seguintes usuarios non teñen configuración para o cifrado:",
"Initial encryption started... This can take some time. Please wait." : "Comezou o cifrado inicial... Isto pode levar bastante tempo. Agarde.",
"Initial encryption running... Please try again later." : "O cifrado inicial está en execución... Tenteo máis tarde.",
+ "Missing requirements." : "Non se cumpren os requisitos.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Asegúrese de que está instalado o OpenSSL xunto coa extensión PHP e que estean activados e configurados correctamente. Polo de agora foi desactivado a aplicación de cifrado.",
+ "Following users are not set up for encryption:" : "Os seguintes usuarios non teñen configuración para o cifrado:",
"Go directly to your %spersonal settings%s." : "Vaia directamente aos seus %saxustes persoais%s.",
"Encryption" : "Cifrado",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "A aplicación de cifrado está activada, mais as chaves non foron inicializadas, saia da sesión e volva a acceder de novo",
diff --git a/apps/files_encryption/l10n/gl.json b/apps/files_encryption/l10n/gl.json
index 4583f25da1a..3704f7d2c79 100644
--- a/apps/files_encryption/l10n/gl.json
+++ b/apps/files_encryption/l10n/gl.json
@@ -1,29 +1,31 @@
{ "translations": {
"Unknown error" : "Produciuse un erro descoñecido",
"Missing recovery key password" : "Falta a chave de recuperación",
- "Please repeat the recovery key password" : "Por favor repita a chave de recuperación",
- "Repeated recovery key password does not match the provided recovery key password" : "A repetición da chave de recuperación non coincide coa chave de recuperación establecida",
+ "Please repeat the recovery key password" : "Repita a chave de recuperación",
+ "Repeated recovery key password does not match the provided recovery key password" : "A repetición da chave de recuperación non coincide coa chave de recuperación estabelecida",
"Recovery key successfully enabled" : "Activada satisfactoriamente a chave de recuperación",
"Could not disable recovery key. Please check your recovery key password!" : "Non foi posíbel desactivar a chave de recuperación. Comprobe o contrasinal da chave de recuperación!",
"Recovery key successfully disabled" : "Desactivada satisfactoriamente a chave de recuperación",
- "Please provide the old recovery password" : "Por favor introduza a chave de recuperación anterior",
- "Please provide a new recovery password" : "Por favor introduza a nova chave de recuperación",
+ "Please provide the old recovery password" : "Introduza a chave de recuperación antiga",
+ "Please provide a new recovery password" : "Introduza a nova chave de recuperación",
"Please repeat the new recovery password" : "Por favor repita a nova chave de recuperación",
"Password successfully changed." : "O contrasinal foi cambiado satisfactoriamente",
"Could not change the password. Maybe the old password was not correct." : "Non foi posíbel cambiar o contrasinal. Probabelmente o contrasinal antigo non é o correcto.",
+ "Could not update the private key password." : "Non foi posíbel actualizar o contrasinal da chave privada.",
+ "The old password was not correct, please try again." : "O contrasinal antigo non é correcto, ténteo de novo.",
+ "The current log-in password was not correct, please try again." : "O actual contrasinal de acceso non é correcto, ténteo de novo.",
"Private key password successfully updated." : "A chave privada foi actualizada correctamente.",
- "Could not update the private key password. Maybe the old password was not correct." : "Non foi posíbel actualizar o contrasinal da chave privada. É probábel que o contrasinal antigo non sexa correcto.",
"File recovery settings updated" : "Actualizouse o ficheiro de axustes de recuperación",
"Could not update file recovery" : "Non foi posíbel actualizar o ficheiro de recuperación",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Non se iniciou a aplicación de cifrado! Quizais volva a activarse durante a sesión. Tente pechar a sesión e volver iniciala para que tamén se inicie a aplicación de cifrado.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "A chave privada non é correcta! É probábel que o seu contrasinal teña sido cambiado desde o exterior do %s (p.ex. o seu directorio corporativo). Vostede pode actualizar o contrasinal da súa chave privada nos seus axustes persoais para recuperar o acceso aos seus ficheiros",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Non foi posíbel descifrar o ficheiro, probabelmente tratase dun ficheiro compartido. Pídalle ao propietario do ficheiro que volva compartir o ficheiro con vostede.",
"Unknown error. Please check your system settings or contact your administrator" : "Produciuse un erro descoñecido. Comprobe os axustes do sistema ou contacte co administrador",
- "Missing requirements." : "Non se cumpren os requisitos.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Asegúrese de que está instalado o PHP 5.3.3 ou posterior e de que o OpenSSL xunto coa extensión PHP estean activados e configurados correctamente. Polo de agora foi desactivada a aplicación de cifrado.",
- "Following users are not set up for encryption:" : "Os seguintes usuarios non teñen configuración para o cifrado:",
"Initial encryption started... This can take some time. Please wait." : "Comezou o cifrado inicial... Isto pode levar bastante tempo. Agarde.",
"Initial encryption running... Please try again later." : "O cifrado inicial está en execución... Tenteo máis tarde.",
+ "Missing requirements." : "Non se cumpren os requisitos.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Asegúrese de que está instalado o OpenSSL xunto coa extensión PHP e que estean activados e configurados correctamente. Polo de agora foi desactivado a aplicación de cifrado.",
+ "Following users are not set up for encryption:" : "Os seguintes usuarios non teñen configuración para o cifrado:",
"Go directly to your %spersonal settings%s." : "Vaia directamente aos seus %saxustes persoais%s.",
"Encryption" : "Cifrado",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "A aplicación de cifrado está activada, mais as chaves non foron inicializadas, saia da sesión e volva a acceder de novo",
diff --git a/apps/files_encryption/l10n/hr.js b/apps/files_encryption/l10n/hr.js
index 7160e72ac23..0474a024642 100644
--- a/apps/files_encryption/l10n/hr.js
+++ b/apps/files_encryption/l10n/hr.js
@@ -8,7 +8,6 @@ OC.L10N.register(
"Password successfully changed." : "Lozinka uspješno promijenjena.",
"Could not change the password. Maybe the old password was not correct." : "Lozinku nije moguće promijeniti. Možda je stara lozinka bila neispravna.",
"Private key password successfully updated." : "Lozinka privatnog ključa uspješno ažurirana.",
- "Could not update the private key password. Maybe the old password was not correct." : "Lozinku privatnog ključa nije moguće promijeniti. Možda stara je stara lozinka bila neispravna.",
"File recovery settings updated" : "Ažurirane postavke za oporavak datoteke",
"Could not update file recovery" : "Oporavak datoteke nije moguće ažurirati",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Aplikacija šifriranja nije inicijalizirana! Možda je aplikacija šifriranja bila reaktivirana tijekom vaše sesije.Da biste inicijalizirali aplikaciju šifriranja, molimo, pokušajte se odjaviti i ponovno prijaviti.",
@@ -16,7 +15,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Ovu datoteku nije moguće dešifrirati, vjerojatno je riječ o zajedničkoj datoteci. Molimopitajte vlasnika datoteke da je ponovo podijeli s vama.",
"Unknown error. Please check your system settings or contact your administrator" : "Pogreška nepoznata. Molimo provjerite svoje sistemske postavke ili kontaktirajte svog administratora.",
"Missing requirements." : "Nedostaju preduvjeti.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Molimo osigurajte da je instaliran PHP 5.3.3 ili noviji i da je OpenSSL zajedno s PHP ekstenzijom propisno aktivirani konfiguriran. Za sada, aplikacija šifriranja je deaktivirana.",
"Following users are not set up for encryption:" : "Sljedeći korisnici nisu određeni za šifriranje:",
"Initial encryption started... This can take some time. Please wait." : "Počelo inicijalno šifriranje... To može potrajati neko vrijeme. Molimo, pričekajte.",
"Initial encryption running... Please try again later." : "Inicijalno šifriranje u tijeku... Molimo, pokušajte ponovno kasnije.",
diff --git a/apps/files_encryption/l10n/hr.json b/apps/files_encryption/l10n/hr.json
index e375f3f6314..7c2af923fbd 100644
--- a/apps/files_encryption/l10n/hr.json
+++ b/apps/files_encryption/l10n/hr.json
@@ -6,7 +6,6 @@
"Password successfully changed." : "Lozinka uspješno promijenjena.",
"Could not change the password. Maybe the old password was not correct." : "Lozinku nije moguće promijeniti. Možda je stara lozinka bila neispravna.",
"Private key password successfully updated." : "Lozinka privatnog ključa uspješno ažurirana.",
- "Could not update the private key password. Maybe the old password was not correct." : "Lozinku privatnog ključa nije moguće promijeniti. Možda stara je stara lozinka bila neispravna.",
"File recovery settings updated" : "Ažurirane postavke za oporavak datoteke",
"Could not update file recovery" : "Oporavak datoteke nije moguće ažurirati",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Aplikacija šifriranja nije inicijalizirana! Možda je aplikacija šifriranja bila reaktivirana tijekom vaše sesije.Da biste inicijalizirali aplikaciju šifriranja, molimo, pokušajte se odjaviti i ponovno prijaviti.",
@@ -14,7 +13,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Ovu datoteku nije moguće dešifrirati, vjerojatno je riječ o zajedničkoj datoteci. Molimopitajte vlasnika datoteke da je ponovo podijeli s vama.",
"Unknown error. Please check your system settings or contact your administrator" : "Pogreška nepoznata. Molimo provjerite svoje sistemske postavke ili kontaktirajte svog administratora.",
"Missing requirements." : "Nedostaju preduvjeti.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Molimo osigurajte da je instaliran PHP 5.3.3 ili noviji i da je OpenSSL zajedno s PHP ekstenzijom propisno aktivirani konfiguriran. Za sada, aplikacija šifriranja je deaktivirana.",
"Following users are not set up for encryption:" : "Sljedeći korisnici nisu određeni za šifriranje:",
"Initial encryption started... This can take some time. Please wait." : "Počelo inicijalno šifriranje... To može potrajati neko vrijeme. Molimo, pričekajte.",
"Initial encryption running... Please try again later." : "Inicijalno šifriranje u tijeku... Molimo, pokušajte ponovno kasnije.",
diff --git a/apps/files_encryption/l10n/hu_HU.js b/apps/files_encryption/l10n/hu_HU.js
index 349d7cf6e3e..92538d1ce56 100644
--- a/apps/files_encryption/l10n/hu_HU.js
+++ b/apps/files_encryption/l10n/hu_HU.js
@@ -8,14 +8,12 @@ OC.L10N.register(
"Password successfully changed." : "A jelszót sikeresen megváltoztattuk.",
"Could not change the password. Maybe the old password was not correct." : "A jelszót nem lehet megváltoztatni! Lehet, hogy hibás volt a régi jelszó.",
"Private key password successfully updated." : "A személyes kulcsának jelszava frissítésre került.",
- "Could not update the private key password. Maybe the old password was not correct." : "A személyes kulcsa jelszavát nem lehetett frissíteni. Lehet, hogy hibás volt a régi jelszó.",
"File recovery settings updated" : "A fájlhelyreállítási beállítások frissültek",
"Could not update file recovery" : "A fájlhelyreállítás nem frissíthető",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "A titkosítási modul nincs elindítva! Talán a munkafolyamat közben került engedélyezésre. Kérjük jelentkezzen ki majd ismét jelentkezzen be, hogy a titkosítási modul megfelelően elinduljon!",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Az állományok titkosításához használt titkos kulcsa érvénytelen. Valószínűleg a %s rendszeren kívül változtatta meg a jelszavát (pl. a munkahelyi címtárban). A személyes beállításoknál frissítheti a titkos kulcsát, hogy ismét elérhesse a titkosított állományait.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Az állományt nem sikerült dekódolni, valószínűleg ez egy megosztott fájl. Kérje meg az állomány tulajdonosát, hogy újra ossza meg Önnel ezt az állományt!",
"Missing requirements." : "Hiányzó követelmények.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Kérem gondoskodjon arról, hogy PHP 5.3.3 vagy annál frissebb legyen telepítve, továbbá az OpenSSL a megfelelő PHP-bővítménnyel együtt rendelkezésre álljon és helyesen legyen konfigurálva! A titkosító modul egyelőre kikapcsolásra került.",
"Following users are not set up for encryption:" : "A következő felhasználók nem állították be a titkosítást:",
"Initial encryption started... This can take some time. Please wait." : "A titkosítási folyamat megkezdődött... Ez hosszabb ideig is eltarthat. Kérem várjon.",
"Initial encryption running... Please try again later." : "Kezedeti titkosítás fut... Próbálja később.",
diff --git a/apps/files_encryption/l10n/hu_HU.json b/apps/files_encryption/l10n/hu_HU.json
index e94c192180a..023cb51fc5a 100644
--- a/apps/files_encryption/l10n/hu_HU.json
+++ b/apps/files_encryption/l10n/hu_HU.json
@@ -6,14 +6,12 @@
"Password successfully changed." : "A jelszót sikeresen megváltoztattuk.",
"Could not change the password. Maybe the old password was not correct." : "A jelszót nem lehet megváltoztatni! Lehet, hogy hibás volt a régi jelszó.",
"Private key password successfully updated." : "A személyes kulcsának jelszava frissítésre került.",
- "Could not update the private key password. Maybe the old password was not correct." : "A személyes kulcsa jelszavát nem lehetett frissíteni. Lehet, hogy hibás volt a régi jelszó.",
"File recovery settings updated" : "A fájlhelyreállítási beállítások frissültek",
"Could not update file recovery" : "A fájlhelyreállítás nem frissíthető",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "A titkosítási modul nincs elindítva! Talán a munkafolyamat közben került engedélyezésre. Kérjük jelentkezzen ki majd ismét jelentkezzen be, hogy a titkosítási modul megfelelően elinduljon!",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Az állományok titkosításához használt titkos kulcsa érvénytelen. Valószínűleg a %s rendszeren kívül változtatta meg a jelszavát (pl. a munkahelyi címtárban). A személyes beállításoknál frissítheti a titkos kulcsát, hogy ismét elérhesse a titkosított állományait.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Az állományt nem sikerült dekódolni, valószínűleg ez egy megosztott fájl. Kérje meg az állomány tulajdonosát, hogy újra ossza meg Önnel ezt az állományt!",
"Missing requirements." : "Hiányzó követelmények.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Kérem gondoskodjon arról, hogy PHP 5.3.3 vagy annál frissebb legyen telepítve, továbbá az OpenSSL a megfelelő PHP-bővítménnyel együtt rendelkezésre álljon és helyesen legyen konfigurálva! A titkosító modul egyelőre kikapcsolásra került.",
"Following users are not set up for encryption:" : "A következő felhasználók nem állították be a titkosítást:",
"Initial encryption started... This can take some time. Please wait." : "A titkosítási folyamat megkezdődött... Ez hosszabb ideig is eltarthat. Kérem várjon.",
"Initial encryption running... Please try again later." : "Kezedeti titkosítás fut... Próbálja később.",
diff --git a/apps/files_encryption/l10n/id.js b/apps/files_encryption/l10n/id.js
index 7137d13cb9f..6c621bddd04 100644
--- a/apps/files_encryption/l10n/id.js
+++ b/apps/files_encryption/l10n/id.js
@@ -14,7 +14,6 @@ OC.L10N.register(
"Password successfully changed." : "Sandi berhasil diubah",
"Could not change the password. Maybe the old password was not correct." : "Tidak dapat mengubah sandi. Kemungkinan sandi lama yang dimasukkan salah.",
"Private key password successfully updated." : "Sandi kunci privat berhasil diperbarui.",
- "Could not update the private key password. Maybe the old password was not correct." : "Tidak dapat memperbarui sandi kunci privat. Kemungkinan sandi lama yang Anda masukkan salah.",
"File recovery settings updated" : "Pengaturan pemulihan berkas diperbarui",
"Could not update file recovery" : "Tidak dapat memperbarui pemulihan berkas",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Aplikasi enkripsi tidak dimulai! Kemungkinan aplikasi enkripsi telah diaktifkan ulang saat sesi Anda. Silakan coba untuk keluar dan kembali lagi untuk memulai aplikasi enkripsi.",
@@ -22,7 +21,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat mendekripsi berkas ini, mungkin ini adalah berkas bersama. Silakan meminta pemilik berkas ini untuk membagikan kembali dengan Anda.",
"Unknown error. Please check your system settings or contact your administrator" : "Kesalahan tidak diketahui. Silakan periksa pengaturan sistem Anda atau hubungi administrator",
"Missing requirements." : "Persyaratan tidak terpenuhi.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Pastikan bahwa PHP 5.3.3 atau yang lebih baru telah diinstal dan OpenSSL bersama ekstensi PHP telah diaktifkan dan dikonfigurasi dengan benar. Untuk saat ini, aplikasi enkripsi akan dinonaktifkan.",
"Following users are not set up for encryption:" : "Pengguna berikut belum diatur untuk enkripsi:",
"Initial encryption started... This can take some time. Please wait." : "Enskripsi awal dijalankan... Ini dapat memakan waktu. Silakan tunggu.",
"Initial encryption running... Please try again later." : "Enkripsi awal sedang berjalan... Sialakn coba lagi nanti.",
diff --git a/apps/files_encryption/l10n/id.json b/apps/files_encryption/l10n/id.json
index eb5361d4b66..090e56c76b2 100644
--- a/apps/files_encryption/l10n/id.json
+++ b/apps/files_encryption/l10n/id.json
@@ -12,7 +12,6 @@
"Password successfully changed." : "Sandi berhasil diubah",
"Could not change the password. Maybe the old password was not correct." : "Tidak dapat mengubah sandi. Kemungkinan sandi lama yang dimasukkan salah.",
"Private key password successfully updated." : "Sandi kunci privat berhasil diperbarui.",
- "Could not update the private key password. Maybe the old password was not correct." : "Tidak dapat memperbarui sandi kunci privat. Kemungkinan sandi lama yang Anda masukkan salah.",
"File recovery settings updated" : "Pengaturan pemulihan berkas diperbarui",
"Could not update file recovery" : "Tidak dapat memperbarui pemulihan berkas",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Aplikasi enkripsi tidak dimulai! Kemungkinan aplikasi enkripsi telah diaktifkan ulang saat sesi Anda. Silakan coba untuk keluar dan kembali lagi untuk memulai aplikasi enkripsi.",
@@ -20,7 +19,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat mendekripsi berkas ini, mungkin ini adalah berkas bersama. Silakan meminta pemilik berkas ini untuk membagikan kembali dengan Anda.",
"Unknown error. Please check your system settings or contact your administrator" : "Kesalahan tidak diketahui. Silakan periksa pengaturan sistem Anda atau hubungi administrator",
"Missing requirements." : "Persyaratan tidak terpenuhi.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Pastikan bahwa PHP 5.3.3 atau yang lebih baru telah diinstal dan OpenSSL bersama ekstensi PHP telah diaktifkan dan dikonfigurasi dengan benar. Untuk saat ini, aplikasi enkripsi akan dinonaktifkan.",
"Following users are not set up for encryption:" : "Pengguna berikut belum diatur untuk enkripsi:",
"Initial encryption started... This can take some time. Please wait." : "Enskripsi awal dijalankan... Ini dapat memakan waktu. Silakan tunggu.",
"Initial encryption running... Please try again later." : "Enkripsi awal sedang berjalan... Sialakn coba lagi nanti.",
diff --git a/apps/files_encryption/l10n/it.js b/apps/files_encryption/l10n/it.js
index e71abc94675..08167b8ea7c 100644
--- a/apps/files_encryption/l10n/it.js
+++ b/apps/files_encryption/l10n/it.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Ripeti la nuova password di recupero",
"Password successfully changed." : "Password modificata correttamente.",
"Could not change the password. Maybe the old password was not correct." : "Impossibile cambiare la password. Forse la vecchia password non era corretta.",
+ "Could not update the private key password." : "Impossibile aggiornare la password della chiave privata.",
+ "The old password was not correct, please try again." : "La vecchia password non era corretta, prova di nuovo.",
+ "The current log-in password was not correct, please try again." : "La password di accesso attuale non era corretta, prova ancora.",
"Private key password successfully updated." : "Password della chiave privata aggiornata correttamente.",
- "Could not update the private key password. Maybe the old password was not correct." : "Impossibile aggiornare la password della chiave privata. Forse la vecchia password non era corretta.",
"File recovery settings updated" : "Impostazioni di ripristino dei file aggiornate",
"Could not update file recovery" : "Impossibile aggiornare il ripristino dei file",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Applicazione di cifratura non inizializzata. Forse l'applicazione è stata riabilitata durante la tua sessione. Prova a disconnetterti e ad effettuare nuovamente l'accesso per inizializzarla.",
@@ -22,7 +24,7 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Impossibile decifrare questo file, probabilmente è un file condiviso. Chiedi al proprietario del file di condividere nuovamente il file con te.",
"Unknown error. Please check your system settings or contact your administrator" : "Errore sconosciuto. Controlla le impostazioni di sistema o contatta il tuo amministratore",
"Missing requirements." : "Requisiti mancanti.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Assicurati che sia installato PHP 5.3.3 o versioni successive e che l'estensione OpenSSL di PHP sia abilitata e configurata correttamente. Per ora, l'applicazione di cifratura è disabilitata.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Assicurati che OpenSSL e l'estensione PHP sia abilitatati e configurati correttamente. Per ora, l'applicazione di cifratura è disabilitata.",
"Following users are not set up for encryption:" : "I seguenti utenti non sono configurati per la cifratura:",
"Initial encryption started... This can take some time. Please wait." : "Cifratura iniziale avviata... Potrebbe richiedere del tempo. Attendi.",
"Initial encryption running... Please try again later." : "Cifratura iniziale in esecuzione... Riprova più tardi.",
diff --git a/apps/files_encryption/l10n/it.json b/apps/files_encryption/l10n/it.json
index d051a2cfc98..15d2b1b0343 100644
--- a/apps/files_encryption/l10n/it.json
+++ b/apps/files_encryption/l10n/it.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Ripeti la nuova password di recupero",
"Password successfully changed." : "Password modificata correttamente.",
"Could not change the password. Maybe the old password was not correct." : "Impossibile cambiare la password. Forse la vecchia password non era corretta.",
+ "Could not update the private key password." : "Impossibile aggiornare la password della chiave privata.",
+ "The old password was not correct, please try again." : "La vecchia password non era corretta, prova di nuovo.",
+ "The current log-in password was not correct, please try again." : "La password di accesso attuale non era corretta, prova ancora.",
"Private key password successfully updated." : "Password della chiave privata aggiornata correttamente.",
- "Could not update the private key password. Maybe the old password was not correct." : "Impossibile aggiornare la password della chiave privata. Forse la vecchia password non era corretta.",
"File recovery settings updated" : "Impostazioni di ripristino dei file aggiornate",
"Could not update file recovery" : "Impossibile aggiornare il ripristino dei file",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Applicazione di cifratura non inizializzata. Forse l'applicazione è stata riabilitata durante la tua sessione. Prova a disconnetterti e ad effettuare nuovamente l'accesso per inizializzarla.",
@@ -20,7 +22,7 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Impossibile decifrare questo file, probabilmente è un file condiviso. Chiedi al proprietario del file di condividere nuovamente il file con te.",
"Unknown error. Please check your system settings or contact your administrator" : "Errore sconosciuto. Controlla le impostazioni di sistema o contatta il tuo amministratore",
"Missing requirements." : "Requisiti mancanti.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Assicurati che sia installato PHP 5.3.3 o versioni successive e che l'estensione OpenSSL di PHP sia abilitata e configurata correttamente. Per ora, l'applicazione di cifratura è disabilitata.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Assicurati che OpenSSL e l'estensione PHP sia abilitatati e configurati correttamente. Per ora, l'applicazione di cifratura è disabilitata.",
"Following users are not set up for encryption:" : "I seguenti utenti non sono configurati per la cifratura:",
"Initial encryption started... This can take some time. Please wait." : "Cifratura iniziale avviata... Potrebbe richiedere del tempo. Attendi.",
"Initial encryption running... Please try again later." : "Cifratura iniziale in esecuzione... Riprova più tardi.",
diff --git a/apps/files_encryption/l10n/ja.js b/apps/files_encryption/l10n/ja.js
index e4ca38f822b..6d0930b5e25 100644
--- a/apps/files_encryption/l10n/ja.js
+++ b/apps/files_encryption/l10n/ja.js
@@ -13,19 +13,21 @@ OC.L10N.register(
"Please repeat the new recovery password" : "新しい復旧キーのパスワードをもう一度入力",
"Password successfully changed." : "パスワードを変更できました。",
"Could not change the password. Maybe the old password was not correct." : "パスワードを変更できませんでした。古いパスワードが間違っているかもしれません。",
+ "Could not update the private key password." : "秘密鍵のパスワードを更新できませんでした。",
+ "The old password was not correct, please try again." : "古いパスワードが一致しませんでした。もう一度入力してください。",
+ "The current log-in password was not correct, please try again." : "ログインパスワードが一致しませんでした。もう一度入力してください。",
"Private key password successfully updated." : "秘密鍵のパスワードが正常に更新されました。",
- "Could not update the private key password. Maybe the old password was not correct." : "秘密鍵のパスワードを更新できませんでした。古いパスワードが正確でない場合があります。",
"File recovery settings updated" : "ファイルリカバリ設定を更新しました",
"Could not update file recovery" : "ファイルリカバリを更新できませんでした",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "セッション中に暗号化アプリを再度有効にされたため、暗号化アプリが初期化されていません。暗号化アプリを初期化するため、ログアウトしてログインしなおしてください。",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "プライベートキーが有効ではありません!パスワードが%sの外部で変更された(例: 共同ディレクトリ)と思われます。個人設定でプライベートキーのパスワードを更新して、暗号化ファイルへのアクセスを回復することができます。",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "このファイルを復号化できません、共有ファイルの可能性があります。ファイルの所有者にお願いして、ファイルを共有しなおしてもらってください。",
"Unknown error. Please check your system settings or contact your administrator" : "不明なエラーです。システム設定を確認するか、管理者に問い合わせてください。",
- "Missing requirements." : "必要要件が満たされていません。",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "必ず、PHP 5.3.3もしくはそれ以上をインストールし、同時にOpenSSLのPHP拡張を有効にした上でOpenSSLも同様にインストール、適切に設定してください。現時点では暗号化アプリは無効になっています。",
- "Following users are not set up for encryption:" : "以下のユーザーは、暗号化設定がされていません:",
"Initial encryption started... This can take some time. Please wait." : "暗号化の初期化作業を開始しました... この処理にはしばらく時間がかかります。お待ちください。",
"Initial encryption running... Please try again later." : "初期暗号化実行中... 後でもう一度お試しください。",
+ "Missing requirements." : "必要要件が満たされていません。",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "必ず、OpenSSL及びOpenSSLのPHPの拡張を有効にした上で、適切に設定してください。現時点では暗号化アプリは無効になっています。",
+ "Following users are not set up for encryption:" : "以下のユーザーは、暗号化設定がされていません:",
"Go directly to your %spersonal settings%s." : "直接 %s個人設定%s に進む。",
"Encryption" : "暗号化",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "暗号化アプリは有効ですが、あなたの暗号化キーは初期化されていません。ログアウトした後に、再度ログインしてください",
diff --git a/apps/files_encryption/l10n/ja.json b/apps/files_encryption/l10n/ja.json
index 471bf314442..abf2a3555ee 100644
--- a/apps/files_encryption/l10n/ja.json
+++ b/apps/files_encryption/l10n/ja.json
@@ -11,19 +11,21 @@
"Please repeat the new recovery password" : "新しい復旧キーのパスワードをもう一度入力",
"Password successfully changed." : "パスワードを変更できました。",
"Could not change the password. Maybe the old password was not correct." : "パスワードを変更できませんでした。古いパスワードが間違っているかもしれません。",
+ "Could not update the private key password." : "秘密鍵のパスワードを更新できませんでした。",
+ "The old password was not correct, please try again." : "古いパスワードが一致しませんでした。もう一度入力してください。",
+ "The current log-in password was not correct, please try again." : "ログインパスワードが一致しませんでした。もう一度入力してください。",
"Private key password successfully updated." : "秘密鍵のパスワードが正常に更新されました。",
- "Could not update the private key password. Maybe the old password was not correct." : "秘密鍵のパスワードを更新できませんでした。古いパスワードが正確でない場合があります。",
"File recovery settings updated" : "ファイルリカバリ設定を更新しました",
"Could not update file recovery" : "ファイルリカバリを更新できませんでした",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "セッション中に暗号化アプリを再度有効にされたため、暗号化アプリが初期化されていません。暗号化アプリを初期化するため、ログアウトしてログインしなおしてください。",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "プライベートキーが有効ではありません!パスワードが%sの外部で変更された(例: 共同ディレクトリ)と思われます。個人設定でプライベートキーのパスワードを更新して、暗号化ファイルへのアクセスを回復することができます。",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "このファイルを復号化できません、共有ファイルの可能性があります。ファイルの所有者にお願いして、ファイルを共有しなおしてもらってください。",
"Unknown error. Please check your system settings or contact your administrator" : "不明なエラーです。システム設定を確認するか、管理者に問い合わせてください。",
- "Missing requirements." : "必要要件が満たされていません。",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "必ず、PHP 5.3.3もしくはそれ以上をインストールし、同時にOpenSSLのPHP拡張を有効にした上でOpenSSLも同様にインストール、適切に設定してください。現時点では暗号化アプリは無効になっています。",
- "Following users are not set up for encryption:" : "以下のユーザーは、暗号化設定がされていません:",
"Initial encryption started... This can take some time. Please wait." : "暗号化の初期化作業を開始しました... この処理にはしばらく時間がかかります。お待ちください。",
"Initial encryption running... Please try again later." : "初期暗号化実行中... 後でもう一度お試しください。",
+ "Missing requirements." : "必要要件が満たされていません。",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "必ず、OpenSSL及びOpenSSLのPHPの拡張を有効にした上で、適切に設定してください。現時点では暗号化アプリは無効になっています。",
+ "Following users are not set up for encryption:" : "以下のユーザーは、暗号化設定がされていません:",
"Go directly to your %spersonal settings%s." : "直接 %s個人設定%s に進む。",
"Encryption" : "暗号化",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "暗号化アプリは有効ですが、あなたの暗号化キーは初期化されていません。ログアウトした後に、再度ログインしてください",
diff --git a/apps/files_encryption/l10n/kn.js b/apps/files_encryption/l10n/kn.js
new file mode 100644
index 00000000000..b3fcb4aba3d
--- /dev/null
+++ b/apps/files_encryption/l10n/kn.js
@@ -0,0 +1,9 @@
+OC.L10N.register(
+ "files_encryption",
+ {
+ "Unknown error" : "ಗೊತ್ತಿಲ್ಲದ ದೋಷ",
+ "Encryption" : "ರಹಸ್ಯ ಸಂಕೇತೀಕರಿಸು",
+ "Enabled" : "ಸಕ್ರಿಯಗೊಳಿಸಿದೆ",
+ "Disabled" : "ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ"
+},
+"nplurals=1; plural=0;");
diff --git a/apps/files_encryption/l10n/kn.json b/apps/files_encryption/l10n/kn.json
new file mode 100644
index 00000000000..a6c76f69b22
--- /dev/null
+++ b/apps/files_encryption/l10n/kn.json
@@ -0,0 +1,7 @@
+{ "translations": {
+ "Unknown error" : "ಗೊತ್ತಿಲ್ಲದ ದೋಷ",
+ "Encryption" : "ರಹಸ್ಯ ಸಂಕೇತೀಕರಿಸು",
+ "Enabled" : "ಸಕ್ರಿಯಗೊಳಿಸಿದೆ",
+ "Disabled" : "ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ"
+},"pluralForm" :"nplurals=1; plural=0;"
+} \ No newline at end of file
diff --git a/apps/files_encryption/l10n/ko.js b/apps/files_encryption/l10n/ko.js
index a994dc7d339..82c29ecb11a 100644
--- a/apps/files_encryption/l10n/ko.js
+++ b/apps/files_encryption/l10n/ko.js
@@ -8,14 +8,12 @@ OC.L10N.register(
"Password successfully changed." : "암호가 성공적으로 변경되었습니다",
"Could not change the password. Maybe the old password was not correct." : "암호를 변경할 수 없습니다. 예전 암호가 정확하지 않은 것 같습니다.",
"Private key password successfully updated." : "개인 키 암호가 성공적으로 업데이트 됨.",
- "Could not update the private key password. Maybe the old password was not correct." : "개인 키 암호를 업데이트할 수 없습니다. 이전 암호가 올바르지 않은 것 같습니다.",
"File recovery settings updated" : "파일 복구 설정 업데이트됨",
"Could not update file recovery" : "파일 복구를 업데이트할 수 없습니다",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "암호화 앱이 초기화되지 않았습니다! 암호화 앱이 다시 활성화된 것 같습니다. 암호화 앱을 초기화하려면 로그아웃했다 다시 로그인하십시오.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "개인 키가 올바르지 않습니다! 암호가 %s(예: 회사 디렉터리) 외부에서 변경된 것 같습니다. 암호화된 파일에 다시 접근하려면 개인 설정에서 개인 키 암호를 수정하십시오.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "이 파일을 복호화할 수 없습니다. 공유된 파일일 수도 있습니다. 파일 소유자에게 공유를 다시 요청하십시오.",
"Missing requirements." : "요구 사항이 부족합니다.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "PHP 5.3.3 이상 설치 여부, PHP의 OpenSSL 확장 기능 활성화 및 설정 여부를 확인하십시오. 암호화 앱이 비활성화 되었습니다.",
"Following users are not set up for encryption:" : "다음 사용자는 암호화를 사용할 수 없습니다:",
"Initial encryption started... This can take some time. Please wait." : "초기 암호화가 시작되었습니다... 시간이 걸릴 수도 있으니 기다려 주십시오.",
"Encryption" : "암호화",
diff --git a/apps/files_encryption/l10n/ko.json b/apps/files_encryption/l10n/ko.json
index 3cc8ec06b06..e1b53e0983e 100644
--- a/apps/files_encryption/l10n/ko.json
+++ b/apps/files_encryption/l10n/ko.json
@@ -6,14 +6,12 @@
"Password successfully changed." : "암호가 성공적으로 변경되었습니다",
"Could not change the password. Maybe the old password was not correct." : "암호를 변경할 수 없습니다. 예전 암호가 정확하지 않은 것 같습니다.",
"Private key password successfully updated." : "개인 키 암호가 성공적으로 업데이트 됨.",
- "Could not update the private key password. Maybe the old password was not correct." : "개인 키 암호를 업데이트할 수 없습니다. 이전 암호가 올바르지 않은 것 같습니다.",
"File recovery settings updated" : "파일 복구 설정 업데이트됨",
"Could not update file recovery" : "파일 복구를 업데이트할 수 없습니다",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "암호화 앱이 초기화되지 않았습니다! 암호화 앱이 다시 활성화된 것 같습니다. 암호화 앱을 초기화하려면 로그아웃했다 다시 로그인하십시오.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "개인 키가 올바르지 않습니다! 암호가 %s(예: 회사 디렉터리) 외부에서 변경된 것 같습니다. 암호화된 파일에 다시 접근하려면 개인 설정에서 개인 키 암호를 수정하십시오.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "이 파일을 복호화할 수 없습니다. 공유된 파일일 수도 있습니다. 파일 소유자에게 공유를 다시 요청하십시오.",
"Missing requirements." : "요구 사항이 부족합니다.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "PHP 5.3.3 이상 설치 여부, PHP의 OpenSSL 확장 기능 활성화 및 설정 여부를 확인하십시오. 암호화 앱이 비활성화 되었습니다.",
"Following users are not set up for encryption:" : "다음 사용자는 암호화를 사용할 수 없습니다:",
"Initial encryption started... This can take some time. Please wait." : "초기 암호화가 시작되었습니다... 시간이 걸릴 수도 있으니 기다려 주십시오.",
"Encryption" : "암호화",
diff --git a/apps/files_encryption/l10n/lt_LT.js b/apps/files_encryption/l10n/lt_LT.js
index eebfcedaf0b..98541b865fe 100644
--- a/apps/files_encryption/l10n/lt_LT.js
+++ b/apps/files_encryption/l10n/lt_LT.js
@@ -8,14 +8,12 @@ OC.L10N.register(
"Password successfully changed." : "Slaptažodis sėkmingai pakeistas",
"Could not change the password. Maybe the old password was not correct." : "Slaptažodis nebuvo pakeistas. Gali būti, kad buvo neteisingai suvestas senasis.",
"Private key password successfully updated." : "Privataus rakto slaptažodis buvo sėkmingai atnaujintas.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nepavyko atnaujinti privataus rakto slaptažodžio. Gali būti, kad buvo neteisingai suvestas senasis.",
"File recovery settings updated" : "Failų atkūrimo nustatymai pakeisti",
"Could not update file recovery" : "Neišėjo atnaujinti failų atkūrimo",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Šifravimo programa nepaleista! Galbūt šifravimo programa buvo įjungta dar kartą Jūsų sesijos metu. Prašome atsijungti ir vėl prisijungti, kad paleisti šifravimo programą.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Jūsų privatus raktas yra netinkamas! Panašu, kad Jūsų slaptažodis buvo pakeistas už %s (pvz. Jūsų organizacijos kataloge). Galite atnaujinti savo privataus rakto slaptažodį savo asmeniniuose nustatymuose, kad atkurti prieigą prie savo šifruotų failų.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Failo iššifruoti nepavyko, gali būti jog jis yra pasidalintas su jumis. Paprašykite failo savininko, kad jums iš naujo pateiktų šį failą.",
"Missing requirements." : "Trūkstami laukai.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Prašome įsitikinti, kad PHP 5.3.3 ar naujesnė yra įdiegta ir kad OpenSSL kartu su PHP plėtiniu yra šjungti ir teisingai sukonfigūruoti. Kol kas šifravimo programa bus išjungta.",
"Following users are not set up for encryption:" : "Sekantys naudotojai nenustatyti šifravimui:",
"Initial encryption started... This can take some time. Please wait." : "Pradėtas pirminis šifravimas... Tai gali užtrukti. Prašome palaukti.",
"Encryption" : "Šifravimas",
diff --git a/apps/files_encryption/l10n/lt_LT.json b/apps/files_encryption/l10n/lt_LT.json
index c642bfd7528..e0e486d020b 100644
--- a/apps/files_encryption/l10n/lt_LT.json
+++ b/apps/files_encryption/l10n/lt_LT.json
@@ -6,14 +6,12 @@
"Password successfully changed." : "Slaptažodis sėkmingai pakeistas",
"Could not change the password. Maybe the old password was not correct." : "Slaptažodis nebuvo pakeistas. Gali būti, kad buvo neteisingai suvestas senasis.",
"Private key password successfully updated." : "Privataus rakto slaptažodis buvo sėkmingai atnaujintas.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nepavyko atnaujinti privataus rakto slaptažodžio. Gali būti, kad buvo neteisingai suvestas senasis.",
"File recovery settings updated" : "Failų atkūrimo nustatymai pakeisti",
"Could not update file recovery" : "Neišėjo atnaujinti failų atkūrimo",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Šifravimo programa nepaleista! Galbūt šifravimo programa buvo įjungta dar kartą Jūsų sesijos metu. Prašome atsijungti ir vėl prisijungti, kad paleisti šifravimo programą.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Jūsų privatus raktas yra netinkamas! Panašu, kad Jūsų slaptažodis buvo pakeistas už %s (pvz. Jūsų organizacijos kataloge). Galite atnaujinti savo privataus rakto slaptažodį savo asmeniniuose nustatymuose, kad atkurti prieigą prie savo šifruotų failų.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Failo iššifruoti nepavyko, gali būti jog jis yra pasidalintas su jumis. Paprašykite failo savininko, kad jums iš naujo pateiktų šį failą.",
"Missing requirements." : "Trūkstami laukai.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Prašome įsitikinti, kad PHP 5.3.3 ar naujesnė yra įdiegta ir kad OpenSSL kartu su PHP plėtiniu yra šjungti ir teisingai sukonfigūruoti. Kol kas šifravimo programa bus išjungta.",
"Following users are not set up for encryption:" : "Sekantys naudotojai nenustatyti šifravimui:",
"Initial encryption started... This can take some time. Please wait." : "Pradėtas pirminis šifravimas... Tai gali užtrukti. Prašome palaukti.",
"Encryption" : "Šifravimas",
diff --git a/apps/files_encryption/l10n/lv.js b/apps/files_encryption/l10n/lv.js
index 841a7fc754d..26a761dc5a8 100644
--- a/apps/files_encryption/l10n/lv.js
+++ b/apps/files_encryption/l10n/lv.js
@@ -2,6 +2,8 @@ OC.L10N.register(
"files_encryption",
{
"Unknown error" : "Nezināma kļūda",
- "Encryption" : "Šifrēšana"
+ "Encryption" : "Šifrēšana",
+ "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Šifrēšanas lietotnes ir pieslēgta, bet šifrēšanas atslēgas nav uzstādītas. Lūdzu izejiet no sistēmas un ieejiet sistēmā atpakaļ.",
+ "Enabled" : "Pievienots"
},
"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);");
diff --git a/apps/files_encryption/l10n/lv.json b/apps/files_encryption/l10n/lv.json
index b5c22c13a86..ff29809e4d1 100644
--- a/apps/files_encryption/l10n/lv.json
+++ b/apps/files_encryption/l10n/lv.json
@@ -1,5 +1,7 @@
{ "translations": {
"Unknown error" : "Nezināma kļūda",
- "Encryption" : "Šifrēšana"
+ "Encryption" : "Šifrēšana",
+ "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Šifrēšanas lietotnes ir pieslēgta, bet šifrēšanas atslēgas nav uzstādītas. Lūdzu izejiet no sistēmas un ieejiet sistēmā atpakaļ.",
+ "Enabled" : "Pievienots"
},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"
} \ No newline at end of file
diff --git a/apps/files_encryption/l10n/nb_NO.js b/apps/files_encryption/l10n/nb_NO.js
index 3e018cd76f2..3def2334352 100644
--- a/apps/files_encryption/l10n/nb_NO.js
+++ b/apps/files_encryption/l10n/nb_NO.js
@@ -2,24 +2,32 @@ OC.L10N.register(
"files_encryption",
{
"Unknown error" : "Ukjent feil",
+ "Missing recovery key password" : "Passord for gjenopprettingsnøkkel mangler",
+ "Please repeat the recovery key password" : "Gjenta passord for gjenopprettingsnøkkel",
+ "Repeated recovery key password does not match the provided recovery key password" : "Gjentatt passord for gjenopprettingsnøkkel stemmer ikke med oppgitt passord for gjenopprettingsnøkkel",
"Recovery key successfully enabled" : "Gjenopprettingsnøkkel aktivert",
"Could not disable recovery key. Please check your recovery key password!" : "Klarte ikke å deaktivere gjenopprettingsnøkkel. Sjekk passordet for gjenopprettingsnøkkelen.",
"Recovery key successfully disabled" : "Gjenopprettingsnøkkel ble deaktivert",
+ "Please provide the old recovery password" : "Oppgi det gamle gjenopprettingspassordet",
+ "Please provide a new recovery password" : "Oppgi et nytt gjenopprettingspassord",
+ "Please repeat the new recovery password" : "Gjenta det nye gjenopprettingspassordet",
"Password successfully changed." : "Passordet ble endret.",
"Could not change the password. Maybe the old password was not correct." : "Klarte ikke å endre passordet. Kanskje gammelt passord ikke var korrekt.",
+ "Could not update the private key password." : "Klarte ikke å oppdatere privatnøkkelpassordet.",
+ "The old password was not correct, please try again." : "Det gamle passordet var feil. Prøv igjen.",
+ "The current log-in password was not correct, please try again." : "Det nåværende innloggingspassordet var feil. Prøv igjen.",
"Private key password successfully updated." : "Passord for privat nøkkel ble oppdatert.",
- "Could not update the private key password. Maybe the old password was not correct." : "Klarte ikke å oppdatere passord for privat nøkkel. Kanskje gammelt passord ikke var korrekt.",
"File recovery settings updated" : "Innstillinger for gjenoppretting av filer ble oppdatert",
"Could not update file recovery" : "Klarte ikke å oppdatere gjenoppretting av filer",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Krypterings-app ikke initialisert! Kanskje krypterings-appen ble aktivert på nytt i løpet av økten din. Prøv å logge ut og logge inn igjen for å initialisere krypterings-appen.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Din private nøkkel er ikke gyldig! Sannsynligvis ble passordet ditt endret utenfor %s. (f.eks. din bedriftskatalog). Du kan oppdatere passordet for din private nøkkel i dine personlige innstillinger for å gjenvinne tilgang til de krypterte filene dine.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan ikke dekryptere denne filen. Dette er sannsynligvis en delt fil. Spør eieren av filen om å dele den med deg på nytt.",
"Unknown error. Please check your system settings or contact your administrator" : "Ukjent feil. Sjekk systeminnstillingene eller kontakt administratoren.",
- "Missing requirements." : "Manglende krav.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Vennligst se til at PHP 5.3.3 eller nyere er installert og at OpenSSL sammen med PHP-utvidelsen er aktivert og riktig konfigurert. Enn så lenge er krypterings-appen deaktivert.",
- "Following users are not set up for encryption:" : "Følgende brukere er ikke satt opp for kryptering:",
"Initial encryption started... This can take some time. Please wait." : "Førstegangs kryptering startet... Dette kan ta litt tid. Vennligst vent.",
"Initial encryption running... Please try again later." : "Førstegangs kryptering kjører... Prøv igjen senere.",
+ "Missing requirements." : "Manglende krav.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Vennligst se til at OpenSSL sammen med PHP-utvidelsen er aktivert og riktig konfigurert. Krypterings-appen er foreløpig deaktivert.",
+ "Following users are not set up for encryption:" : "Følgende brukere er ikke satt opp for kryptering:",
"Go directly to your %spersonal settings%s." : "Gå direkte til dine %spersonlige innstillinger%s.",
"Encryption" : "Kryptering",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "App for kryptering er aktivert men nøklene dine er ikke satt opp. Logg ut og logg inn igjen.",
diff --git a/apps/files_encryption/l10n/nb_NO.json b/apps/files_encryption/l10n/nb_NO.json
index ba3e2210a96..bada449a86c 100644
--- a/apps/files_encryption/l10n/nb_NO.json
+++ b/apps/files_encryption/l10n/nb_NO.json
@@ -1,23 +1,31 @@
{ "translations": {
"Unknown error" : "Ukjent feil",
+ "Missing recovery key password" : "Passord for gjenopprettingsnøkkel mangler",
+ "Please repeat the recovery key password" : "Gjenta passord for gjenopprettingsnøkkel",
+ "Repeated recovery key password does not match the provided recovery key password" : "Gjentatt passord for gjenopprettingsnøkkel stemmer ikke med oppgitt passord for gjenopprettingsnøkkel",
"Recovery key successfully enabled" : "Gjenopprettingsnøkkel aktivert",
"Could not disable recovery key. Please check your recovery key password!" : "Klarte ikke å deaktivere gjenopprettingsnøkkel. Sjekk passordet for gjenopprettingsnøkkelen.",
"Recovery key successfully disabled" : "Gjenopprettingsnøkkel ble deaktivert",
+ "Please provide the old recovery password" : "Oppgi det gamle gjenopprettingspassordet",
+ "Please provide a new recovery password" : "Oppgi et nytt gjenopprettingspassord",
+ "Please repeat the new recovery password" : "Gjenta det nye gjenopprettingspassordet",
"Password successfully changed." : "Passordet ble endret.",
"Could not change the password. Maybe the old password was not correct." : "Klarte ikke å endre passordet. Kanskje gammelt passord ikke var korrekt.",
+ "Could not update the private key password." : "Klarte ikke å oppdatere privatnøkkelpassordet.",
+ "The old password was not correct, please try again." : "Det gamle passordet var feil. Prøv igjen.",
+ "The current log-in password was not correct, please try again." : "Det nåværende innloggingspassordet var feil. Prøv igjen.",
"Private key password successfully updated." : "Passord for privat nøkkel ble oppdatert.",
- "Could not update the private key password. Maybe the old password was not correct." : "Klarte ikke å oppdatere passord for privat nøkkel. Kanskje gammelt passord ikke var korrekt.",
"File recovery settings updated" : "Innstillinger for gjenoppretting av filer ble oppdatert",
"Could not update file recovery" : "Klarte ikke å oppdatere gjenoppretting av filer",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Krypterings-app ikke initialisert! Kanskje krypterings-appen ble aktivert på nytt i løpet av økten din. Prøv å logge ut og logge inn igjen for å initialisere krypterings-appen.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Din private nøkkel er ikke gyldig! Sannsynligvis ble passordet ditt endret utenfor %s. (f.eks. din bedriftskatalog). Du kan oppdatere passordet for din private nøkkel i dine personlige innstillinger for å gjenvinne tilgang til de krypterte filene dine.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan ikke dekryptere denne filen. Dette er sannsynligvis en delt fil. Spør eieren av filen om å dele den med deg på nytt.",
"Unknown error. Please check your system settings or contact your administrator" : "Ukjent feil. Sjekk systeminnstillingene eller kontakt administratoren.",
- "Missing requirements." : "Manglende krav.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Vennligst se til at PHP 5.3.3 eller nyere er installert og at OpenSSL sammen med PHP-utvidelsen er aktivert og riktig konfigurert. Enn så lenge er krypterings-appen deaktivert.",
- "Following users are not set up for encryption:" : "Følgende brukere er ikke satt opp for kryptering:",
"Initial encryption started... This can take some time. Please wait." : "Førstegangs kryptering startet... Dette kan ta litt tid. Vennligst vent.",
"Initial encryption running... Please try again later." : "Førstegangs kryptering kjører... Prøv igjen senere.",
+ "Missing requirements." : "Manglende krav.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Vennligst se til at OpenSSL sammen med PHP-utvidelsen er aktivert og riktig konfigurert. Krypterings-appen er foreløpig deaktivert.",
+ "Following users are not set up for encryption:" : "Følgende brukere er ikke satt opp for kryptering:",
"Go directly to your %spersonal settings%s." : "Gå direkte til dine %spersonlige innstillinger%s.",
"Encryption" : "Kryptering",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "App for kryptering er aktivert men nøklene dine er ikke satt opp. Logg ut og logg inn igjen.",
diff --git a/apps/files_encryption/l10n/nl.js b/apps/files_encryption/l10n/nl.js
index 04b2c9e8175..0400accd2bd 100644
--- a/apps/files_encryption/l10n/nl.js
+++ b/apps/files_encryption/l10n/nl.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Herhaal het nieuwe herstelwachtwoord",
"Password successfully changed." : "Wachtwoord succesvol gewijzigd.",
"Could not change the password. Maybe the old password was not correct." : "Kon wachtwoord niet wijzigen. Wellicht oude wachtwoord niet juist ingevoerd.",
+ "Could not update the private key password." : "Kon het wachtwoord van de privésleutel niet bijwerken.",
+ "The old password was not correct, please try again." : "Het oude wachtwoord was onjuist, probeer het opnieuw.",
+ "The current log-in password was not correct, please try again." : "Het huidige inlogwachtwoord was niet juist, probeer het opnieuw.",
"Private key password successfully updated." : "Privésleutel succesvol bijgewerkt.",
- "Could not update the private key password. Maybe the old password was not correct." : "Kon het wachtwoord van de privésleutel niet wijzigen. Misschien was het oude wachtwoord onjuist.",
"File recovery settings updated" : "Bestandsherstel instellingen bijgewerkt",
"Could not update file recovery" : "Kon bestandsherstel niet bijwerken",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Crypto app niet geïnitialiseerd. Misschien werd de crypto app geheractiveerd tijdens de sessie. Log uit en log daarna opnieuw in om de crypto app te initialiseren.",
@@ -22,7 +24,7 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan dit bestand niet ontcijferen, waarschijnlijk is het een gedeeld bestand, Vraag de eigenaar om het bestand opnieuw met u te delen.",
"Unknown error. Please check your system settings or contact your administrator" : "Onbekende fout. Controleer uw systeeminstellingen of neem contact op met de beheerder",
"Missing requirements." : "Missende benodigdheden.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Wees er zeker van dat PHP5.3.3 of nieuwer is geïstalleerd en dat de OpenSSL PHP extensie is ingeschakeld en correct geconfigureerd. De versleutel-app is voorlopig uitgeschakeld.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Weed er zeker van dat OpenSSL met de PHP extensie is ingeschakeld en goed geconfigureerd. Op dit moment is de encryptie app uitgeschakeld.",
"Following users are not set up for encryption:" : "De volgende gebruikers hebben geen configuratie voor encryptie:",
"Initial encryption started... This can take some time. Please wait." : "initiële versleuteling gestart... Dit kan even duren, geduld a.u.b.",
"Initial encryption running... Please try again later." : "Initiële versleuteling bezig... Probeer het later opnieuw.",
diff --git a/apps/files_encryption/l10n/nl.json b/apps/files_encryption/l10n/nl.json
index 67f0d2e4c89..eb2ea89428b 100644
--- a/apps/files_encryption/l10n/nl.json
+++ b/apps/files_encryption/l10n/nl.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Herhaal het nieuwe herstelwachtwoord",
"Password successfully changed." : "Wachtwoord succesvol gewijzigd.",
"Could not change the password. Maybe the old password was not correct." : "Kon wachtwoord niet wijzigen. Wellicht oude wachtwoord niet juist ingevoerd.",
+ "Could not update the private key password." : "Kon het wachtwoord van de privésleutel niet bijwerken.",
+ "The old password was not correct, please try again." : "Het oude wachtwoord was onjuist, probeer het opnieuw.",
+ "The current log-in password was not correct, please try again." : "Het huidige inlogwachtwoord was niet juist, probeer het opnieuw.",
"Private key password successfully updated." : "Privésleutel succesvol bijgewerkt.",
- "Could not update the private key password. Maybe the old password was not correct." : "Kon het wachtwoord van de privésleutel niet wijzigen. Misschien was het oude wachtwoord onjuist.",
"File recovery settings updated" : "Bestandsherstel instellingen bijgewerkt",
"Could not update file recovery" : "Kon bestandsherstel niet bijwerken",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Crypto app niet geïnitialiseerd. Misschien werd de crypto app geheractiveerd tijdens de sessie. Log uit en log daarna opnieuw in om de crypto app te initialiseren.",
@@ -20,7 +22,7 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan dit bestand niet ontcijferen, waarschijnlijk is het een gedeeld bestand, Vraag de eigenaar om het bestand opnieuw met u te delen.",
"Unknown error. Please check your system settings or contact your administrator" : "Onbekende fout. Controleer uw systeeminstellingen of neem contact op met de beheerder",
"Missing requirements." : "Missende benodigdheden.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Wees er zeker van dat PHP5.3.3 of nieuwer is geïstalleerd en dat de OpenSSL PHP extensie is ingeschakeld en correct geconfigureerd. De versleutel-app is voorlopig uitgeschakeld.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Weed er zeker van dat OpenSSL met de PHP extensie is ingeschakeld en goed geconfigureerd. Op dit moment is de encryptie app uitgeschakeld.",
"Following users are not set up for encryption:" : "De volgende gebruikers hebben geen configuratie voor encryptie:",
"Initial encryption started... This can take some time. Please wait." : "initiële versleuteling gestart... Dit kan even duren, geduld a.u.b.",
"Initial encryption running... Please try again later." : "Initiële versleuteling bezig... Probeer het later opnieuw.",
diff --git a/apps/files_encryption/l10n/pl.js b/apps/files_encryption/l10n/pl.js
index a0bccc8c9f2..26f3cff7397 100644
--- a/apps/files_encryption/l10n/pl.js
+++ b/apps/files_encryption/l10n/pl.js
@@ -2,14 +2,21 @@ OC.L10N.register(
"files_encryption",
{
"Unknown error" : "Nieznany błąd",
+ "Missing recovery key password" : "Brakujące hasło klucza odzyskiwania",
"Please repeat the recovery key password" : "Proszę powtórz nowe hasło klucza odzyskiwania",
+ "Repeated recovery key password does not match the provided recovery key password" : "Hasła klucza odzyskiwania nie zgadzają się",
"Recovery key successfully enabled" : "Klucz odzyskiwania włączony",
"Could not disable recovery key. Please check your recovery key password!" : "Nie można wyłączyć klucza odzyskiwania. Proszę sprawdzić swoje hasło odzyskiwania!",
"Recovery key successfully disabled" : "Klucz odzyskiwania wyłączony",
+ "Please provide the old recovery password" : "Podaj stare hasło odzyskiwania",
+ "Please provide a new recovery password" : "Podaj nowe hasło odzyskiwania",
+ "Please repeat the new recovery password" : "Proszę powtórz nowe hasło odzyskiwania",
"Password successfully changed." : "Zmiana hasła udana.",
"Could not change the password. Maybe the old password was not correct." : "Nie można zmienić hasła. Może stare hasło nie było poprawne.",
+ "Could not update the private key password." : "Nie można zmienić hasła klucza prywatnego.",
+ "The old password was not correct, please try again." : "Stare hasło nie było poprawne. Spróbuj jeszcze raz.",
+ "The current log-in password was not correct, please try again." : "Obecne hasło logowania nie było poprawne. Spróbuj ponownie.",
"Private key password successfully updated." : "Pomyślnie zaktualizowano hasło klucza prywatnego.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nie można zmienić prywatnego hasła. Może stare hasło nie było poprawne.",
"File recovery settings updated" : "Ustawienia odzyskiwania plików zmienione",
"Could not update file recovery" : "Nie można zmienić pliku odzyskiwania",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Szyfrowanie aplikacja nie została zainicjowane! Może szyfrowanie aplikacji zostało ponownie włączone podczas tej sesji. Spróbuj się wylogować i zalogować ponownie aby zainicjować szyfrowanie aplikacji.",
@@ -17,7 +24,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Nie można odszyfrować tego pliku, prawdopodobnie jest to plik udostępniony. Poproś właściciela pliku o ponowne udostępnianie pliku Tobie.",
"Unknown error. Please check your system settings or contact your administrator" : "Nieznany błąd. Proszę sprawdzić ustawienia systemowe lub skontaktować się z administratorem",
"Missing requirements." : "Brak wymagań.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Proszę upewnić się, że PHP 5.3.3 lub nowszy jest zainstalowany i że OpenSSL oraz rozszerzenie PHP jest włączone i poprawnie skonfigurowane. Obecnie szyfrowanie aplikacji zostało wyłączone.",
"Following users are not set up for encryption:" : "Następujący użytkownicy nie mają skonfigurowanego szyfrowania:",
"Initial encryption started... This can take some time. Please wait." : "Rozpoczęto szyfrowanie... To może chwilę potrwać. Proszę czekać.",
"Initial encryption running... Please try again later." : "Trwa szyfrowanie początkowe...Spróbuj ponownie.",
diff --git a/apps/files_encryption/l10n/pl.json b/apps/files_encryption/l10n/pl.json
index dd817a40542..ae2b3f06218 100644
--- a/apps/files_encryption/l10n/pl.json
+++ b/apps/files_encryption/l10n/pl.json
@@ -1,13 +1,20 @@
{ "translations": {
"Unknown error" : "Nieznany błąd",
+ "Missing recovery key password" : "Brakujące hasło klucza odzyskiwania",
"Please repeat the recovery key password" : "Proszę powtórz nowe hasło klucza odzyskiwania",
+ "Repeated recovery key password does not match the provided recovery key password" : "Hasła klucza odzyskiwania nie zgadzają się",
"Recovery key successfully enabled" : "Klucz odzyskiwania włączony",
"Could not disable recovery key. Please check your recovery key password!" : "Nie można wyłączyć klucza odzyskiwania. Proszę sprawdzić swoje hasło odzyskiwania!",
"Recovery key successfully disabled" : "Klucz odzyskiwania wyłączony",
+ "Please provide the old recovery password" : "Podaj stare hasło odzyskiwania",
+ "Please provide a new recovery password" : "Podaj nowe hasło odzyskiwania",
+ "Please repeat the new recovery password" : "Proszę powtórz nowe hasło odzyskiwania",
"Password successfully changed." : "Zmiana hasła udana.",
"Could not change the password. Maybe the old password was not correct." : "Nie można zmienić hasła. Może stare hasło nie było poprawne.",
+ "Could not update the private key password." : "Nie można zmienić hasła klucza prywatnego.",
+ "The old password was not correct, please try again." : "Stare hasło nie było poprawne. Spróbuj jeszcze raz.",
+ "The current log-in password was not correct, please try again." : "Obecne hasło logowania nie było poprawne. Spróbuj ponownie.",
"Private key password successfully updated." : "Pomyślnie zaktualizowano hasło klucza prywatnego.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nie można zmienić prywatnego hasła. Może stare hasło nie było poprawne.",
"File recovery settings updated" : "Ustawienia odzyskiwania plików zmienione",
"Could not update file recovery" : "Nie można zmienić pliku odzyskiwania",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Szyfrowanie aplikacja nie została zainicjowane! Może szyfrowanie aplikacji zostało ponownie włączone podczas tej sesji. Spróbuj się wylogować i zalogować ponownie aby zainicjować szyfrowanie aplikacji.",
@@ -15,7 +22,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Nie można odszyfrować tego pliku, prawdopodobnie jest to plik udostępniony. Poproś właściciela pliku o ponowne udostępnianie pliku Tobie.",
"Unknown error. Please check your system settings or contact your administrator" : "Nieznany błąd. Proszę sprawdzić ustawienia systemowe lub skontaktować się z administratorem",
"Missing requirements." : "Brak wymagań.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Proszę upewnić się, że PHP 5.3.3 lub nowszy jest zainstalowany i że OpenSSL oraz rozszerzenie PHP jest włączone i poprawnie skonfigurowane. Obecnie szyfrowanie aplikacji zostało wyłączone.",
"Following users are not set up for encryption:" : "Następujący użytkownicy nie mają skonfigurowanego szyfrowania:",
"Initial encryption started... This can take some time. Please wait." : "Rozpoczęto szyfrowanie... To może chwilę potrwać. Proszę czekać.",
"Initial encryption running... Please try again later." : "Trwa szyfrowanie początkowe...Spróbuj ponownie.",
diff --git a/apps/files_encryption/l10n/pt_BR.js b/apps/files_encryption/l10n/pt_BR.js
index 3849876d602..2bcf3bc345b 100644
--- a/apps/files_encryption/l10n/pt_BR.js
+++ b/apps/files_encryption/l10n/pt_BR.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Por favor, repita a nova senha de recuperação",
"Password successfully changed." : "Senha alterada com sucesso.",
"Could not change the password. Maybe the old password was not correct." : "Não foi possível alterar a senha. Talvez a senha antiga não estava correta.",
+ "Could not update the private key password." : "Não foi possível atualizar a senha da chave privada.",
+ "The old password was not correct, please try again." : "A senha antiga não estava correta, por favor, tente novamente.",
+ "The current log-in password was not correct, please try again." : "A senha atual do log-in não estava correta, por favor, tente novamente.",
"Private key password successfully updated." : "Senha de chave privada atualizada com sucesso.",
- "Could not update the private key password. Maybe the old password was not correct." : "Não foi possível atualizar a senha de chave privada. Talvez a senha antiga esteja incorreta.",
"File recovery settings updated" : "Configurações de recuperação de arquivo atualizado",
"Could not update file recovery" : "Não foi possível atualizar a recuperação de arquivos",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Aplicativo de criptografia não foi inicializado! Talvez o aplicativo de criptografia tenha sido reativado durante essa sessão. Por favor, tente fazer logoff e login novamente para inicializar o aplicativo de criptografia.",
@@ -22,7 +24,7 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Este arquivo não pode ser decriptado, provavelmente este é um arquivo compartilhado. Poe favoe peça ao dono do arquivo para compartilha-lo com você.",
"Unknown error. Please check your system settings or contact your administrator" : "Erro desconhecido. Por favor, verifique as configurações do sistema ou entre em contato com o administrador",
"Missing requirements." : "Requisitos não encontrados.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, certifique-se que o PHP 5.3.3 ou mais recente está instalado e que a extensão PHP OpenSSL está habilitado e configurado corretamente. Por enquanto, o aplicativo de criptografia foi desativado.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, certifique-se de que o OpenSSL em conjunto com a extensão PHP está habilitado e configurado corretamente. Por enquanto, o aplicativo de criptografia foi desativado.",
"Following users are not set up for encryption:" : "Seguintes usuários não estão configurados para criptografia:",
"Initial encryption started... This can take some time. Please wait." : "Criptografia inicial inicializada... Isto pode tomar algum tempo. Por favor espere.",
"Initial encryption running... Please try again later." : "Criptografia inicial em execução ... Por favor, tente novamente mais tarde.",
diff --git a/apps/files_encryption/l10n/pt_BR.json b/apps/files_encryption/l10n/pt_BR.json
index 6627951f8f0..d078c218ad3 100644
--- a/apps/files_encryption/l10n/pt_BR.json
+++ b/apps/files_encryption/l10n/pt_BR.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Por favor, repita a nova senha de recuperação",
"Password successfully changed." : "Senha alterada com sucesso.",
"Could not change the password. Maybe the old password was not correct." : "Não foi possível alterar a senha. Talvez a senha antiga não estava correta.",
+ "Could not update the private key password." : "Não foi possível atualizar a senha da chave privada.",
+ "The old password was not correct, please try again." : "A senha antiga não estava correta, por favor, tente novamente.",
+ "The current log-in password was not correct, please try again." : "A senha atual do log-in não estava correta, por favor, tente novamente.",
"Private key password successfully updated." : "Senha de chave privada atualizada com sucesso.",
- "Could not update the private key password. Maybe the old password was not correct." : "Não foi possível atualizar a senha de chave privada. Talvez a senha antiga esteja incorreta.",
"File recovery settings updated" : "Configurações de recuperação de arquivo atualizado",
"Could not update file recovery" : "Não foi possível atualizar a recuperação de arquivos",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Aplicativo de criptografia não foi inicializado! Talvez o aplicativo de criptografia tenha sido reativado durante essa sessão. Por favor, tente fazer logoff e login novamente para inicializar o aplicativo de criptografia.",
@@ -20,7 +22,7 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Este arquivo não pode ser decriptado, provavelmente este é um arquivo compartilhado. Poe favoe peça ao dono do arquivo para compartilha-lo com você.",
"Unknown error. Please check your system settings or contact your administrator" : "Erro desconhecido. Por favor, verifique as configurações do sistema ou entre em contato com o administrador",
"Missing requirements." : "Requisitos não encontrados.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, certifique-se que o PHP 5.3.3 ou mais recente está instalado e que a extensão PHP OpenSSL está habilitado e configurado corretamente. Por enquanto, o aplicativo de criptografia foi desativado.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, certifique-se de que o OpenSSL em conjunto com a extensão PHP está habilitado e configurado corretamente. Por enquanto, o aplicativo de criptografia foi desativado.",
"Following users are not set up for encryption:" : "Seguintes usuários não estão configurados para criptografia:",
"Initial encryption started... This can take some time. Please wait." : "Criptografia inicial inicializada... Isto pode tomar algum tempo. Por favor espere.",
"Initial encryption running... Please try again later." : "Criptografia inicial em execução ... Por favor, tente novamente mais tarde.",
diff --git a/apps/files_encryption/l10n/pt_PT.js b/apps/files_encryption/l10n/pt_PT.js
index 3f785d9d29e..b08e0c4b05c 100644
--- a/apps/files_encryption/l10n/pt_PT.js
+++ b/apps/files_encryption/l10n/pt_PT.js
@@ -1,9 +1,9 @@
OC.L10N.register(
"files_encryption",
{
- "Unknown error" : "Erro Desconhecido",
- "Missing recovery key password" : "Palavra-passe de recuperação em falta",
- "Please repeat the recovery key password" : "Repita a palavra-passe de recuperação",
+ "Unknown error" : "Erro desconhecido",
+ "Missing recovery key password" : "Senha da chave de recuperação em falta",
+ "Please repeat the recovery key password" : "Por favor, insira a contrassenha da chave de recuperação",
"Repeated recovery key password does not match the provided recovery key password" : "A palavra-passe de recuperação repetida não corresponde à palavra-passe fornecida",
"Recovery key successfully enabled" : "A chave de recuperação foi ativada com sucesso",
"Could not disable recovery key. Please check your recovery key password!" : "Não foi possível desativar a chave de recuperação. Por favor, verifique a senha da chave de recuperação.",
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Escreva de novo a nova palavra-passe de recuperação",
"Password successfully changed." : "Senha alterada com sucesso.",
"Could not change the password. Maybe the old password was not correct." : "Não foi possível alterar a senha. Possivelmente a senha antiga não está correta.",
+ "Could not update the private key password." : "Não foi possível atualizar a senha da chave privada.",
+ "The old password was not correct, please try again." : "A senha antiga não estava correta, por favor, tente de novo.",
+ "The current log-in password was not correct, please try again." : "A senha de iniciar a sessão atual não estava correta, por favor, tente de novo.",
"Private key password successfully updated." : "A senha da chave privada foi atualizada com sucesso. ",
- "Could not update the private key password. Maybe the old password was not correct." : "Não foi possível atualizar a senha da chave privada. A senha antiga poderia não estar correta.",
"File recovery settings updated" : "As definições da recuperação de ficheiro foram atualizadas",
"Could not update file recovery" : "Não foi possível atualizar a recuperação de ficheiro",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "A app de encriptação não foi inicializada! A app de encriptação poderá ter sido reativada durante a sua sessão. Por favor, tente terminar a sessão e iniciá-la de seguida para inicializar a app de encriptação.",
@@ -22,7 +24,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Não é possível desencriptar este ficheiro, provavelmente é um ficheiro partilhado. Por favor, peça ao proprietário do ficheiro para voltar a partilhar o ficheiro consigo.",
"Unknown error. Please check your system settings or contact your administrator" : "Erro desconhecido. Por favor, verifique as configurações do sistema ou entre em contacto com o seu administrador ",
"Missing requirements." : "Requisitos em falta.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, certifique-se que o PHP 5.3.3 ou superior está instalado e que o OpenSSL juntamente com a extensão PHP estão ativados e devidamente configurados. Por agora, a app de encriptação foi desativada.",
"Following users are not set up for encryption:" : "Os utilizadores seguintes não estão configurados para encriptação:",
"Initial encryption started... This can take some time. Please wait." : "A encriptação inicial foi iniciada ... Esta pode demorar algum tempo. Aguarde, por favor.",
"Initial encryption running... Please try again later." : "A encriptação inicial está em execução ... Por favor, tente de novo mais tarde.",
diff --git a/apps/files_encryption/l10n/pt_PT.json b/apps/files_encryption/l10n/pt_PT.json
index 40af81afcb4..b51554eaae3 100644
--- a/apps/files_encryption/l10n/pt_PT.json
+++ b/apps/files_encryption/l10n/pt_PT.json
@@ -1,7 +1,7 @@
{ "translations": {
- "Unknown error" : "Erro Desconhecido",
- "Missing recovery key password" : "Palavra-passe de recuperação em falta",
- "Please repeat the recovery key password" : "Repita a palavra-passe de recuperação",
+ "Unknown error" : "Erro desconhecido",
+ "Missing recovery key password" : "Senha da chave de recuperação em falta",
+ "Please repeat the recovery key password" : "Por favor, insira a contrassenha da chave de recuperação",
"Repeated recovery key password does not match the provided recovery key password" : "A palavra-passe de recuperação repetida não corresponde à palavra-passe fornecida",
"Recovery key successfully enabled" : "A chave de recuperação foi ativada com sucesso",
"Could not disable recovery key. Please check your recovery key password!" : "Não foi possível desativar a chave de recuperação. Por favor, verifique a senha da chave de recuperação.",
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Escreva de novo a nova palavra-passe de recuperação",
"Password successfully changed." : "Senha alterada com sucesso.",
"Could not change the password. Maybe the old password was not correct." : "Não foi possível alterar a senha. Possivelmente a senha antiga não está correta.",
+ "Could not update the private key password." : "Não foi possível atualizar a senha da chave privada.",
+ "The old password was not correct, please try again." : "A senha antiga não estava correta, por favor, tente de novo.",
+ "The current log-in password was not correct, please try again." : "A senha de iniciar a sessão atual não estava correta, por favor, tente de novo.",
"Private key password successfully updated." : "A senha da chave privada foi atualizada com sucesso. ",
- "Could not update the private key password. Maybe the old password was not correct." : "Não foi possível atualizar a senha da chave privada. A senha antiga poderia não estar correta.",
"File recovery settings updated" : "As definições da recuperação de ficheiro foram atualizadas",
"Could not update file recovery" : "Não foi possível atualizar a recuperação de ficheiro",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "A app de encriptação não foi inicializada! A app de encriptação poderá ter sido reativada durante a sua sessão. Por favor, tente terminar a sessão e iniciá-la de seguida para inicializar a app de encriptação.",
@@ -20,7 +22,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Não é possível desencriptar este ficheiro, provavelmente é um ficheiro partilhado. Por favor, peça ao proprietário do ficheiro para voltar a partilhar o ficheiro consigo.",
"Unknown error. Please check your system settings or contact your administrator" : "Erro desconhecido. Por favor, verifique as configurações do sistema ou entre em contacto com o seu administrador ",
"Missing requirements." : "Requisitos em falta.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Por favor, certifique-se que o PHP 5.3.3 ou superior está instalado e que o OpenSSL juntamente com a extensão PHP estão ativados e devidamente configurados. Por agora, a app de encriptação foi desativada.",
"Following users are not set up for encryption:" : "Os utilizadores seguintes não estão configurados para encriptação:",
"Initial encryption started... This can take some time. Please wait." : "A encriptação inicial foi iniciada ... Esta pode demorar algum tempo. Aguarde, por favor.",
"Initial encryption running... Please try again later." : "A encriptação inicial está em execução ... Por favor, tente de novo mais tarde.",
diff --git a/apps/files_encryption/l10n/ro.js b/apps/files_encryption/l10n/ro.js
index 822cc4be58d..91f657d18f0 100644
--- a/apps/files_encryption/l10n/ro.js
+++ b/apps/files_encryption/l10n/ro.js
@@ -8,7 +8,6 @@ OC.L10N.register(
"Password successfully changed." : "Parola a fost modificată cu succes.",
"Could not change the password. Maybe the old password was not correct." : "Parola nu a putut fi schimbata. Poate ca parola veche este incorecta.",
"Private key password successfully updated." : "Cheia privata a fost actualizata cu succes",
- "Could not update the private key password. Maybe the old password was not correct." : "Nu am putut actualiza parola pentru cheia privata. Poate ca parola veche este incorecta.",
"File recovery settings updated" : "Setarile pentru recuperarea fisierelor au fost actualizate",
"Could not update file recovery" : "Nu am putut actualiza recuperarea de fisiere",
"Encryption" : "Încriptare",
diff --git a/apps/files_encryption/l10n/ro.json b/apps/files_encryption/l10n/ro.json
index 3ac528a60ce..3c32f040aec 100644
--- a/apps/files_encryption/l10n/ro.json
+++ b/apps/files_encryption/l10n/ro.json
@@ -6,7 +6,6 @@
"Password successfully changed." : "Parola a fost modificată cu succes.",
"Could not change the password. Maybe the old password was not correct." : "Parola nu a putut fi schimbata. Poate ca parola veche este incorecta.",
"Private key password successfully updated." : "Cheia privata a fost actualizata cu succes",
- "Could not update the private key password. Maybe the old password was not correct." : "Nu am putut actualiza parola pentru cheia privata. Poate ca parola veche este incorecta.",
"File recovery settings updated" : "Setarile pentru recuperarea fisierelor au fost actualizate",
"Could not update file recovery" : "Nu am putut actualiza recuperarea de fisiere",
"Encryption" : "Încriptare",
diff --git a/apps/files_encryption/l10n/ru.js b/apps/files_encryption/l10n/ru.js
index 2d035d75f5e..055fea5cddd 100644
--- a/apps/files_encryption/l10n/ru.js
+++ b/apps/files_encryption/l10n/ru.js
@@ -3,48 +3,50 @@ OC.L10N.register(
{
"Unknown error" : "Неизвестная ошибка",
"Missing recovery key password" : "Отсутствует пароль восстановления ключа",
- "Please repeat the recovery key password" : "Пожалуйста, повторите пароль восстановления ключа",
- "Repeated recovery key password does not match the provided recovery key password" : "Пароль восстановления ключа и его повтор не совпадают",
+ "Please repeat the recovery key password" : "Повторите ввод пароля ключа восстановления",
+ "Repeated recovery key password does not match the provided recovery key password" : "Пароль ключа восстановления и повтор пароля не совпадают",
"Recovery key successfully enabled" : "Ключ восстановления успешно установлен",
"Could not disable recovery key. Please check your recovery key password!" : "Невозможно выключить ключ восстановления. Проверьте правильность пароля от ключа!",
"Recovery key successfully disabled" : "Ключ восстановления успешно отключен",
- "Please provide the old recovery password" : "Пожалуйста, введите старый пароль для восстановления",
- "Please provide a new recovery password" : "Пожалуйста, введите новый пароль для восстановления",
- "Please repeat the new recovery password" : "Пожалуйста, повторите новый пароль для восстановления",
- "Password successfully changed." : "Пароль изменен удачно.",
- "Could not change the password. Maybe the old password was not correct." : "Невозможно изменить пароль. Возможно старый пароль не был верен.",
- "Private key password successfully updated." : "Пароль секретного ключа успешно обновлён.",
- "Could not update the private key password. Maybe the old password was not correct." : "Невозможно обновить пароль от секретного ключа. Возможно, старый пароль указан неверно.",
- "File recovery settings updated" : "Настройки файла восстановления обновлены",
- "Could not update file recovery" : "Невозможно обновить файл восстановления",
- "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Приложение шифрации не инициализированно! Возможно приложение шифрации было реактивировано во время вашей сессии. Пожалуйста, попробуйте выйти и войти снова чтобы проинициализировать приложение шифрации.",
- "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Ваш секретный ключ не действителен! Вероятно, ваш пароль был изменен вне %s (например, корпоративный каталог). Вы можете обновить секретный ключ в личных настройках на странице восстановления доступа к зашифрованным файлам. ",
- "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Не могу расшифровать файл, возможно это опубликованный файл. Пожалуйста, попросите владельца файла поделиться им с вами еще раз.",
- "Unknown error. Please check your system settings or contact your administrator" : "Неизвестная ошибка. Пожалуйста, проверьте системные настройки или свяжитесь с администратором",
- "Missing requirements." : "Требования отсутствуют.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Пожалуйста, убедитесь, что версия PHP 5.3.3 или новее, а также, что OpenSSL и соответствующее расширение PHP включены и правильно настроены. На данный момент приложение шифрования отключено.",
- "Following users are not set up for encryption:" : "Для следующих пользователей шифрование не настроено:",
- "Initial encryption started... This can take some time. Please wait." : "Начато начальное шифрование... Это может занять какое-то время. Пожалуйста, подождите.",
+ "Please provide the old recovery password" : "Введите старый пароль восстановления",
+ "Please provide a new recovery password" : "Введите новый пароль восстановления",
+ "Please repeat the new recovery password" : "Повторите новый пароль восстановления",
+ "Password successfully changed." : "Пароль успешно изменен.",
+ "Could not change the password. Maybe the old password was not correct." : "Невозможно изменить пароль. Возможно, указанный старый пароль не верен.",
+ "Could not update the private key password." : "Невозможно обновить пароль закрытого ключа.",
+ "The old password was not correct, please try again." : "Указан неверный старый пароль, повторите попытку.",
+ "The current log-in password was not correct, please try again." : "Текущий пароль для учётной записи введён неверно, пожалуйста повторите попытку.",
+ "Private key password successfully updated." : "Пароль закрытого ключа успешно обновлён.",
+ "File recovery settings updated" : "Настройки восстановления файлов обновлены",
+ "Could not update file recovery" : "Невозможно обновить настройки восстановления файлов",
+ "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Приложение шифрования не инициализированно! Возможно приложение шифрования было реактивировано во время вашей сессии. Попробуйте выйти и войти снова чтобы проинициализировать приложение шифрования.",
+ "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Закрытый ключ недействителен! Вероятно, пароль был изменен вне %s (например, корпоративный каталог). Вы можете обновить закрытый ключ в личных настройках на странице восстановления доступа к зашифрованным файлам. ",
+ "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Не удалось расшифровать файл, возможно это опубликованный файл. Попросите владельца файла повторно открыть к нему доступ.",
+ "Unknown error. Please check your system settings or contact your administrator" : "Неизвестная ошибка. Проверьте системные настройки или свяжитесь с вашим администратором",
+ "Initial encryption started... This can take some time. Please wait." : "Запущено первоначальное шифрование... Это может занять некоторое время. Пожалуйста, подождите.",
"Initial encryption running... Please try again later." : "Работает первоначальное шифрование... Пожалуйста, повторите попытку позже.",
- "Go directly to your %spersonal settings%s." : "Перейти напряму к вашим %spersonal settings%s.",
+ "Missing requirements." : "Отсутствуют зависимости.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Убедитесь, что OpenSSL и соответствующее расширение PHP включены и правильно настроены. На данный момент приложение шифрования выключено.",
+ "Following users are not set up for encryption:" : "Для следующих пользователей шифрование не настроено:",
+ "Go directly to your %spersonal settings%s." : "Перейти к вашим %spersonal settings%s.",
"Encryption" : "Шифрование",
- "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Приложение для шифрования активно, но ваши ключи не инициализированы, пожалуйста, перелогиньтесь",
+ "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Приложение шифрования активно, но ваши ключи не инициализированы, выйдите из системы и войдите вновь",
"Enable recovery key (allow to recover users files in case of password loss):" : "Включить ключ восстановления (позволяет пользователям восстановить файлы при потере пароля):",
- "Recovery key password" : "Пароль для ключа восстановления",
- "Repeat Recovery key password" : "Повторите пароль восстановления ключа",
+ "Recovery key password" : "Пароль ключа восстановления",
+ "Repeat Recovery key password" : "Повторите пароль ключа восстановления",
"Enabled" : "Включено",
"Disabled" : "Отключено",
- "Change recovery key password:" : "Сменить пароль для ключа восстановления:",
- "Old Recovery key password" : "Старый пароль для ключа восстановления",
- "New Recovery key password" : "Новый пароль для ключа восстановления",
- "Repeat New Recovery key password" : "Повторите новый пароль восстановления ключа",
+ "Change recovery key password:" : "Сменить пароль ключа восстановления:",
+ "Old Recovery key password" : "Старый пароль ключа восстановления",
+ "New Recovery key password" : "Новый пароль ключа восстановления",
+ "Repeat New Recovery key password" : "Повторите новый пароль ключа восстановления",
"Change Password" : "Изменить пароль",
- "Your private key password no longer matches your log-in password." : "Пароль от Вашего закрытого ключа больше не соответствует паролю от вашей учетной записи.",
- "Set your old private key password to your current log-in password:" : "Замените старый пароль от закрытого ключа на новый пароль входа.",
+ "Your private key password no longer matches your log-in password." : "Пароль закрытого ключа больше не соответствует паролю вашей учетной записи.",
+ "Set your old private key password to your current log-in password:" : "Замените старый пароль закрытого ключа на текущий пароль учётной записи.",
" If you don't remember your old password you can ask your administrator to recover your files." : "Если вы не помните свой старый пароль, вы можете попросить своего администратора восстановить ваши файлы",
- "Old log-in password" : "Старый пароль для входа",
- "Current log-in password" : "Текущйи пароль для входа",
- "Update Private Key Password" : "Обновить пароль от секретного ключа",
+ "Old log-in password" : "Старый пароль учётной записи",
+ "Current log-in password" : "Текущий пароль учётной записи",
+ "Update Private Key Password" : "Обновить пароль закрытого ключа",
"Enable password recovery:" : "Включить восстановление пароля:",
"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" : "Включение этой опции позволит вам получить доступ к своим зашифрованным файлам в случае утери пароля"
},
diff --git a/apps/files_encryption/l10n/ru.json b/apps/files_encryption/l10n/ru.json
index ce66622d6be..fd9fc6d49fd 100644
--- a/apps/files_encryption/l10n/ru.json
+++ b/apps/files_encryption/l10n/ru.json
@@ -1,48 +1,50 @@
{ "translations": {
"Unknown error" : "Неизвестная ошибка",
"Missing recovery key password" : "Отсутствует пароль восстановления ключа",
- "Please repeat the recovery key password" : "Пожалуйста, повторите пароль восстановления ключа",
- "Repeated recovery key password does not match the provided recovery key password" : "Пароль восстановления ключа и его повтор не совпадают",
+ "Please repeat the recovery key password" : "Повторите ввод пароля ключа восстановления",
+ "Repeated recovery key password does not match the provided recovery key password" : "Пароль ключа восстановления и повтор пароля не совпадают",
"Recovery key successfully enabled" : "Ключ восстановления успешно установлен",
"Could not disable recovery key. Please check your recovery key password!" : "Невозможно выключить ключ восстановления. Проверьте правильность пароля от ключа!",
"Recovery key successfully disabled" : "Ключ восстановления успешно отключен",
- "Please provide the old recovery password" : "Пожалуйста, введите старый пароль для восстановления",
- "Please provide a new recovery password" : "Пожалуйста, введите новый пароль для восстановления",
- "Please repeat the new recovery password" : "Пожалуйста, повторите новый пароль для восстановления",
- "Password successfully changed." : "Пароль изменен удачно.",
- "Could not change the password. Maybe the old password was not correct." : "Невозможно изменить пароль. Возможно старый пароль не был верен.",
- "Private key password successfully updated." : "Пароль секретного ключа успешно обновлён.",
- "Could not update the private key password. Maybe the old password was not correct." : "Невозможно обновить пароль от секретного ключа. Возможно, старый пароль указан неверно.",
- "File recovery settings updated" : "Настройки файла восстановления обновлены",
- "Could not update file recovery" : "Невозможно обновить файл восстановления",
- "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Приложение шифрации не инициализированно! Возможно приложение шифрации было реактивировано во время вашей сессии. Пожалуйста, попробуйте выйти и войти снова чтобы проинициализировать приложение шифрации.",
- "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Ваш секретный ключ не действителен! Вероятно, ваш пароль был изменен вне %s (например, корпоративный каталог). Вы можете обновить секретный ключ в личных настройках на странице восстановления доступа к зашифрованным файлам. ",
- "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Не могу расшифровать файл, возможно это опубликованный файл. Пожалуйста, попросите владельца файла поделиться им с вами еще раз.",
- "Unknown error. Please check your system settings or contact your administrator" : "Неизвестная ошибка. Пожалуйста, проверьте системные настройки или свяжитесь с администратором",
- "Missing requirements." : "Требования отсутствуют.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Пожалуйста, убедитесь, что версия PHP 5.3.3 или новее, а также, что OpenSSL и соответствующее расширение PHP включены и правильно настроены. На данный момент приложение шифрования отключено.",
- "Following users are not set up for encryption:" : "Для следующих пользователей шифрование не настроено:",
- "Initial encryption started... This can take some time. Please wait." : "Начато начальное шифрование... Это может занять какое-то время. Пожалуйста, подождите.",
+ "Please provide the old recovery password" : "Введите старый пароль восстановления",
+ "Please provide a new recovery password" : "Введите новый пароль восстановления",
+ "Please repeat the new recovery password" : "Повторите новый пароль восстановления",
+ "Password successfully changed." : "Пароль успешно изменен.",
+ "Could not change the password. Maybe the old password was not correct." : "Невозможно изменить пароль. Возможно, указанный старый пароль не верен.",
+ "Could not update the private key password." : "Невозможно обновить пароль закрытого ключа.",
+ "The old password was not correct, please try again." : "Указан неверный старый пароль, повторите попытку.",
+ "The current log-in password was not correct, please try again." : "Текущий пароль для учётной записи введён неверно, пожалуйста повторите попытку.",
+ "Private key password successfully updated." : "Пароль закрытого ключа успешно обновлён.",
+ "File recovery settings updated" : "Настройки восстановления файлов обновлены",
+ "Could not update file recovery" : "Невозможно обновить настройки восстановления файлов",
+ "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Приложение шифрования не инициализированно! Возможно приложение шифрования было реактивировано во время вашей сессии. Попробуйте выйти и войти снова чтобы проинициализировать приложение шифрования.",
+ "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Закрытый ключ недействителен! Вероятно, пароль был изменен вне %s (например, корпоративный каталог). Вы можете обновить закрытый ключ в личных настройках на странице восстановления доступа к зашифрованным файлам. ",
+ "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Не удалось расшифровать файл, возможно это опубликованный файл. Попросите владельца файла повторно открыть к нему доступ.",
+ "Unknown error. Please check your system settings or contact your administrator" : "Неизвестная ошибка. Проверьте системные настройки или свяжитесь с вашим администратором",
+ "Initial encryption started... This can take some time. Please wait." : "Запущено первоначальное шифрование... Это может занять некоторое время. Пожалуйста, подождите.",
"Initial encryption running... Please try again later." : "Работает первоначальное шифрование... Пожалуйста, повторите попытку позже.",
- "Go directly to your %spersonal settings%s." : "Перейти напряму к вашим %spersonal settings%s.",
+ "Missing requirements." : "Отсутствуют зависимости.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Убедитесь, что OpenSSL и соответствующее расширение PHP включены и правильно настроены. На данный момент приложение шифрования выключено.",
+ "Following users are not set up for encryption:" : "Для следующих пользователей шифрование не настроено:",
+ "Go directly to your %spersonal settings%s." : "Перейти к вашим %spersonal settings%s.",
"Encryption" : "Шифрование",
- "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Приложение для шифрования активно, но ваши ключи не инициализированы, пожалуйста, перелогиньтесь",
+ "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Приложение шифрования активно, но ваши ключи не инициализированы, выйдите из системы и войдите вновь",
"Enable recovery key (allow to recover users files in case of password loss):" : "Включить ключ восстановления (позволяет пользователям восстановить файлы при потере пароля):",
- "Recovery key password" : "Пароль для ключа восстановления",
- "Repeat Recovery key password" : "Повторите пароль восстановления ключа",
+ "Recovery key password" : "Пароль ключа восстановления",
+ "Repeat Recovery key password" : "Повторите пароль ключа восстановления",
"Enabled" : "Включено",
"Disabled" : "Отключено",
- "Change recovery key password:" : "Сменить пароль для ключа восстановления:",
- "Old Recovery key password" : "Старый пароль для ключа восстановления",
- "New Recovery key password" : "Новый пароль для ключа восстановления",
- "Repeat New Recovery key password" : "Повторите новый пароль восстановления ключа",
+ "Change recovery key password:" : "Сменить пароль ключа восстановления:",
+ "Old Recovery key password" : "Старый пароль ключа восстановления",
+ "New Recovery key password" : "Новый пароль ключа восстановления",
+ "Repeat New Recovery key password" : "Повторите новый пароль ключа восстановления",
"Change Password" : "Изменить пароль",
- "Your private key password no longer matches your log-in password." : "Пароль от Вашего закрытого ключа больше не соответствует паролю от вашей учетной записи.",
- "Set your old private key password to your current log-in password:" : "Замените старый пароль от закрытого ключа на новый пароль входа.",
+ "Your private key password no longer matches your log-in password." : "Пароль закрытого ключа больше не соответствует паролю вашей учетной записи.",
+ "Set your old private key password to your current log-in password:" : "Замените старый пароль закрытого ключа на текущий пароль учётной записи.",
" If you don't remember your old password you can ask your administrator to recover your files." : "Если вы не помните свой старый пароль, вы можете попросить своего администратора восстановить ваши файлы",
- "Old log-in password" : "Старый пароль для входа",
- "Current log-in password" : "Текущйи пароль для входа",
- "Update Private Key Password" : "Обновить пароль от секретного ключа",
+ "Old log-in password" : "Старый пароль учётной записи",
+ "Current log-in password" : "Текущий пароль учётной записи",
+ "Update Private Key Password" : "Обновить пароль закрытого ключа",
"Enable password recovery:" : "Включить восстановление пароля:",
"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" : "Включение этой опции позволит вам получить доступ к своим зашифрованным файлам в случае утери пароля"
},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"
diff --git a/apps/files_encryption/l10n/sk_SK.js b/apps/files_encryption/l10n/sk_SK.js
index ac61753f09d..ae089f31370 100644
--- a/apps/files_encryption/l10n/sk_SK.js
+++ b/apps/files_encryption/l10n/sk_SK.js
@@ -7,19 +7,18 @@ OC.L10N.register(
"Recovery key successfully disabled" : "Záchranný kľúč bol úspešne zakázaný",
"Password successfully changed." : "Heslo úspešne zmenené.",
"Could not change the password. Maybe the old password was not correct." : "Nemožno zmeniť heslo. Pravdepodobne nebolo staré heslo zadané správne.",
+ "The current log-in password was not correct, please try again." : "Toto heslo nebolo správne, prosím skúste to ešte raz.",
"Private key password successfully updated." : "Heslo súkromného kľúča je úspešne aktualizované.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nemožno aktualizovať heslo súkromného kľúča. Možno nebolo staré heslo správne.",
"File recovery settings updated" : "Nastavenie obnovy súborov aktualizované",
"Could not update file recovery" : "Nemožno aktualizovať obnovenie súborov",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Šifrovacia aplikácia nie je inicializovaná. Je možné, že aplikácia bola znova aktivovaná počas vášho prihlasovania. Pokúste sa odhlásiť a znova prihlásiť pre inicializáciu šifrovania.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Váš súkromný kľúč nie je platný! Možno bolo vaše heslo zmenené mimo %s (napr. firemný priečinok). Môžete si aktualizovať heslo svojho ​​súkromného kľúča vo vašom osobnom nastavení, ak si chcete obnoviť prístup k šifrovaným súborom.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tento súbor sa nepodarilo dešifrovať, pravdepodobne je zdieľaný. Požiadajte majiteľa súboru, aby ho s vami znovu vyzdieľal.",
"Unknown error. Please check your system settings or contact your administrator" : "Neznáma chyba. Skontrolujte si vaše systémové nastavenia alebo kontaktujte administrátora",
- "Missing requirements." : "Chýbajúce požiadavky.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Prosím uistite sa, že PHP verzie 5.3.3 alebo novšej je nainštalované a tiež, že OpenSSL knižnica spolu z PHP rozšírením je povolená a konfigurovaná správne. Nateraz bola aplikácia šifrovania zablokovaná.",
- "Following users are not set up for encryption:" : "Nasledujúci používatelia nie sú nastavení pre šifrovanie:",
"Initial encryption started... This can take some time. Please wait." : "Počiatočné šifrovanie započalo ... To môže nejakú dobu trvať. Čakajte prosím.",
"Initial encryption running... Please try again later." : "Počiatočné šifrovanie beží... Skúste to neskôr znovu.",
+ "Missing requirements." : "Chýbajúce požiadavky.",
+ "Following users are not set up for encryption:" : "Nasledujúci používatelia nie sú nastavení pre šifrovanie:",
"Go directly to your %spersonal settings%s." : "Prejsť priamo do svojho %sosobného nastavenia%s.",
"Encryption" : "Šifrovanie",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikácia na šifrovanie je zapnutá, ale vaše kľúče nie sú inicializované. Odhláste sa a znovu sa prihláste.",
diff --git a/apps/files_encryption/l10n/sk_SK.json b/apps/files_encryption/l10n/sk_SK.json
index e1887527634..b54f4da7ee3 100644
--- a/apps/files_encryption/l10n/sk_SK.json
+++ b/apps/files_encryption/l10n/sk_SK.json
@@ -5,19 +5,18 @@
"Recovery key successfully disabled" : "Záchranný kľúč bol úspešne zakázaný",
"Password successfully changed." : "Heslo úspešne zmenené.",
"Could not change the password. Maybe the old password was not correct." : "Nemožno zmeniť heslo. Pravdepodobne nebolo staré heslo zadané správne.",
+ "The current log-in password was not correct, please try again." : "Toto heslo nebolo správne, prosím skúste to ešte raz.",
"Private key password successfully updated." : "Heslo súkromného kľúča je úspešne aktualizované.",
- "Could not update the private key password. Maybe the old password was not correct." : "Nemožno aktualizovať heslo súkromného kľúča. Možno nebolo staré heslo správne.",
"File recovery settings updated" : "Nastavenie obnovy súborov aktualizované",
"Could not update file recovery" : "Nemožno aktualizovať obnovenie súborov",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Šifrovacia aplikácia nie je inicializovaná. Je možné, že aplikácia bola znova aktivovaná počas vášho prihlasovania. Pokúste sa odhlásiť a znova prihlásiť pre inicializáciu šifrovania.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Váš súkromný kľúč nie je platný! Možno bolo vaše heslo zmenené mimo %s (napr. firemný priečinok). Môžete si aktualizovať heslo svojho ​​súkromného kľúča vo vašom osobnom nastavení, ak si chcete obnoviť prístup k šifrovaným súborom.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tento súbor sa nepodarilo dešifrovať, pravdepodobne je zdieľaný. Požiadajte majiteľa súboru, aby ho s vami znovu vyzdieľal.",
"Unknown error. Please check your system settings or contact your administrator" : "Neznáma chyba. Skontrolujte si vaše systémové nastavenia alebo kontaktujte administrátora",
- "Missing requirements." : "Chýbajúce požiadavky.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Prosím uistite sa, že PHP verzie 5.3.3 alebo novšej je nainštalované a tiež, že OpenSSL knižnica spolu z PHP rozšírením je povolená a konfigurovaná správne. Nateraz bola aplikácia šifrovania zablokovaná.",
- "Following users are not set up for encryption:" : "Nasledujúci používatelia nie sú nastavení pre šifrovanie:",
"Initial encryption started... This can take some time. Please wait." : "Počiatočné šifrovanie započalo ... To môže nejakú dobu trvať. Čakajte prosím.",
"Initial encryption running... Please try again later." : "Počiatočné šifrovanie beží... Skúste to neskôr znovu.",
+ "Missing requirements." : "Chýbajúce požiadavky.",
+ "Following users are not set up for encryption:" : "Nasledujúci používatelia nie sú nastavení pre šifrovanie:",
"Go directly to your %spersonal settings%s." : "Prejsť priamo do svojho %sosobného nastavenia%s.",
"Encryption" : "Šifrovanie",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikácia na šifrovanie je zapnutá, ale vaše kľúče nie sú inicializované. Odhláste sa a znovu sa prihláste.",
diff --git a/apps/files_encryption/l10n/sl.js b/apps/files_encryption/l10n/sl.js
index f0623de697f..678709ab891 100644
--- a/apps/files_encryption/l10n/sl.js
+++ b/apps/files_encryption/l10n/sl.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Ponovno vpišite nov ključ za obnovitev",
"Password successfully changed." : "Geslo je uspešno spremenjeno.",
"Could not change the password. Maybe the old password was not correct." : "Gesla ni mogoče spremeniti. Morda vnos starega gesla ni pravilen.",
+ "Could not update the private key password." : "Ni mogoče posodobiti gesla zasebnega ključa.",
+ "The old password was not correct, please try again." : "Staro geslo ni vpisana pravilno. Poskusite znova.",
+ "The current log-in password was not correct, please try again." : "Trenutno geslo za prijavo ni vpisano pravilno. Poskusite znova.",
"Private key password successfully updated." : "Zasebni ključ za geslo je uspešno posodobljen.",
- "Could not update the private key password. Maybe the old password was not correct." : "Zasebnega ključa za geslo ni mogoče posodobiti. Morda vnos starega gesla ni bil pravilen.",
"File recovery settings updated" : "Nastavitve obnavljanja dokumentov so posodobljene",
"Could not update file recovery" : "Nastavitev za obnavljanje dokumentov ni mogoče posodobiti",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Program za šifriranje ni začet. Morda je bil program ponovno omogočen šele med zagonom trenutne seje. Odjavite se in se nato prijavite nazaj. S tem morda razrešite napako.",
@@ -22,7 +24,7 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Te datoteke ni mogoče šifrirati, ker je to najverjetneje datoteka v souporabi. Prosite lastnika datoteke, da jo da ponovno v souporabo.",
"Unknown error. Please check your system settings or contact your administrator" : "Neznana napaka. Preverite nastavitve sistema ali pa stopite v stik s skrbnikom sistema.",
"Missing requirements." : "Manjkajoče zahteve",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Preverite, ali je na strežniku nameščen paket PHP 5.3.3 ali novejši, da je omogočen in pravilno nastavljen PHP OpenSSL. Z obstoječimi možnostmi šifriranje ni mogoče.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Preverite, ali je OpenSSL z ustrezno razširitvijo PHP omogočen in ustrezno nastavljen. Trenutno je šifriranje onemogočeno.",
"Following users are not set up for encryption:" : "Navedeni uporabniki še nimajo nastavljenega šifriranja:",
"Initial encryption started... This can take some time. Please wait." : "Začetno šifriranje je začeto ... Opravilo je lahko dolgotrajno.",
"Initial encryption running... Please try again later." : "Začetno šifriranje je v teku ... Poskusite kasneje.",
diff --git a/apps/files_encryption/l10n/sl.json b/apps/files_encryption/l10n/sl.json
index 4a692bfebae..943fe8a96c1 100644
--- a/apps/files_encryption/l10n/sl.json
+++ b/apps/files_encryption/l10n/sl.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Ponovno vpišite nov ključ za obnovitev",
"Password successfully changed." : "Geslo je uspešno spremenjeno.",
"Could not change the password. Maybe the old password was not correct." : "Gesla ni mogoče spremeniti. Morda vnos starega gesla ni pravilen.",
+ "Could not update the private key password." : "Ni mogoče posodobiti gesla zasebnega ključa.",
+ "The old password was not correct, please try again." : "Staro geslo ni vpisana pravilno. Poskusite znova.",
+ "The current log-in password was not correct, please try again." : "Trenutno geslo za prijavo ni vpisano pravilno. Poskusite znova.",
"Private key password successfully updated." : "Zasebni ključ za geslo je uspešno posodobljen.",
- "Could not update the private key password. Maybe the old password was not correct." : "Zasebnega ključa za geslo ni mogoče posodobiti. Morda vnos starega gesla ni bil pravilen.",
"File recovery settings updated" : "Nastavitve obnavljanja dokumentov so posodobljene",
"Could not update file recovery" : "Nastavitev za obnavljanje dokumentov ni mogoče posodobiti",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Program za šifriranje ni začet. Morda je bil program ponovno omogočen šele med zagonom trenutne seje. Odjavite se in se nato prijavite nazaj. S tem morda razrešite napako.",
@@ -20,7 +22,7 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Te datoteke ni mogoče šifrirati, ker je to najverjetneje datoteka v souporabi. Prosite lastnika datoteke, da jo da ponovno v souporabo.",
"Unknown error. Please check your system settings or contact your administrator" : "Neznana napaka. Preverite nastavitve sistema ali pa stopite v stik s skrbnikom sistema.",
"Missing requirements." : "Manjkajoče zahteve",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Preverite, ali je na strežniku nameščen paket PHP 5.3.3 ali novejši, da je omogočen in pravilno nastavljen PHP OpenSSL. Z obstoječimi možnostmi šifriranje ni mogoče.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Preverite, ali je OpenSSL z ustrezno razširitvijo PHP omogočen in ustrezno nastavljen. Trenutno je šifriranje onemogočeno.",
"Following users are not set up for encryption:" : "Navedeni uporabniki še nimajo nastavljenega šifriranja:",
"Initial encryption started... This can take some time. Please wait." : "Začetno šifriranje je začeto ... Opravilo je lahko dolgotrajno.",
"Initial encryption running... Please try again later." : "Začetno šifriranje je v teku ... Poskusite kasneje.",
diff --git a/apps/files_encryption/l10n/sq.js b/apps/files_encryption/l10n/sq.js
index f3c5d10cf0a..ffab720cfda 100644
--- a/apps/files_encryption/l10n/sq.js
+++ b/apps/files_encryption/l10n/sq.js
@@ -2,6 +2,7 @@ OC.L10N.register(
"files_encryption",
{
"Unknown error" : "Gabim panjohur",
- "Encryption" : "Kodifikimi"
+ "Encryption" : "Kodifikimi",
+ "Enabled" : "Aktivizuar"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/files_encryption/l10n/sq.json b/apps/files_encryption/l10n/sq.json
index b4fe571e7e0..dee4c42e547 100644
--- a/apps/files_encryption/l10n/sq.json
+++ b/apps/files_encryption/l10n/sq.json
@@ -1,5 +1,6 @@
{ "translations": {
"Unknown error" : "Gabim panjohur",
- "Encryption" : "Kodifikimi"
+ "Encryption" : "Kodifikimi",
+ "Enabled" : "Aktivizuar"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/files_encryption/l10n/sv.js b/apps/files_encryption/l10n/sv.js
index f8ef7040926..eeaebb59e53 100644
--- a/apps/files_encryption/l10n/sv.js
+++ b/apps/files_encryption/l10n/sv.js
@@ -2,24 +2,32 @@ OC.L10N.register(
"files_encryption",
{
"Unknown error" : "Okänt fel",
+ "Missing recovery key password" : "Saknar lösenord för återställningsnyckel",
+ "Please repeat the recovery key password" : "Vänligen upprepa lösenordet för återställningsnyckel",
+ "Repeated recovery key password does not match the provided recovery key password" : "Det upprepade lösenordet för återställningsnyckeln matchar inte tillhandahållna lösenordet för återställningsnyckeln",
"Recovery key successfully enabled" : "Återställningsnyckeln har framgångsrikt aktiverats",
"Could not disable recovery key. Please check your recovery key password!" : "Kunde inte inaktivera återställningsnyckeln. Vänligen kontrollera ditt lösenord för återställningsnyckeln!",
"Recovery key successfully disabled" : "Återställningsnyckeln har framgångsrikt inaktiverats",
+ "Please provide the old recovery password" : "Vänligen tillhandahåll det gamla återställningslösenordet ",
+ "Please provide a new recovery password" : "Vänligen tillhandahåll ett nytt återställningslösenord",
+ "Please repeat the new recovery password" : "Vänligen upprepa det nya återställningslösenordet",
"Password successfully changed." : "Ändringen av lösenordet lyckades.",
"Could not change the password. Maybe the old password was not correct." : "Kunde inte ändra lösenordet. Kanske det gamla lösenordet inte var rätt.",
+ "Could not update the private key password." : "Kunde inte uppdatera lösenord för den privata nyckeln",
+ "The old password was not correct, please try again." : "Det gamla lösenordet var inte korrekt. Vänligen försök igen.",
+ "The current log-in password was not correct, please try again." : "Det nuvarande inloggningslösenordet var inte korrekt. Vänligen försök igen.",
"Private key password successfully updated." : "Den privata nyckelns lösenord uppdaterades utan problem.",
- "Could not update the private key password. Maybe the old password was not correct." : "Kunde inte uppdatera lösenordet för den privata nyckeln. Kanske var det gamla lösenordet fel.",
"File recovery settings updated" : "Inställningarna för filåterställning har uppdaterats",
"Could not update file recovery" : "Kunde inte uppdatera filåterställning",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Krypteringsprogrammet kunde inte initieras! Möjligen blev krypteringsprogrammet återaktiverad under din session. Försök med att logga ut och in igen för att initiera krypteringsprogrammet.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Din privata lösenordsnyckel är inte giltig! Troligen har ditt lösenord ändrats utanför %s (t.ex. i företagets katalogtjänst). Du kan uppdatera den privata lösenordsnyckeln under dina personliga inställningar för att återfå tillgång till dina filer.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan ej dekryptera denna fil, förmodligen är det en delad fil. Be ägaren av filen att dela den med dig.",
"Unknown error. Please check your system settings or contact your administrator" : "Okänt fel. Kontrollera dina systeminställningar eller kontakta din administratör",
- "Missing requirements." : "Krav som saknas",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Kontrollera att PHP 5.3.3 eller senare är installerad och att tillägget OpenSSL PHP är aktiverad och korrekt konfigurerad. Kryptering är tillsvidare inaktiverad.",
- "Following users are not set up for encryption:" : "Följande användare har inte aktiverat kryptering:",
"Initial encryption started... This can take some time. Please wait." : "Initiala krypteringen har påbörjats... Detta kan ta lite tid. Var god vänta.",
"Initial encryption running... Please try again later." : "Initiala krypteringen körs... Var god försök igen senare.",
+ "Missing requirements." : "Krav som saknas",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Se till att OpenSSL tillsammans med PHP-tillägget är aktiverat och korrekt konfigurerat. För nu har krypteringsappen inaktiverats.",
+ "Following users are not set up for encryption:" : "Följande användare har inte aktiverat kryptering:",
"Go directly to your %spersonal settings%s." : "Gå direkt till dina %segna inställningar%s.",
"Encryption" : "Kryptering",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Krypteringsprogrammet är aktiverat men dina nycklar är inte initierade. Vänligen logga ut och in igen",
@@ -33,6 +41,8 @@ OC.L10N.register(
"New Recovery key password" : "Nytt lösenord för återställningsnyckel",
"Repeat New Recovery key password" : "Upprepa lösenord för ny återställningsnyckel",
"Change Password" : "Byt lösenord",
+ "Your private key password no longer matches your log-in password." : "Ditt lösenord för din privata nyckel matchar inte längre ditt inloggningslösenord.",
+ "Set your old private key password to your current log-in password:" : "Sätt ditt gamla privatnyckellösenord till ditt aktuella inloggningslösenord:",
" If you don't remember your old password you can ask your administrator to recover your files." : "Om du inte kommer ihåg ditt gamla lösenord kan du be din administratör att återställa dina filer.",
"Old log-in password" : "Gammalt inloggningslösenord",
"Current log-in password" : "Nuvarande inloggningslösenord",
diff --git a/apps/files_encryption/l10n/sv.json b/apps/files_encryption/l10n/sv.json
index f94da503843..9b5ac1dc8ac 100644
--- a/apps/files_encryption/l10n/sv.json
+++ b/apps/files_encryption/l10n/sv.json
@@ -1,23 +1,31 @@
{ "translations": {
"Unknown error" : "Okänt fel",
+ "Missing recovery key password" : "Saknar lösenord för återställningsnyckel",
+ "Please repeat the recovery key password" : "Vänligen upprepa lösenordet för återställningsnyckel",
+ "Repeated recovery key password does not match the provided recovery key password" : "Det upprepade lösenordet för återställningsnyckeln matchar inte tillhandahållna lösenordet för återställningsnyckeln",
"Recovery key successfully enabled" : "Återställningsnyckeln har framgångsrikt aktiverats",
"Could not disable recovery key. Please check your recovery key password!" : "Kunde inte inaktivera återställningsnyckeln. Vänligen kontrollera ditt lösenord för återställningsnyckeln!",
"Recovery key successfully disabled" : "Återställningsnyckeln har framgångsrikt inaktiverats",
+ "Please provide the old recovery password" : "Vänligen tillhandahåll det gamla återställningslösenordet ",
+ "Please provide a new recovery password" : "Vänligen tillhandahåll ett nytt återställningslösenord",
+ "Please repeat the new recovery password" : "Vänligen upprepa det nya återställningslösenordet",
"Password successfully changed." : "Ändringen av lösenordet lyckades.",
"Could not change the password. Maybe the old password was not correct." : "Kunde inte ändra lösenordet. Kanske det gamla lösenordet inte var rätt.",
+ "Could not update the private key password." : "Kunde inte uppdatera lösenord för den privata nyckeln",
+ "The old password was not correct, please try again." : "Det gamla lösenordet var inte korrekt. Vänligen försök igen.",
+ "The current log-in password was not correct, please try again." : "Det nuvarande inloggningslösenordet var inte korrekt. Vänligen försök igen.",
"Private key password successfully updated." : "Den privata nyckelns lösenord uppdaterades utan problem.",
- "Could not update the private key password. Maybe the old password was not correct." : "Kunde inte uppdatera lösenordet för den privata nyckeln. Kanske var det gamla lösenordet fel.",
"File recovery settings updated" : "Inställningarna för filåterställning har uppdaterats",
"Could not update file recovery" : "Kunde inte uppdatera filåterställning",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Krypteringsprogrammet kunde inte initieras! Möjligen blev krypteringsprogrammet återaktiverad under din session. Försök med att logga ut och in igen för att initiera krypteringsprogrammet.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." : "Din privata lösenordsnyckel är inte giltig! Troligen har ditt lösenord ändrats utanför %s (t.ex. i företagets katalogtjänst). Du kan uppdatera den privata lösenordsnyckeln under dina personliga inställningar för att återfå tillgång till dina filer.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan ej dekryptera denna fil, förmodligen är det en delad fil. Be ägaren av filen att dela den med dig.",
"Unknown error. Please check your system settings or contact your administrator" : "Okänt fel. Kontrollera dina systeminställningar eller kontakta din administratör",
- "Missing requirements." : "Krav som saknas",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Kontrollera att PHP 5.3.3 eller senare är installerad och att tillägget OpenSSL PHP är aktiverad och korrekt konfigurerad. Kryptering är tillsvidare inaktiverad.",
- "Following users are not set up for encryption:" : "Följande användare har inte aktiverat kryptering:",
"Initial encryption started... This can take some time. Please wait." : "Initiala krypteringen har påbörjats... Detta kan ta lite tid. Var god vänta.",
"Initial encryption running... Please try again later." : "Initiala krypteringen körs... Var god försök igen senare.",
+ "Missing requirements." : "Krav som saknas",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Se till att OpenSSL tillsammans med PHP-tillägget är aktiverat och korrekt konfigurerat. För nu har krypteringsappen inaktiverats.",
+ "Following users are not set up for encryption:" : "Följande användare har inte aktiverat kryptering:",
"Go directly to your %spersonal settings%s." : "Gå direkt till dina %segna inställningar%s.",
"Encryption" : "Kryptering",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Krypteringsprogrammet är aktiverat men dina nycklar är inte initierade. Vänligen logga ut och in igen",
@@ -31,6 +39,8 @@
"New Recovery key password" : "Nytt lösenord för återställningsnyckel",
"Repeat New Recovery key password" : "Upprepa lösenord för ny återställningsnyckel",
"Change Password" : "Byt lösenord",
+ "Your private key password no longer matches your log-in password." : "Ditt lösenord för din privata nyckel matchar inte längre ditt inloggningslösenord.",
+ "Set your old private key password to your current log-in password:" : "Sätt ditt gamla privatnyckellösenord till ditt aktuella inloggningslösenord:",
" If you don't remember your old password you can ask your administrator to recover your files." : "Om du inte kommer ihåg ditt gamla lösenord kan du be din administratör att återställa dina filer.",
"Old log-in password" : "Gammalt inloggningslösenord",
"Current log-in password" : "Nuvarande inloggningslösenord",
diff --git a/apps/files_encryption/l10n/tr.js b/apps/files_encryption/l10n/tr.js
index 3a50eeb2081..43a05a696a6 100644
--- a/apps/files_encryption/l10n/tr.js
+++ b/apps/files_encryption/l10n/tr.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Lütfen yeni kurtarma parolasını yenileyin",
"Password successfully changed." : "Parola başarıyla değiştirildi.",
"Could not change the password. Maybe the old password was not correct." : "Parola değiştirilemedi. Eski parolanız doğru olmayabilir.",
+ "Could not update the private key password." : "Özel anahtar parolası güncellenemedi",
+ "The old password was not correct, please try again." : "Eski parola doğru değil, lütfen yeniden deneyin.",
+ "The current log-in password was not correct, please try again." : "Geçerli oturum parolası doğru değil, lütfen yeniden deneyin.",
"Private key password successfully updated." : "Özel anahtar parolası başarıyla güncellendi.",
- "Could not update the private key password. Maybe the old password was not correct." : "Özel anahtar parolası güncellenemedi. Eski parola hatalı olabilir.",
"File recovery settings updated" : "Dosya kurtarma ayarları güncellendi",
"Could not update file recovery" : "Dosya kurtarma güncellenemedi",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Şifreleme uygulaması başlatılamadı! Oturumunuz sırasında şifreleme uygulaması tekrar etkinleştirilmiş olabilir. Lütfen şifreleme uygulamasını başlatmak için oturumu kapatıp yeniden oturum açmayı deneyin.",
@@ -22,7 +24,7 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Bu dosya muhtemelen bir paylaşılan dosya olduğundan şifrelemesi kaldırılamıyor. Lütfen dosyayı sizinle bir daha paylaşması için dosya sahibi ile iletişime geçin.",
"Unknown error. Please check your system settings or contact your administrator" : "Bilinmeyen hata. Lütfen sistem ayarlarınızı denetleyin veya yöneticiniz ile iletişime geçin",
"Missing requirements." : "Gereklilikler eksik.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "PHP 5.3.3 veya daha sürümü ile birlikte OpenSSL ve OpenSSL PHP uzantısının birlikte etkin olduğundan ve doğru bir şekilde yapılandırıldığından emin olun. Şimdilik şifreleme uygulaması devre dışı bırakıldı.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "OpenSSL'nin PHP uzantısıyla birlikte etkin ve düzgün yapılandırılmış olduğundan emin olun. Şimdilik şifreleme uygulaması devre dışı bırakıldı.",
"Following users are not set up for encryption:" : "Aşağıdaki kullanıcılar şifreleme için ayarlanmamış:",
"Initial encryption started... This can take some time. Please wait." : "İlk şifreleme başladı... Bu biraz zaman alabilir. Lütfen bekleyin.",
"Initial encryption running... Please try again later." : "İlk şifreleme çalışıyor... Lütfen daha sonra tekrar deneyin.",
diff --git a/apps/files_encryption/l10n/tr.json b/apps/files_encryption/l10n/tr.json
index 4998865f3bd..e78f8fb5203 100644
--- a/apps/files_encryption/l10n/tr.json
+++ b/apps/files_encryption/l10n/tr.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Lütfen yeni kurtarma parolasını yenileyin",
"Password successfully changed." : "Parola başarıyla değiştirildi.",
"Could not change the password. Maybe the old password was not correct." : "Parola değiştirilemedi. Eski parolanız doğru olmayabilir.",
+ "Could not update the private key password." : "Özel anahtar parolası güncellenemedi",
+ "The old password was not correct, please try again." : "Eski parola doğru değil, lütfen yeniden deneyin.",
+ "The current log-in password was not correct, please try again." : "Geçerli oturum parolası doğru değil, lütfen yeniden deneyin.",
"Private key password successfully updated." : "Özel anahtar parolası başarıyla güncellendi.",
- "Could not update the private key password. Maybe the old password was not correct." : "Özel anahtar parolası güncellenemedi. Eski parola hatalı olabilir.",
"File recovery settings updated" : "Dosya kurtarma ayarları güncellendi",
"Could not update file recovery" : "Dosya kurtarma güncellenemedi",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Şifreleme uygulaması başlatılamadı! Oturumunuz sırasında şifreleme uygulaması tekrar etkinleştirilmiş olabilir. Lütfen şifreleme uygulamasını başlatmak için oturumu kapatıp yeniden oturum açmayı deneyin.",
@@ -20,7 +22,7 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Bu dosya muhtemelen bir paylaşılan dosya olduğundan şifrelemesi kaldırılamıyor. Lütfen dosyayı sizinle bir daha paylaşması için dosya sahibi ile iletişime geçin.",
"Unknown error. Please check your system settings or contact your administrator" : "Bilinmeyen hata. Lütfen sistem ayarlarınızı denetleyin veya yöneticiniz ile iletişime geçin",
"Missing requirements." : "Gereklilikler eksik.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "PHP 5.3.3 veya daha sürümü ile birlikte OpenSSL ve OpenSSL PHP uzantısının birlikte etkin olduğundan ve doğru bir şekilde yapılandırıldığından emin olun. Şimdilik şifreleme uygulaması devre dışı bırakıldı.",
+ "Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "OpenSSL'nin PHP uzantısıyla birlikte etkin ve düzgün yapılandırılmış olduğundan emin olun. Şimdilik şifreleme uygulaması devre dışı bırakıldı.",
"Following users are not set up for encryption:" : "Aşağıdaki kullanıcılar şifreleme için ayarlanmamış:",
"Initial encryption started... This can take some time. Please wait." : "İlk şifreleme başladı... Bu biraz zaman alabilir. Lütfen bekleyin.",
"Initial encryption running... Please try again later." : "İlk şifreleme çalışıyor... Lütfen daha sonra tekrar deneyin.",
diff --git a/apps/files_encryption/l10n/uk.js b/apps/files_encryption/l10n/uk.js
index 169f6c3f92e..15783a5172e 100644
--- a/apps/files_encryption/l10n/uk.js
+++ b/apps/files_encryption/l10n/uk.js
@@ -13,8 +13,10 @@ OC.L10N.register(
"Please repeat the new recovery password" : "Будь ласка, введіть новий пароль відновлення ще раз",
"Password successfully changed." : "Пароль змінено.",
"Could not change the password. Maybe the old password was not correct." : "Не вдалося змінити пароль. Можливо ви неправильно ввели старий пароль.",
+ "Could not update the private key password." : "Не вдалося оновити пароль секретного ключа.",
+ "The old password was not correct, please try again." : "Старий пароль введено не вірно, спробуйте ще раз.",
+ "The current log-in password was not correct, please try again." : "Невірний пароль входу, будь ласка, спробуйте ще раз.",
"Private key password successfully updated." : "Пароль секретного ключа оновлено.",
- "Could not update the private key password. Maybe the old password was not correct." : "Не вдалося оновити пароль секретного ключа. Можливо ви не правильно ввели старий пароль.",
"File recovery settings updated" : "Налаштування файла відновлення оновлено",
"Could not update file recovery" : "Не вдалося оновити файл відновлення ",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Додаток шифрувння не ініціалізовано! Можливо цей додаток редагувався під час вашої сесії. Будь ласка, спробуйте вийти і зайти знову щоб проініціалізувати додаток шифрування.",
@@ -22,7 +24,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Не можу розшифрувати цей файл, можливо він опублікований. Будь ласка, попросіть власника опублікувати його заново.",
"Unknown error. Please check your system settings or contact your administrator" : "Невідома помилка. Будь ласка, перевірте налаштування системи або зверніться до адміністратора.",
"Missing requirements." : "Відсутні вимоги.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Будь ласка, впевніться, що встановлена версія PHP 5.3.3 або новіша, а також, що OpenSSL та інші розширення PHP підключені та вірно налаштовані. На даний момент додаток шифрування відключений.",
"Following users are not set up for encryption:" : "Для наступних користувачів шифрування не налаштоване:",
"Initial encryption started... This can take some time. Please wait." : "Початкове шифрування почалося... Це може зайняти деякий час. Будь ласка, почекайте.",
"Initial encryption running... Please try again later." : "Початкове шифрування працює... Це може зайняти деякий час. Будь ласка, почекайте.",
diff --git a/apps/files_encryption/l10n/uk.json b/apps/files_encryption/l10n/uk.json
index 454de34d9c0..69444961860 100644
--- a/apps/files_encryption/l10n/uk.json
+++ b/apps/files_encryption/l10n/uk.json
@@ -11,8 +11,10 @@
"Please repeat the new recovery password" : "Будь ласка, введіть новий пароль відновлення ще раз",
"Password successfully changed." : "Пароль змінено.",
"Could not change the password. Maybe the old password was not correct." : "Не вдалося змінити пароль. Можливо ви неправильно ввели старий пароль.",
+ "Could not update the private key password." : "Не вдалося оновити пароль секретного ключа.",
+ "The old password was not correct, please try again." : "Старий пароль введено не вірно, спробуйте ще раз.",
+ "The current log-in password was not correct, please try again." : "Невірний пароль входу, будь ласка, спробуйте ще раз.",
"Private key password successfully updated." : "Пароль секретного ключа оновлено.",
- "Could not update the private key password. Maybe the old password was not correct." : "Не вдалося оновити пароль секретного ключа. Можливо ви не правильно ввели старий пароль.",
"File recovery settings updated" : "Налаштування файла відновлення оновлено",
"Could not update file recovery" : "Не вдалося оновити файл відновлення ",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "Додаток шифрувння не ініціалізовано! Можливо цей додаток редагувався під час вашої сесії. Будь ласка, спробуйте вийти і зайти знову щоб проініціалізувати додаток шифрування.",
@@ -20,7 +22,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Не можу розшифрувати цей файл, можливо він опублікований. Будь ласка, попросіть власника опублікувати його заново.",
"Unknown error. Please check your system settings or contact your administrator" : "Невідома помилка. Будь ласка, перевірте налаштування системи або зверніться до адміністратора.",
"Missing requirements." : "Відсутні вимоги.",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "Будь ласка, впевніться, що встановлена версія PHP 5.3.3 або новіша, а також, що OpenSSL та інші розширення PHP підключені та вірно налаштовані. На даний момент додаток шифрування відключений.",
"Following users are not set up for encryption:" : "Для наступних користувачів шифрування не налаштоване:",
"Initial encryption started... This can take some time. Please wait." : "Початкове шифрування почалося... Це може зайняти деякий час. Будь ласка, почекайте.",
"Initial encryption running... Please try again later." : "Початкове шифрування працює... Це може зайняти деякий час. Будь ласка, почекайте.",
diff --git a/apps/files_encryption/l10n/vi.js b/apps/files_encryption/l10n/vi.js
index 8fc542510da..b853fb76162 100644
--- a/apps/files_encryption/l10n/vi.js
+++ b/apps/files_encryption/l10n/vi.js
@@ -8,7 +8,6 @@ OC.L10N.register(
"Password successfully changed." : "Đã đổi mật khẩu.",
"Could not change the password. Maybe the old password was not correct." : "Không thể đổi mật khẩu. Có lẽ do mật khẩu cũ không đúng.",
"Private key password successfully updated." : "Cập nhật thành công mật khẩu khóa cá nhân",
- "Could not update the private key password. Maybe the old password was not correct." : "Không thể cập nhật mật khẩu khóa cá nhân. Có thể mật khẩu cũ không đúng",
"File recovery settings updated" : "Đã cập nhật thiết lập khôi phục tập tin ",
"Could not update file recovery" : "Không thể cập nhật khôi phục tập tin",
"Encryption" : "Mã hóa",
diff --git a/apps/files_encryption/l10n/vi.json b/apps/files_encryption/l10n/vi.json
index f1a1ff4c6da..4800a4bc21f 100644
--- a/apps/files_encryption/l10n/vi.json
+++ b/apps/files_encryption/l10n/vi.json
@@ -6,7 +6,6 @@
"Password successfully changed." : "Đã đổi mật khẩu.",
"Could not change the password. Maybe the old password was not correct." : "Không thể đổi mật khẩu. Có lẽ do mật khẩu cũ không đúng.",
"Private key password successfully updated." : "Cập nhật thành công mật khẩu khóa cá nhân",
- "Could not update the private key password. Maybe the old password was not correct." : "Không thể cập nhật mật khẩu khóa cá nhân. Có thể mật khẩu cũ không đúng",
"File recovery settings updated" : "Đã cập nhật thiết lập khôi phục tập tin ",
"Could not update file recovery" : "Không thể cập nhật khôi phục tập tin",
"Encryption" : "Mã hóa",
diff --git a/apps/files_encryption/l10n/zh_CN.js b/apps/files_encryption/l10n/zh_CN.js
index 82051423baf..a7da9155ef6 100644
--- a/apps/files_encryption/l10n/zh_CN.js
+++ b/apps/files_encryption/l10n/zh_CN.js
@@ -8,7 +8,6 @@ OC.L10N.register(
"Password successfully changed." : "密码修改成功。",
"Could not change the password. Maybe the old password was not correct." : "不能修改密码。旧密码可能不正确。",
"Private key password successfully updated." : "私钥密码成功更新。",
- "Could not update the private key password. Maybe the old password was not correct." : "无法更新私钥密码。可能旧密码不正确。",
"File recovery settings updated" : "文件恢复设置已更新",
"Could not update file recovery" : "不能更新文件恢复",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "加密应用还没有初始化!可能加密应用在你会话期间已被重新启用。请注销并重新登录,以初始化加密应用。",
@@ -16,7 +15,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : " 无法解密这个文件(或许这是一个共享文件?),请询问文件所有者重新与您分享这个文件。",
"Unknown error. Please check your system settings or contact your administrator" : "未知错误。请检查系统设置或联系您的管理员",
"Missing requirements." : "必填项未填写。",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "请确认安装了 PHP 5.3.3 或更新版本,且 OpenSSL 及其 PHP 扩展已经启用并正确配置。加密应用现在已被禁用。",
"Following users are not set up for encryption:" : "以下用户还没有设置加密:",
"Initial encryption started... This can take some time. Please wait." : "初始加密启动中....这可能会花一些时间,请稍后再试。",
"Initial encryption running... Please try again later." : "初始加密运行中....请稍后再试。",
diff --git a/apps/files_encryption/l10n/zh_CN.json b/apps/files_encryption/l10n/zh_CN.json
index 9c9a6adc7cb..34576ee72d0 100644
--- a/apps/files_encryption/l10n/zh_CN.json
+++ b/apps/files_encryption/l10n/zh_CN.json
@@ -6,7 +6,6 @@
"Password successfully changed." : "密码修改成功。",
"Could not change the password. Maybe the old password was not correct." : "不能修改密码。旧密码可能不正确。",
"Private key password successfully updated." : "私钥密码成功更新。",
- "Could not update the private key password. Maybe the old password was not correct." : "无法更新私钥密码。可能旧密码不正确。",
"File recovery settings updated" : "文件恢复设置已更新",
"Could not update file recovery" : "不能更新文件恢复",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "加密应用还没有初始化!可能加密应用在你会话期间已被重新启用。请注销并重新登录,以初始化加密应用。",
@@ -14,7 +13,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : " 无法解密这个文件(或许这是一个共享文件?),请询问文件所有者重新与您分享这个文件。",
"Unknown error. Please check your system settings or contact your administrator" : "未知错误。请检查系统设置或联系您的管理员",
"Missing requirements." : "必填项未填写。",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "请确认安装了 PHP 5.3.3 或更新版本,且 OpenSSL 及其 PHP 扩展已经启用并正确配置。加密应用现在已被禁用。",
"Following users are not set up for encryption:" : "以下用户还没有设置加密:",
"Initial encryption started... This can take some time. Please wait." : "初始加密启动中....这可能会花一些时间,请稍后再试。",
"Initial encryption running... Please try again later." : "初始加密运行中....请稍后再试。",
diff --git a/apps/files_encryption/l10n/zh_TW.js b/apps/files_encryption/l10n/zh_TW.js
index c68028a7aad..3bd3143c5b9 100644
--- a/apps/files_encryption/l10n/zh_TW.js
+++ b/apps/files_encryption/l10n/zh_TW.js
@@ -8,7 +8,6 @@ OC.L10N.register(
"Password successfully changed." : "成功變更密碼。",
"Could not change the password. Maybe the old password was not correct." : "無法變更密碼,或許是輸入的舊密碼不正確。",
"Private key password successfully updated." : "私人金鑰密碼已成功更新。",
- "Could not update the private key password. Maybe the old password was not correct." : "無法更新私人金鑰密碼。可能舊的密碼不正確。",
"File recovery settings updated" : "檔案還原設定已更新",
"Could not update file recovery" : "無法更新檔案還原設定",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "加密功能未初始化!可能加密功能需要重新啟用在現在的連線上。請試著登出再登入來初始化加密功能。",
@@ -16,7 +15,6 @@ OC.L10N.register(
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "無法解密這個檔案,也許這是分享的檔案。請詢問檔案所有人重新分享檔案給您。",
"Unknown error. Please check your system settings or contact your administrator" : "未知錯誤請檢查您的系統設定或是聯絡您的管理員",
"Missing requirements." : "遺失必要條件。",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "請確認已安裝 PHP 5.3.3 或是更新的版本以及 OpenSSL 也一併安裝在 PHP extension 裡面並啟用及設置完成。現在,加密功能是停用的。",
"Following users are not set up for encryption:" : "以下的使用者無法設定加密:",
"Initial encryption started... This can take some time. Please wait." : "加密初始已啟用...這個需要一些時間。請稍等。",
"Initial encryption running... Please try again later." : "加密初始執行中...請晚點再試。",
diff --git a/apps/files_encryption/l10n/zh_TW.json b/apps/files_encryption/l10n/zh_TW.json
index c6560dc3738..cf85da08c9f 100644
--- a/apps/files_encryption/l10n/zh_TW.json
+++ b/apps/files_encryption/l10n/zh_TW.json
@@ -6,7 +6,6 @@
"Password successfully changed." : "成功變更密碼。",
"Could not change the password. Maybe the old password was not correct." : "無法變更密碼,或許是輸入的舊密碼不正確。",
"Private key password successfully updated." : "私人金鑰密碼已成功更新。",
- "Could not update the private key password. Maybe the old password was not correct." : "無法更新私人金鑰密碼。可能舊的密碼不正確。",
"File recovery settings updated" : "檔案還原設定已更新",
"Could not update file recovery" : "無法更新檔案還原設定",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." : "加密功能未初始化!可能加密功能需要重新啟用在現在的連線上。請試著登出再登入來初始化加密功能。",
@@ -14,7 +13,6 @@
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "無法解密這個檔案,也許這是分享的檔案。請詢問檔案所有人重新分享檔案給您。",
"Unknown error. Please check your system settings or contact your administrator" : "未知錯誤請檢查您的系統設定或是聯絡您的管理員",
"Missing requirements." : "遺失必要條件。",
- "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." : "請確認已安裝 PHP 5.3.3 或是更新的版本以及 OpenSSL 也一併安裝在 PHP extension 裡面並啟用及設置完成。現在,加密功能是停用的。",
"Following users are not set up for encryption:" : "以下的使用者無法設定加密:",
"Initial encryption started... This can take some time. Please wait." : "加密初始已啟用...這個需要一些時間。請稍等。",
"Initial encryption running... Please try again later." : "加密初始執行中...請晚點再試。",
diff --git a/apps/files_encryption/lib/capabilities.php b/apps/files_encryption/lib/capabilities.php
index ef94c9e086d..e6e4ee7d419 100644
--- a/apps/files_encryption/lib/capabilities.php
+++ b/apps/files_encryption/lib/capabilities.php
@@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
-namespace OCA\Encryption;
+namespace OCA\Files_Encryption;
class Capabilities {
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 59b191097af..38993ba65b0 100644
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -3,10 +3,12 @@
/**
* ownCloud
*
- * @author Sam Tuke, Frank Karlitschek, Robin Appelman
- * @copyright 2012 Sam Tuke samtuke@owncloud.com,
- * Robin Appelman icewind@owncloud.com, Frank Karlitschek
- * frank@owncloud.org
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
+ * @author Sam Tuke <samtuke@owncloud.com>
+ * @author Frank Karlitschek <frank@owncloud.com>
+ * @author Robin Appelman <icewind@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -23,8 +25,7 @@
*
*/
-namespace OCA\Encryption;
-use OCA\Encryption\Exceptions\EncryptionException;
+namespace OCA\Files_Encryption;
/**
* Class for common cryptography functionality
@@ -132,7 +133,7 @@ class Crypt {
* Check if a file's contents contains an IV and is symmetrically encrypted
* @param string $content
* @return boolean
- * @note see also OCA\Encryption\Util->isEncryptedPath()
+ * @note see also \OCA\Files_Encryption\Util->isEncryptedPath()
*/
public static function isCatfileContent($content) {
@@ -189,7 +190,7 @@ class Crypt {
* @param string $passphrase
* @param string $cypher used for encryption, currently we support AES-128-CFB and AES-256-CFB
* @return string encrypted file content
- * @throws \OCA\Encryption\Exceptions\EncryptionException
+ * @throws \OCA\Files_Encryption\Exception\EncryptionException
*/
private static function encrypt($plainContent, $iv, $passphrase = '', $cipher = Crypt::DEFAULT_CIPHER) {
@@ -198,7 +199,7 @@ class Crypt {
if (!$encryptedContent) {
$error = "Encryption (symmetric) of content failed: " . openssl_error_string();
\OCP\Util::writeLog('Encryption library', $error, \OCP\Util::ERROR);
- throw new Exceptions\EncryptionException($error, 50);
+ throw new Exception\EncryptionException($error, Exception\EncryptionException::ENCRYPTION_FAILED);
}
return $encryptedContent;
@@ -290,7 +291,7 @@ class Crypt {
$padded = self::addPadding($catfile);
return $padded;
- } catch (EncryptionException $e) {
+ } catch (Exception\EncryptionException $e) {
$message = 'Could not encrypt file content (code: ' . $e->getCode() . '): ';
\OCP\Util::writeLog('files_encryption', $message . $e->getMessage(), \OCP\Util::ERROR);
return false;
@@ -378,7 +379,7 @@ class Crypt {
* @param string $plainContent content to be encrypted
* @param array $publicKeys array keys must be the userId of corresponding user
* @return array keys: keys (array, key = userId), data
- * @throws \OCA\Encryption\Exceptions\\MultiKeyEncryptException if encryption failed
+ * @throws \OCA\Files_Encryption\Exception\MultiKeyEncryptException if encryption failed
* @note symmetricDecryptFileContent() can decrypt files created using this method
*/
public static function multiKeyEncrypt($plainContent, array $publicKeys) {
@@ -386,7 +387,7 @@ class Crypt {
// openssl_seal returns false without errors if $plainContent
// is empty, so trigger our own error
if (empty($plainContent)) {
- throw new Exceptions\MultiKeyEncryptException('Cannot multiKeyEncrypt empty plain content', 10);
+ throw new Exception\MultiKeyEncryptException('Cannot multiKeyEncrypt empty plain content', Exception\MultiKeyEncryptException::EMPTY_DATA);
}
// Set empty vars to be set by openssl by reference
@@ -413,7 +414,8 @@ class Crypt {
);
} else {
- throw new Exceptions\MultiKeyEncryptException('multi key encryption failed: ' . openssl_error_string(), 20);
+ throw new Exception\MultiKeyEncryptException('multi key encryption failed: ' . openssl_error_string(),
+ Exception\MultiKeyEncryptException::OPENSSL_SEAL_FAILED);
}
}
@@ -423,7 +425,7 @@ class Crypt {
* @param string $encryptedContent
* @param string $shareKey
* @param mixed $privateKey
- * @throws \OCA\Encryption\Exceptions\\MultiKeyDecryptException if decryption failed
+ * @throws \OCA\Files_Encryption\Exception\MultiKeyDecryptException if decryption failed
* @internal param string $plainContent contains decrypted content
* @return string $plainContent decrypted string
* @note symmetricDecryptFileContent() can be used to decrypt files created using this method
@@ -433,7 +435,8 @@ class Crypt {
public static function multiKeyDecrypt($encryptedContent, $shareKey, $privateKey) {
if (!$encryptedContent) {
- throw new Exceptions\MultiKeyDecryptException('Cannot mutliKeyDecrypt empty plain content', 10);
+ throw new Exception\MultiKeyDecryptException('Cannot mutliKeyDecrypt empty plain content',
+ Exception\MultiKeyDecryptException::EMPTY_DATA);
}
if (openssl_open($encryptedContent, $plainContent, $shareKey, $privateKey)) {
@@ -441,7 +444,8 @@ class Crypt {
return $plainContent;
} else {
- throw new Exceptions\MultiKeyDecryptException('multiKeyDecrypt with share-key' . $shareKey . 'failed: ' . openssl_error_string(), 20);
+ throw new Exception\MultiKeyDecryptException('multiKeyDecrypt with share-key' . $shareKey . 'failed: ' . openssl_error_string(),
+ Exception\MultiKeyDecryptException::OPENSSL_OPEN_FAILED);
}
}
@@ -550,14 +554,15 @@ class Crypt {
* get chiper from header
*
* @param array $header
- * @throws \OCA\Encryption\Exceptions\EncryptionException
+ * @throws \OCA\Files_Encryption\Exception\EncryptionException
*/
public static function getCipher($header) {
$cipher = isset($header['cipher']) ? $header['cipher'] : 'AES-128-CFB';
if ($cipher !== 'AES-256-CFB' && $cipher !== 'AES-128-CFB') {
- throw new \OCA\Encryption\Exceptions\EncryptionException('file header broken, no supported cipher defined', 40);
+ throw new Exception\EncryptionException('file header broken, no supported cipher defined',
+ Exception\EncryptionException::UNKNOWN_CIPHER);
}
return $cipher;
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index 53c380ab2b3..b9d45f67363 100644
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -3,8 +3,10 @@
/**
* ownCloud
*
- * @author Florin Peter
- * @copyright 2013 Florin Peter <owncloud@florin-peter.de>
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Florin Peter <owncloud@florin-peter.de>
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -21,11 +23,11 @@
*
*/
-namespace OCA\Encryption;
+namespace OCA\Files_Encryption;
/**
* Class to manage registration of hooks an various helper methods
- * @package OCA\Encryption
+ * @package OCA\Files_Encryption
*/
class Helper {
@@ -37,9 +39,9 @@ class Helper {
*/
public static function registerShareHooks() {
- \OCP\Util::connectHook('OCP\Share', 'pre_shared', 'OCA\Encryption\Hooks', 'preShared');
- \OCP\Util::connectHook('OCP\Share', 'post_shared', 'OCA\Encryption\Hooks', 'postShared');
- \OCP\Util::connectHook('OCP\Share', 'post_unshare', 'OCA\Encryption\Hooks', 'postUnshare');
+ \OCP\Util::connectHook('OCP\Share', 'pre_shared', 'OCA\Files_Encryption\Hooks', 'preShared');
+ \OCP\Util::connectHook('OCP\Share', 'post_shared', 'OCA\Files_Encryption\Hooks', 'postShared');
+ \OCP\Util::connectHook('OCP\Share', 'post_unshare', 'OCA\Files_Encryption\Hooks', 'postUnshare');
}
/**
@@ -48,12 +50,12 @@ class Helper {
*/
public static function registerUserHooks() {
- \OCP\Util::connectHook('OC_User', 'post_login', 'OCA\Encryption\Hooks', 'login');
- \OCP\Util::connectHook('OC_User', 'logout', 'OCA\Encryption\Hooks', 'logout');
- \OCP\Util::connectHook('OC_User', 'post_setPassword', 'OCA\Encryption\Hooks', 'setPassphrase');
- \OCP\Util::connectHook('OC_User', 'pre_setPassword', 'OCA\Encryption\Hooks', 'preSetPassphrase');
- \OCP\Util::connectHook('OC_User', 'post_createUser', 'OCA\Encryption\Hooks', 'postCreateUser');
- \OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OCA\Encryption\Hooks', 'postDeleteUser');
+ \OCP\Util::connectHook('OC_User', 'post_login', 'OCA\Files_Encryption\Hooks', 'login');
+ \OCP\Util::connectHook('OC_User', 'logout', 'OCA\Files_Encryption\Hooks', 'logout');
+ \OCP\Util::connectHook('OC_User', 'post_setPassword', 'OCA\Files_Encryption\Hooks', 'setPassphrase');
+ \OCP\Util::connectHook('OC_User', 'pre_setPassword', 'OCA\Files_Encryption\Hooks', 'preSetPassphrase');
+ \OCP\Util::connectHook('OC_User', 'post_createUser', 'OCA\Files_Encryption\Hooks', 'postCreateUser');
+ \OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OCA\Files_Encryption\Hooks', 'postDeleteUser');
}
/**
@@ -62,14 +64,15 @@ class Helper {
*/
public static function registerFilesystemHooks() {
- \OCP\Util::connectHook('OC_Filesystem', 'rename', 'OCA\Encryption\Hooks', 'preRename');
- \OCP\Util::connectHook('OC_Filesystem', 'post_rename', 'OCA\Encryption\Hooks', 'postRenameOrCopy');
- \OCP\Util::connectHook('OC_Filesystem', 'copy', 'OCA\Encryption\Hooks', 'preCopy');
- \OCP\Util::connectHook('OC_Filesystem', 'post_copy', 'OCA\Encryption\Hooks', 'postRenameOrCopy');
- \OCP\Util::connectHook('OC_Filesystem', 'post_delete', 'OCA\Encryption\Hooks', 'postDelete');
- \OCP\Util::connectHook('OC_Filesystem', 'delete', 'OCA\Encryption\Hooks', 'preDelete');
- \OCP\Util::connectHook('OC_Filesystem', 'post_umount', 'OCA\Encryption\Hooks', 'postUmount');
- \OCP\Util::connectHook('OC_Filesystem', 'umount', 'OCA\Encryption\Hooks', 'preUmount');
+ \OCP\Util::connectHook('OC_Filesystem', 'rename', 'OCA\Files_Encryption\Hooks', 'preRename');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_rename', 'OCA\Files_Encryption\Hooks', 'postRenameOrCopy');
+ \OCP\Util::connectHook('OC_Filesystem', 'copy', 'OCA\Files_Encryption\Hooks', 'preCopy');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_copy', 'OCA\Files_Encryption\Hooks', 'postRenameOrCopy');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_delete', 'OCA\Files_Encryption\Hooks', 'postDelete');
+ \OCP\Util::connectHook('OC_Filesystem', 'delete', 'OCA\Files_Encryption\Hooks', 'preDelete');
+ \OCP\Util::connectHook('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', 'OCA\Files_Encryption\Hooks', 'postPasswordReset');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_umount', 'OCA\Files_Encryption\Hooks', 'postUnmount');
+ \OCP\Util::connectHook('OC_Filesystem', 'umount', 'OCA\Files_Encryption\Hooks', 'preUnmount');
}
/**
@@ -78,8 +81,8 @@ class Helper {
*/
public static function registerAppHooks() {
- \OCP\Util::connectHook('OC_App', 'pre_disable', 'OCA\Encryption\Hooks', 'preDisable');
- \OCP\Util::connectHook('OC_App', 'post_disable', 'OCA\Encryption\Hooks', 'postEnable');
+ \OCP\Util::connectHook('OC_App', 'pre_disable', 'OCA\Files_Encryption\Hooks', 'preDisable');
+ \OCP\Util::connectHook('OC_App', 'post_disable', 'OCA\Files_Encryption\Hooks', 'postEnable');
}
/**
@@ -105,12 +108,29 @@ class Helper {
}
/**
+ * get recovery key id
+ *
+ * @return string|bool recovery key ID or false
+ */
+ public static function getRecoveryKeyId() {
+ $appConfig = \OC::$server->getAppConfig();
+ $key = $appConfig->getValue('files_encryption', 'recoveryKeyId');
+
+ return ($key === null) ? false : $key;
+ }
+
+ public static function getPublicShareKeyId() {
+ $appConfig = \OC::$server->getAppConfig();
+ $key = $appConfig->getValue('files_encryption', 'publicShareKeyId');
+
+ return ($key === null) ? false : $key;
+ }
+
+ /**
* enable recovery
*
* @param string $recoveryKeyId
* @param string $recoveryPassword
- * @internal param \OCA\Encryption\Util $util
- * @internal param string $password
* @return bool
*/
public static function adminEnableRecovery($recoveryKeyId, $recoveryPassword) {
@@ -123,40 +143,24 @@ class Helper {
$appConfig->setValue('files_encryption', 'recoveryKeyId', $recoveryKeyId);
}
- if (!$view->is_dir('/owncloud_private_key')) {
- $view->mkdir('/owncloud_private_key');
- }
-
- if (
- (!$view->file_exists("/public-keys/" . $recoveryKeyId . ".public.key")
- || !$view->file_exists("/owncloud_private_key/" . $recoveryKeyId . ".private.key"))
- ) {
-
- $keypair = \OCA\Encryption\Crypt::createKeypair();
+ if (!Keymanager::recoveryKeyExists($view)) {
- \OC_FileProxy::$enabled = false;
+ $keypair = Crypt::createKeypair();
// Save public key
+ Keymanager::setPublicKey($keypair['publicKey'], $recoveryKeyId);
- if (!$view->is_dir('/public-keys')) {
- $view->mkdir('/public-keys');
- }
-
- $view->file_put_contents('/public-keys/' . $recoveryKeyId . '.public.key', $keypair['publicKey']);
-
- $cipher = \OCA\Encryption\Helper::getCipher();
- $encryptedKey = \OCA\Encryption\Crypt::symmetricEncryptFileContent($keypair['privateKey'], $recoveryPassword, $cipher);
+ $cipher = Helper::getCipher();
+ $encryptedKey = Crypt::symmetricEncryptFileContent($keypair['privateKey'], $recoveryPassword, $cipher);
if ($encryptedKey) {
- Keymanager::setPrivateSystemKey($encryptedKey, $recoveryKeyId . '.private.key');
+ Keymanager::setPrivateSystemKey($encryptedKey, $recoveryKeyId);
// Set recoveryAdmin as enabled
$appConfig->setValue('files_encryption', 'recoveryAdminEnabled', 1);
$return = true;
}
- \OC_FileProxy::$enabled = true;
-
} else { // get recovery key and check the password
- $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser());
+ $util = new Util(new \OC\Files\View('/'), \OCP\User::getUser());
$return = $util->checkRecoveryPassword($recoveryPassword);
if ($return) {
$appConfig->setValue('files_encryption', 'recoveryAdminEnabled', 1);
@@ -356,14 +360,14 @@ class Helper {
if ($errorCode === null) {
$init = $session->getInitialized();
switch ($init) {
- case \OCA\Encryption\Session::INIT_EXECUTED:
- $errorCode = \OCA\Encryption\Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR;
+ case Session::INIT_EXECUTED:
+ $errorCode = Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR;
break;
- case \OCA\Encryption\Session::NOT_INITIALIZED:
- $errorCode = \OCA\Encryption\Crypt::ENCRYPTION_NOT_INITIALIZED_ERROR;
+ case Session::NOT_INITIALIZED:
+ $errorCode = Crypt::ENCRYPTION_NOT_INITIALIZED_ERROR;
break;
default:
- $errorCode = \OCA\Encryption\Crypt::ENCRYPTION_UNKNOWN_ERROR;
+ $errorCode = Crypt::ENCRYPTION_UNKNOWN_ERROR;
}
}
@@ -386,14 +390,10 @@ class Helper {
* @return bool true if requirements are met
*/
public static function checkRequirements() {
- $result = true;
//openssl extension needs to be loaded
- $result &= extension_loaded("openssl");
- // we need php >= 5.3.3
- $result &= version_compare(phpversion(), '5.3.3', '>=');
+ return extension_loaded("openssl");
- return (bool) $result;
}
/**
@@ -427,52 +427,11 @@ class Helper {
*/
public static function getOpenSSLConfig() {
$config = array('private_key_bits' => 4096);
- $config = array_merge(\OCP\Config::getSystemValue('openssl', array()), $config);
+ $config = array_merge(\OC::$server->getConfig()->getSystemValue('openssl', array()), $config);
return $config;
}
/**
- * find all share keys for a given file
- *
- * @param string $filePath path to the file name relative to the user's files dir
- * for example "subdir/filename.txt"
- * @param string $shareKeyPath share key prefix path relative to the user's data dir
- * for example "user1/files_encryption/share-keys/subdir/filename.txt"
- * @param \OC\Files\View $rootView root view, relative to data/
- * @return array list of share key files, path relative to data/$user
- */
- public static function findShareKeys($filePath, $shareKeyPath, \OC\Files\View $rootView) {
- $result = array();
-
- $user = \OCP\User::getUser();
- $util = new Util($rootView, $user);
- // get current sharing state
- $sharingEnabled = \OCP\Share::isEnabled();
-
- // get users sharing this file
- $usersSharing = $util->getSharingUsersArray($sharingEnabled, $filePath);
-
- $pathinfo = pathinfo($shareKeyPath);
-
- $baseDir = $pathinfo['dirname'] . '/';
- $fileName = $pathinfo['basename'];
- foreach ($usersSharing as $user) {
- $keyName = $fileName . '.' . $user . '.shareKey';
- if ($rootView->file_exists($baseDir . $keyName)) {
- $result[] = $baseDir . $keyName;
- } else {
- \OC_Log::write(
- 'Encryption library',
- 'No share key found for user "' . $user . '" for file "' . $fileName . '"',
- \OC_Log::WARN
- );
- }
- }
-
- return $result;
- }
-
- /**
* remember from which file the tmp file (getLocalFile() call) was created
* @param string $tmpFile path of tmp file
* @param string $originalFile path of the original file relative to data/
@@ -501,7 +460,7 @@ class Helper {
*/
public static function getCipher() {
- $cipher = \OCP\Config::getSystemValue('cipher', Crypt::DEFAULT_CIPHER);
+ $cipher = \OC::$server->getConfig()->getSystemValue('cipher', Crypt::DEFAULT_CIPHER);
if ($cipher !== 'AES-256-CFB' && $cipher !== 'AES-128-CFB') {
\OCP\Util::writeLog('files_encryption',
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/lib/hooks.php
index 3a0a37c0a59..7ddde0a3112 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/lib/hooks.php
@@ -3,8 +3,10 @@
/**
* ownCloud
*
- * @author Sam Tuke
- * @copyright 2012 Sam Tuke samtuke@owncloud.org
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Sam Tuke <samtuke@owncloud.org>
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -21,9 +23,7 @@
*
*/
-namespace OCA\Encryption;
-
-use OC\Files\Filesystem;
+namespace OCA\Files_Encryption;
/**
* Class for hook specific logic
@@ -35,7 +35,7 @@ class Hooks {
// file for which we want to delete the keys after the delete operation was successful
private static $deleteFiles = array();
// file for which we want to delete the keys after the delete operation was successful
- private static $umountedFiles = array();
+ private static $unmountedFiles = array();
/**
* Startup encryption backend upon user login
@@ -57,14 +57,14 @@ class Hooks {
\OC_Util::setupFS($params['uid']);
}
- $privateKey = \OCA\Encryption\Keymanager::getPrivateKey($view, $params['uid']);
+ $privateKey = Keymanager::getPrivateKey($view, $params['uid']);
// if no private key exists, check server configuration
if (!$privateKey) {
//check if all requirements are met
if (!Helper::checkRequirements() || !Helper::checkConfiguration()) {
$error_msg = $l->t("Missing requirements.");
- $hint = $l->t('Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.');
+ $hint = $l->t('Please make sure that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.');
\OC_App::disable('files_encryption');
\OCP\Util::writeLog('Encryption library', $error_msg . ' ' . $hint, \OCP\Util::ERROR);
\OCP\Template::printErrorPage($error_msg, $hint);
@@ -126,7 +126,7 @@ class Hooks {
* remove keys from session during logout
*/
public static function logout() {
- $session = new \OCA\Encryption\Session(new \OC\Files\View());
+ $session = new Session(new \OC\Files\View());
$session->removeKeys();
}
@@ -150,18 +150,7 @@ class Hooks {
public static function postDeleteUser($params) {
if (\OCP\App::isEnabled('files_encryption')) {
- $view = new \OC\Files\View('/');
-
- // cleanup public key
- $publicKey = '/public-keys/' . $params['uid'] . '.public.key';
-
- // Disable encryption proxy to prevent recursive calls
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
- $view->unlink($publicKey);
-
- \OC_FileProxy::$enabled = $proxyStatus;
+ Keymanager::deletePublicKey(new \OC\Files\View(), $params['uid']);
}
}
@@ -191,7 +180,7 @@ class Hooks {
if (Crypt::mode() === 'server') {
$view = new \OC\Files\View('/');
- $session = new \OCA\Encryption\Session($view);
+ $session = new Session($view);
// Get existing decrypted private key
$privateKey = $session->getPrivateKey();
@@ -242,10 +231,10 @@ class Hooks {
\OC_FileProxy::$enabled = false;
// Save public key
- $view->file_put_contents('/public-keys/' . $user . '.public.key', $keypair['publicKey']);
+ Keymanager::setPublicKey($keypair['publicKey'], $user);
// Encrypt private key with new password
- $encryptedKey = \OCA\Encryption\Crypt::symmetricEncryptFileContent($keypair['privateKey'], $newUserPassword, Helper::getCipher());
+ $encryptedKey = Crypt::symmetricEncryptFileContent($keypair['privateKey'], $newUserPassword, Helper::getCipher());
if ($encryptedKey) {
Keymanager::setPrivateKey($encryptedKey, $user);
@@ -263,6 +252,19 @@ class Hooks {
}
}
+ /**
+ * after password reset we create a new key pair for the user
+ *
+ * @param array $params
+ */
+ public static function postPasswordReset($params) {
+ $uid = $params['uid'];
+ $password = $params['password'];
+
+ $util = new Util(new \OC\Files\View(), $uid);
+ $util->replaceUserKeys($password);
+ }
+
/*
* check if files can be encrypted to every user.
*/
@@ -277,7 +279,7 @@ class Hooks {
$l = new \OC_L10N('files_encryption');
$users = array();
- $view = new \OC\Files\View('/public-keys/');
+ $view = new \OC\Files\View('/');
switch ($params['shareType']) {
case \OCP\Share::SHARE_TYPE_USER:
@@ -290,7 +292,7 @@ class Hooks {
$notConfigured = array();
foreach ($users as $user) {
- if (!$view->file_exists($user . '.public.key')) {
+ if (!Keymanager::publicKeyExists($view, $user)) {
$notConfigured[] = $user;
}
}
@@ -315,7 +317,7 @@ class Hooks {
$path = \OC\Files\Filesystem::getPath($params['fileSource']);
- self::updateKeyfiles($path, $params['itemType']);
+ self::updateKeyfiles($path);
}
}
@@ -323,12 +325,11 @@ class Hooks {
* update keyfiles and share keys recursively
*
* @param string $path to the file/folder
- * @param string $type 'file' or 'folder'
*/
- private static function updateKeyfiles($path, $type) {
+ private static function updateKeyfiles($path) {
$view = new \OC\Files\View('/');
$userId = \OCP\User::getUser();
- $session = new \OCA\Encryption\Session($view);
+ $session = new Session($view);
$util = new Util($view, $userId);
$sharingEnabled = \OCP\Share::isEnabled();
@@ -337,7 +338,7 @@ class Hooks {
$mountPoint = $mount->getMountPoint();
// if a folder was shared, get a list of all (sub-)folders
- if ($type === 'folder') {
+ if ($view->is_dir('/' . $userId . '/files' . $path)) {
$allFiles = $util->getAllFiles($path, $mountPoint);
} else {
$allFiles = array($path);
@@ -361,15 +362,16 @@ class Hooks {
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
$view = new \OC\Files\View('/');
- $userId = \OCP\User::getUser();
+ $userId = $params['uidOwner'];
+ $userView = new \OC\Files\View('/' . $userId . '/files');
$util = new Util($view, $userId);
- $path = \OC\Files\Filesystem::getPath($params['fileSource']);
+ $path = $userView->getPath($params['fileSource']);
// for group shares get a list of the group members
if ($params['shareType'] === \OCP\Share::SHARE_TYPE_GROUP) {
$userIds = \OC_Group::usersInGroup($params['shareWith']);
} else {
- if ($params['shareType'] === \OCP\Share::SHARE_TYPE_LINK) {
+ if ($params['shareType'] === \OCP\Share::SHARE_TYPE_LINK || $params['shareType'] === \OCP\Share::SHARE_TYPE_REMOTE) {
$userIds = array($util->getPublicShareKeyId());
} else {
$userIds = array($params['shareWith']);
@@ -394,11 +396,10 @@ class Hooks {
// Unshare every user who no longer has access to the file
$delUsers = array_diff($userIds, $sharingUsers);
-
- list($owner, $ownerPath) = $util->getUidAndFilename($path);
+ $keyPath = Keymanager::getKeyPath($view, $util, $path);
// delete share key
- Keymanager::delShareKey($view, $delUsers, $ownerPath, $owner);
+ Keymanager::delShareKey($view, $delUsers, $keyPath, $userId, $path);
}
}
@@ -424,37 +425,24 @@ class Hooks {
$user = \OCP\User::getUser();
$view = new \OC\Files\View('/');
$util = new Util($view, $user);
- list($ownerOld, $pathOld) = $util->getUidAndFilename($params['oldpath']);
// we only need to rename the keys if the rename happens on the same mountpoint
// otherwise we perform a stream copy, so we get a new set of keys
$mp1 = $view->getMountPoint('/' . $user . '/files/' . $params['oldpath']);
$mp2 = $view->getMountPoint('/' . $user . '/files/' . $params['newpath']);
- $type = $view->is_dir('/' . $user . '/files/' . $params['oldpath']) ? 'folder' : 'file';
+ $oldKeysPath = Keymanager::getKeyPath($view, $util, $params['oldpath']);
if ($mp1 === $mp2) {
- if ($util->isSystemWideMountPoint($pathOld)) {
- $oldShareKeyPath = 'files_encryption/share-keys/' . $pathOld;
- } else {
- $oldShareKeyPath = $ownerOld . '/' . 'files_encryption/share-keys/' . $pathOld;
- }
- // gather share keys here because in postRename() the file will be moved already
- $oldShareKeys = Helper::findShareKeys($pathOld, $oldShareKeyPath, $view);
- if (count($oldShareKeys) === 0) {
- \OC_Log::write(
- 'Encryption library', 'No share keys found for "' . $pathOld . '"',
- \OC_Log::WARN
- );
- }
self::$renamedFiles[$params['oldpath']] = array(
- 'uid' => $ownerOld,
- 'path' => $pathOld,
- 'type' => $type,
'operation' => $operation,
- 'sharekeys' => $oldShareKeys
+ 'oldKeysPath' => $oldKeysPath,
+ );
+ } else {
+ self::$renamedFiles[$params['oldpath']] = array(
+ 'operation' => 'cleanup',
+ 'oldKeysPath' => $oldKeysPath,
);
-
}
}
@@ -469,81 +457,40 @@ class Hooks {
return true;
}
- // Disable encryption proxy to prevent recursive calls
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
$view = new \OC\Files\View('/');
$userId = \OCP\User::getUser();
$util = new Util($view, $userId);
- $oldShareKeys = null;
- if (isset(self::$renamedFiles[$params['oldpath']]['uid']) &&
- isset(self::$renamedFiles[$params['oldpath']]['path'])) {
- $ownerOld = self::$renamedFiles[$params['oldpath']]['uid'];
- $pathOld = self::$renamedFiles[$params['oldpath']]['path'];
- $type = self::$renamedFiles[$params['oldpath']]['type'];
+ if (isset(self::$renamedFiles[$params['oldpath']]['operation']) &&
+ isset(self::$renamedFiles[$params['oldpath']]['oldKeysPath'])) {
$operation = self::$renamedFiles[$params['oldpath']]['operation'];
- $oldShareKeys = self::$renamedFiles[$params['oldpath']]['sharekeys'];
+ $oldKeysPath = self::$renamedFiles[$params['oldpath']]['oldKeysPath'];
unset(self::$renamedFiles[$params['oldpath']]);
+ if ($operation === 'cleanup') {
+ return $view->unlink($oldKeysPath);
+ }
} else {
\OCP\Util::writeLog('Encryption library', "can't get path and owner from the file before it was renamed", \OCP\Util::DEBUG);
- \OC_FileProxy::$enabled = $proxyStatus;
return false;
}
list($ownerNew, $pathNew) = $util->getUidAndFilename($params['newpath']);
- // Format paths to be relative to user files dir
- if ($util->isSystemWideMountPoint($pathOld)) {
- $oldKeyfilePath = 'files_encryption/keyfiles/' . $pathOld;
- $oldShareKeyPath = 'files_encryption/share-keys/' . $pathOld;
- } else {
- $oldKeyfilePath = $ownerOld . '/' . 'files_encryption/keyfiles/' . $pathOld;
- $oldShareKeyPath = $ownerOld . '/' . 'files_encryption/share-keys/' . $pathOld;
- }
-
if ($util->isSystemWideMountPoint($pathNew)) {
- $newKeyfilePath = 'files_encryption/keyfiles/' . $pathNew;
- $newShareKeyPath = 'files_encryption/share-keys/' . $pathNew;
+ $newKeysPath = 'files_encryption/keys/' . $pathNew;
} else {
- $newKeyfilePath = $ownerNew . '/files_encryption/keyfiles/' . $pathNew;
- $newShareKeyPath = $ownerNew . '/files_encryption/share-keys/' . $pathNew;
+ $newKeysPath = $ownerNew . '/files_encryption/keys/' . $pathNew;
}
- // create new key folders if it doesn't exists
- if (!$view->file_exists(dirname($newShareKeyPath))) {
- $view->mkdir(dirname($newShareKeyPath));
- }
- if (!$view->file_exists(dirname($newKeyfilePath))) {
- $view->mkdir(dirname($newKeyfilePath));
- }
-
- // handle share keys
- if ($type === 'file') {
- $oldKeyfilePath .= '.key';
- $newKeyfilePath .= '.key';
-
- foreach ($oldShareKeys as $src) {
- $dst = \OC\Files\Filesystem::normalizePath(str_replace($pathOld, $pathNew, $src));
- $view->$operation($src, $dst);
- }
-
- } else {
- // handle share-keys folders
- $view->$operation($oldShareKeyPath, $newShareKeyPath);
- }
-
- // Rename keyfile so it isn't orphaned
- if ($view->file_exists($oldKeyfilePath)) {
- $view->$operation($oldKeyfilePath, $newKeyfilePath);
+ // create key folders if it doesn't exists
+ if (!$view->file_exists(dirname($newKeysPath))) {
+ $view->mkdir(dirname($newKeysPath));
}
+ $view->$operation($oldKeysPath, $newKeysPath);
// update sharing-keys
- self::updateKeyfiles($params['newpath'], $type);
-
- \OC_FileProxy::$enabled = $proxyStatus;
+ self::updateKeyfiles($params['newpath']);
}
/**
@@ -554,10 +501,10 @@ class Hooks {
public static function preDisable($params) {
if ($params['app'] === 'files_encryption') {
- \OC_Preferences::deleteAppFromAllUsers('files_encryption');
+ \OC::$server->getConfig()->deleteAppFromAllUsers('files_encryption');
- $session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
- $session->setInitialized(\OCA\Encryption\Session::NOT_INITIALIZED);
+ $session = new Session(new \OC\Files\View('/'));
+ $session->setInitialized(Session::NOT_INITIALIZED);
}
}
@@ -567,8 +514,8 @@ class Hooks {
*/
public static function postEnable($params) {
if ($params['app'] === 'files_encryption') {
- $session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
- $session->setInitialized(\OCA\Encryption\Session::NOT_INITIALIZED);
+ $session = new Session(new \OC\Files\View('/'));
+ $session->setInitialized(Session::NOT_INITIALIZED);
}
}
@@ -579,37 +526,28 @@ class Hooks {
*/
public static function postDelete($params) {
- if (!isset(self::$deleteFiles[$params[\OC\Files\Filesystem::signal_param_path]])) {
+ $path = $params[\OC\Files\Filesystem::signal_param_path];
+
+ if (!isset(self::$deleteFiles[$path])) {
return true;
}
- $deletedFile = self::$deleteFiles[$params[\OC\Files\Filesystem::signal_param_path]];
- $path = $deletedFile['path'];
- $user = $deletedFile['uid'];
+ $deletedFile = self::$deleteFiles[$path];
+ $keyPath = $deletedFile['keyPath'];
// we don't need to remember the file any longer
- unset(self::$deleteFiles[$params[\OC\Files\Filesystem::signal_param_path]]);
+ unset(self::$deleteFiles[$path]);
$view = new \OC\Files\View('/');
// return if the file still exists and wasn't deleted correctly
- if ($view->file_exists('/' . $user . '/files/' . $path)) {
+ if ($view->file_exists('/' . \OCP\User::getUser() . '/files/' . $path)) {
return true;
}
- // Disable encryption proxy to prevent recursive calls
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
// Delete keyfile & shareKey so it isn't orphaned
- if (!Keymanager::deleteFileKey($view, $path, $user)) {
- \OCP\Util::writeLog('Encryption library',
- 'Keyfile or shareKey could not be deleted for file "' . $user.'/files/'.$path . '"', \OCP\Util::ERROR);
- }
+ $view->unlink($keyPath);
- Keymanager::delAllShareKeys($view, $user, $path);
-
- \OC_FileProxy::$enabled = $proxyStatus;
}
/**
@@ -618,6 +556,7 @@ class Hooks {
* @return boolean|null
*/
public static function preDelete($params) {
+ $view = new \OC\Files\View('/');
$path = $params[\OC\Files\Filesystem::signal_param_path];
// skip this method if the trash bin is enabled or if we delete a file
@@ -626,68 +565,61 @@ class Hooks {
return true;
}
- $util = new Util(new \OC\Files\View('/'), \OCP\USER::getUser());
- list($owner, $ownerPath) = $util->getUidAndFilename($path);
+ $util = new Util($view, \OCP\USER::getUser());
+
+ $keysPath = Keymanager::getKeyPath($view, $util, $path);
- self::$deleteFiles[$params[\OC\Files\Filesystem::signal_param_path]] = array(
- 'uid' => $owner,
- 'path' => $ownerPath);
+ self::$deleteFiles[$path] = array(
+ 'keyPath' => $keysPath);
}
/**
* unmount file from yourself
* remember files/folders which get unmounted
*/
- public static function preUmount($params) {
+ public static function preUnmount($params) {
+ $view = new \OC\Files\View('/');
+ $user = \OCP\User::getUser();
$path = $params[\OC\Files\Filesystem::signal_param_path];
- $user = \OCP\USER::getUser();
-
- $view = new \OC\Files\View();
- $itemType = $view->is_dir('/' . $user . '/files' . $path) ? 'folder' : 'file';
$util = new Util($view, $user);
list($owner, $ownerPath) = $util->getUidAndFilename($path);
- self::$umountedFiles[$params[\OC\Files\Filesystem::signal_param_path]] = array(
- 'uid' => $owner,
- 'path' => $ownerPath,
- 'itemType' => $itemType);
+ $keysPath = Keymanager::getKeyPath($view, $util, $path);
+
+ self::$unmountedFiles[$path] = array(
+ 'keyPath' => $keysPath,
+ 'owner' => $owner,
+ 'ownerPath' => $ownerPath
+ );
}
/**
* unmount file from yourself
*/
- public static function postUmount($params) {
+ public static function postUnmount($params) {
+
+ $path = $params[\OC\Files\Filesystem::signal_param_path];
+ $user = \OCP\User::getUser();
- if (!isset(self::$umountedFiles[$params[\OC\Files\Filesystem::signal_param_path]])) {
+ if (!isset(self::$unmountedFiles[$path])) {
return true;
}
- $umountedFile = self::$umountedFiles[$params[\OC\Files\Filesystem::signal_param_path]];
- $path = $umountedFile['path'];
- $user = $umountedFile['uid'];
- $itemType = $umountedFile['itemType'];
+ $umountedFile = self::$unmountedFiles[$path];
+ $keyPath = $umountedFile['keyPath'];
+ $owner = $umountedFile['owner'];
+ $ownerPath = $umountedFile['ownerPath'];
$view = new \OC\Files\View();
- $util = new Util($view, $user);
// we don't need to remember the file any longer
- unset(self::$umountedFiles[$params[\OC\Files\Filesystem::signal_param_path]]);
-
- // if we unshare a folder we need a list of all (sub-)files
- if ($itemType === 'folder') {
- $allFiles = $util->getAllFiles($path);
- } else {
- $allFiles = array($path);
- }
-
- foreach ($allFiles as $path) {
+ unset(self::$unmountedFiles[$path]);
- // check if the user still has access to the file, otherwise delete share key
- $sharingUsers = \OCP\Share::getUsersSharingFile($path, $user);
- if (!in_array(\OCP\User::getUser(), $sharingUsers['users'])) {
- Keymanager::delShareKey($view, array(\OCP\User::getUser()), $path, $user);
- }
+ // check if the user still has access to the file, otherwise delete share key
+ $sharingUsers = \OCP\Share::getUsersSharingFile($path, $user);
+ if (!in_array($user, $sharingUsers['users'])) {
+ Keymanager::delShareKey($view, array($user), $keyPath, $owner, $ownerPath);
}
}
diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php
index 9560126ef33..925bba578f4 100644
--- a/apps/files_encryption/lib/keymanager.php
+++ b/apps/files_encryption/lib/keymanager.php
@@ -3,8 +3,9 @@
/**
* ownCloud
*
- * @author Bjoern Schiessle
- * @copyright 2012 Bjoern Schiessle <schiessle@owncloud.com>
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -21,7 +22,7 @@
*
*/
-namespace OCA\Encryption;
+namespace OCA\Files_Encryption;
/**
* Class to manage storage and retrieval of encryption keys
@@ -29,48 +30,96 @@ namespace OCA\Encryption;
*/
class Keymanager {
+ // base dir where all the file related keys are stored
+ private static $keys_base_dir = '/files_encryption/keys/';
+ private static $encryption_base_dir = '/files_encryption';
+ private static $public_key_dir = '/files_encryption/public_keys';
+
+ private static $key_cache = array(); // cache keys
+
/**
- * retrieve the ENCRYPTED private key from a user
+ * read key from hard disk
*
- * @param \OC\Files\View $view
- * @param string $user
- * @return string private key or false (hopefully)
- * @note the key returned by this method must be decrypted before use
+ * @param string $path to key
+ * @return string|bool either the key or false
*/
- public static function getPrivateKey(\OC\Files\View $view, $user) {
+ private static function getKey($path, $view) {
- $path = '/' . $user . '/' . 'files_encryption' . '/' . $user . '.private.key';
$key = false;
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
+ if (isset(self::$key_cache[$path])) {
+ $key = self::$key_cache[$path];
+ } else {
- if ($view->file_exists($path)) {
- $key = $view->file_get_contents($path);
- }
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
- \OC_FileProxy::$enabled = $proxyStatus;
+ if ($view->file_exists($path)) {
+ $key = $view->file_get_contents($path);
+ self::$key_cache[$path] = $key;
+ }
+
+ \OC_FileProxy::$enabled = $proxyStatus;
+
+ }
return $key;
}
/**
- * retrieve public key for a specified user
+ * write key to disk
+ *
+ *
+ * @param string $path path to key directory
+ * @param string $name key name
+ * @param string $key key
* @param \OC\Files\View $view
- * @param string $userId
- * @return string public key or false
+ * @return bool
*/
- public static function getPublicKey(\OC\Files\View $view, $userId) {
-
+ private static function setKey($path, $name, $key, $view) {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
- $result = $view->file_get_contents('/public-keys/' . $userId . '.public.key');
+ self::keySetPreparation($view, $path);
+ $pathToKey = \OC\Files\Filesystem::normalizePath($path . '/' . $name);
+ $result = $view->file_put_contents($pathToKey, $key);
\OC_FileProxy::$enabled = $proxyStatus;
- return $result;
+ if (is_int($result) && $result > 0) {
+ self::$key_cache[$pathToKey] = $key;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * retrieve the ENCRYPTED private key from a user
+ *
+ * @param \OC\Files\View $view
+ * @param string $user
+ * @return string private key or false (hopefully)
+ * @note the key returned by this method must be decrypted before use
+ */
+ public static function getPrivateKey(\OC\Files\View $view, $user) {
+ $path = '/' . $user . '/' . 'files_encryption' . '/' . $user . '.privateKey';
+ return self::getKey($path, $view);
+ }
+
+ /**
+ * retrieve public key for a specified user
+ * @param \OC\Files\View $view
+ * @param string $userId
+ * @return string public key or false
+ */
+ public static function getPublicKey(\OC\Files\View $view, $userId) {
+ $path = self::$public_key_dir . '/' . $userId . '.publicKey';
+ return self::getKey($path, $view);
+ }
+
+ public static function getPublicKeyPath() {
+ return self::$public_key_dir;
}
/**
@@ -97,11 +146,8 @@ class Keymanager {
public static function getPublicKeys(\OC\Files\View $view, array $userIds) {
$keys = array();
-
foreach ($userIds as $userId) {
-
$keys[$userId] = self::getPublicKey($view, $userId);
-
}
return $keys;
@@ -112,7 +158,7 @@ class Keymanager {
* store file encryption key
*
* @param \OC\Files\View $view
- * @param \OCA\Encryption\Util $util
+ * @param \OCA\Files_Encryption\Util $util
* @param string $path relative path of the file, including filename
* @param string $catfile keyfile content
* @return bool true/false
@@ -120,259 +166,238 @@ class Keymanager {
* asymmetrically encrypt the keyfile before passing it to this method
*/
public static function setFileKey(\OC\Files\View $view, $util, $path, $catfile) {
+ $path = self::getKeyPath($view, $util, $path);
+ return self::setKey($path, 'fileKey', $catfile, $view);
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
+ }
+
+ /**
+ * get path to key folder for a given file
+ *
+ * @param \OC\Files\View $view relative to data directory
+ * @param \OCA\Files_Encryption\Util $util
+ * @param string $path path to the file, relative to the users file directory
+ * @return string
+ */
+ public static function getKeyPath($view, $util, $path) {
+
+ if ($view->is_dir('/' . \OCP\User::getUser() . '/' . $path)) {
+ throw new Exception\EncryptionException('file was expected but directoy was given', Exception\EncryptionException::GENERIC);
+ }
list($owner, $filename) = $util->getUidAndFilename($path);
+ $filename = Helper::stripPartialFileExtension($filename);
+ $filePath_f = ltrim($filename, '/');
// in case of system wide mount points the keys are stored directly in the data directory
if ($util->isSystemWideMountPoint($filename)) {
- $basePath = '/files_encryption/keyfiles';
+ $keyPath = self::$keys_base_dir . $filePath_f . '/';
} else {
- $basePath = '/' . $owner . '/files_encryption/keyfiles';
+ $keyPath = '/' . $owner . self::$keys_base_dir . $filePath_f . '/';
}
- $targetPath = self::keySetPreparation($view, $filename, $basePath);
-
- // try reusing key file if part file
- if (Helper::isPartialFilePath($targetPath)) {
+ return $keyPath;
+ }
- $result = $view->file_put_contents(
- $basePath . '/' . Helper::stripPartialFileExtension($targetPath) . '.key', $catfile);
+ /**
+ * get path to file key for a given file
+ *
+ * @param \OC\Files\View $view relative to data directory
+ * @param \OCA\Files_Encryption\Util $util
+ * @param string $path path to the file, relative to the users file directory
+ * @return string
+ */
+ public static function getFileKeyPath($view, $util, $path) {
+ $keyDir = self::getKeyPath($view, $util, $path);
+ return $keyDir . 'fileKey';
+ }
- } else {
+ /**
+ * get path to share key for a given user
+ *
+ * @param \OC\Files\View $view relateive to data directory
+ * @param \OCA\Files_Encryption\Util $util
+ * @param string $path path to file relative to the users files directoy
+ * @param string $uid user for whom we want the share-key path
+ * @retrun string
+ */
+ public static function getShareKeyPath($view, $util, $path, $uid) {
+ $keyDir = self::getKeyPath($view, $util, $path);
+ return $keyDir . $uid . '.shareKey';
+ }
- $result = $view->file_put_contents($basePath . '/' . $targetPath . '.key', $catfile);
+ /**
+ * delete key
+ *
+ * @param \OC\Files\View $view
+ * @param string $path
+ * @return boolean
+ */
+ private static function deleteKey($view, $path) {
+ $normalizedPath = \OC\Files\Filesystem::normalizePath($path);
+ $result = $view->unlink($normalizedPath);
+ if ($result) {
+ unset(self::$key_cache[$normalizedPath]);
+ return true;
}
- \OC_FileProxy::$enabled = $proxyStatus;
+ return false;
+ }
+
+ /**
+ * delete public key from a given user
+ *
+ * @param \OC\Files\View $view
+ * @param string $uid user
+ * @return bool
+ */
+ public static function deletePublicKey($view, $uid) {
+
+ $result = false;
+
+ if (!\OCP\User::userExists($uid)) {
+ $publicKey = self::$public_key_dir . '/' . $uid . '.publicKey';
+ self::deleteKey($view, $publicKey);
+ }
return $result;
+ }
+ /**
+ * check if public key for user exists
+ *
+ * @param \OC\Files\View $view
+ * @param string $uid
+ */
+ public static function publicKeyExists($view, $uid) {
+ return $view->file_exists(self::$public_key_dir . '/'. $uid . '.publicKey');
}
+
+
/**
* retrieve keyfile for an encrypted file
* @param \OC\Files\View $view
- * @param \OCA\Encryption\Util $util
+ * @param \OCA\Files_Encryption\Util $util
* @param string|false $filePath
- * @internal param \OCA\Encryption\file $string name
* @return string file key or false
* @note The keyfile returned is asymmetrically encrypted. Decryption
* of the keyfile must be performed by client code
*/
public static function getFileKey($view, $util, $filePath) {
+ $path = self::getFileKeyPath($view, $util, $filePath);
+ return self::getKey($path, $view);
+ }
+ /**
+ * store private key from the user
+ * @param string $key
+ * @return bool
+ * @note Encryption of the private key must be performed by client code
+ * as no encryption takes place here
+ */
+ public static function setPrivateKey($key, $user = '') {
- list($owner, $filename) = $util->getUidAndFilename($filePath);
- $filename = Helper::stripPartialFileExtension($filename);
- $filePath_f = ltrim($filename, '/');
-
- // in case of system wide mount points the keys are stored directly in the data directory
- if ($util->isSystemWideMountPoint($filename)) {
- $keyfilePath = '/files_encryption/keyfiles/' . $filePath_f . '.key';
- } else {
- $keyfilePath = '/' . $owner . '/files_encryption/keyfiles/' . $filePath_f . '.key';
- }
-
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
- if ($view->file_exists($keyfilePath)) {
-
- $result = $view->file_get_contents($keyfilePath);
-
- } else {
-
- $result = false;
-
- }
-
- \OC_FileProxy::$enabled = $proxyStatus;
+ $user = $user === '' ? \OCP\User::getUser() : $user;
+ $path = '/' . $user . '/files_encryption';
+ $header = Crypt::generateHeader();
- return $result;
+ return self::setKey($path, $user . '.privateKey', $header . $key, new \OC\Files\View());
}
/**
- * Delete a keyfile
+ * check if recovery key exists
*
* @param \OC\Files\View $view
- * @param string $path path of the file the key belongs to
- * @param string $userId the user to whom the file belongs
- * @return bool Outcome of unlink operation
- * @note $path must be relative to data/user/files. e.g. mydoc.txt NOT
- * /data/admin/files/mydoc.txt
+ * @return bool
*/
- public static function deleteFileKey($view, $path, $userId=null) {
+ public static function recoveryKeyExists($view) {
- $trimmed = ltrim($path, '/');
-
- if ($trimmed === '') {
- \OCP\Util::writeLog('Encryption library',
- 'Can\'t delete file-key empty path given!', \OCP\Util::ERROR);
- return false;
- }
+ $result = false;
- if ($userId === null) {
- $userId = Helper::getUser($path);
+ $recoveryKeyId = Helper::getRecoveryKeyId();
+ if ($recoveryKeyId) {
+ $result = ($view->file_exists(self::$public_key_dir . '/' . $recoveryKeyId . ".publicKey")
+ && $view->file_exists(self::$encryption_base_dir . '/' . $recoveryKeyId . ".privateKey"));
}
- $util = new Util($view, $userId);
- if($util->isSystemWideMountPoint($path)) {
- $keyPath = '/files_encryption/keyfiles/' . $trimmed;
- } else {
- $keyPath = '/' . $userId . '/files_encryption/keyfiles/' . $trimmed;
- }
+ return $result;
+ }
+ public static function publicShareKeyExists($view) {
$result = false;
- $fileExists = $view->file_exists('/' . $userId . '/files/' . $trimmed);
- if ($view->is_dir($keyPath) && !$fileExists) {
- \OCP\Util::writeLog('files_encryption', 'deleteFileKey: delete file key: ' . $keyPath, \OCP\Util::DEBUG);
- $result = $view->unlink($keyPath);
- } elseif ($view->file_exists($keyPath . '.key') && !$fileExists) {
- \OCP\Util::writeLog('files_encryption', 'deleteFileKey: delete file key: ' . $keyPath, \OCP\Util::DEBUG);
- $result = $view->unlink($keyPath . '.key');
-
- }
+ $publicShareKeyId = Helper::getPublicShareKeyId();
+ if ($publicShareKeyId) {
+ $result = ($view->file_exists(self::$public_key_dir . '/' . $publicShareKeyId . ".publicKey")
+ && $view->file_exists(self::$encryption_base_dir . '/' . $publicShareKeyId . ".privateKey"));
- if ($fileExists) {
- \OCP\Util::writeLog('Encryption library',
- 'Did not delete the file key, file still exists: ' . '/' . $userId . '/files/' . $trimmed, \OCP\Util::ERROR);
- } elseif (!$result) {
- \OCP\Util::writeLog('Encryption library',
- 'Could not delete keyfile; does not exist: "' . $keyPath, \OCP\Util::ERROR);
}
return $result;
-
}
/**
- * store private key from the user
+ * store public key from the user
* @param string $key
+ * @param string $user
+ *
* @return bool
- * @note Encryption of the private key must be performed by client code
- * as no encryption takes place here
*/
- public static function setPrivateKey($key, $user = '') {
+ public static function setPublicKey($key, $user = '') {
- if ($user === '') {
- $user = \OCP\User::getUser();
- }
-
- $header = Crypt::generateHeader();
-
- $view = new \OC\Files\View('/' . $user . '/files_encryption');
-
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
- if (!$view->file_exists('')) {
- $view->mkdir('');
- }
-
- $result = $view->file_put_contents($user . '.private.key', $header . $key);
-
- \OC_FileProxy::$enabled = $proxyStatus;
-
- return $result;
+ $user = $user === '' ? \OCP\User::getUser() : $user;
+ return self::setKey(self::$public_key_dir, $user . '.publicKey', $key, new \OC\Files\View('/'));
}
/**
* write private system key (recovery and public share key) to disk
*
* @param string $key encrypted key
- * @param string $keyName name of the key file
+ * @param string $keyName name of the key
* @return boolean
*/
public static function setPrivateSystemKey($key, $keyName) {
+ $keyName = $keyName . '.privateKey';
$header = Crypt::generateHeader();
- $view = new \OC\Files\View('/owncloud_private_key');
-
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
- if (!$view->file_exists('')) {
- $view->mkdir('');
- }
-
- $result = $view->file_put_contents($keyName, $header . $key);
-
- \OC_FileProxy::$enabled = $proxyStatus;
-
- return $result;
+ return self::setKey(self::$encryption_base_dir, $keyName,$header . $key, new \OC\Files\View());
}
/**
- * store share key
+ * read private system key (recovery and public share key) from disk
*
- * @param \OC\Files\View $view
- * @param string $path where the share key is stored
- * @param string $shareKey
- * @return bool true/false
- * @note The keyfile is not encrypted here. Client code must
- * asymmetrically encrypt the keyfile before passing it to this method
+ * @param string $keyName name of the key
+ * @return string|boolean private system key or false
*/
- private static function setShareKey(\OC\Files\View $view, $path, $shareKey) {
-
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
- $result = $view->file_put_contents($path, $shareKey);
-
- \OC_FileProxy::$enabled = $proxyStatus;
-
- if (is_int($result) && $result > 0) {
- return true;
- } else {
- return false;
- }
+ public static function getPrivateSystemKey($keyName) {
+ $path = $keyName . '.privateKey';
+ return self::getKey($path, new \OC\Files\View(self::$encryption_base_dir));
}
/**
* store multiple share keys for a single file
* @param \OC\Files\View $view
- * @param \OCA\Encryption\Util $util
+ * @param \OCA\Files_Encryption\Util $util
* @param string $path
* @param array $shareKeys
* @return bool
*/
- public static function setShareKeys(\OC\Files\View $view, $util, $path, array $shareKeys) {
-
- // $shareKeys must be an array with the following format:
- // [userId] => [encrypted key]
-
- list($owner, $filename) = $util->getUidAndFilename($path);
+ public static function setShareKeys($view, $util, $path, array $shareKeys) {
// in case of system wide mount points the keys are stored directly in the data directory
- if ($util->isSystemWideMountPoint($filename)) {
- $basePath = '/files_encryption/share-keys';
- } else {
- $basePath = '/' . $owner . '/files_encryption/share-keys';
- }
+ $basePath = Keymanager::getKeyPath($view, $util, $path);
- $shareKeyPath = self::keySetPreparation($view, $filename, $basePath);
+ self::keySetPreparation($view, $basePath);
$result = true;
foreach ($shareKeys as $userId => $shareKey) {
-
- // try reusing key file if part file
- if (Helper::isPartialFilePath($shareKeyPath)) {
- $writePath = $basePath . '/' . Helper::stripPartialFileExtension($shareKeyPath) . '.' . $userId . '.shareKey';
- } else {
- $writePath = $basePath . '/' . $shareKeyPath . '.' . $userId . '.shareKey';
- }
-
- if (!self::setShareKey($view, $writePath, $shareKey)) {
-
+ if (!self::setKey($basePath, $userId . '.shareKey', $shareKey, $view)) {
// If any of the keys are not set, flag false
$result = false;
}
@@ -386,95 +411,15 @@ class Keymanager {
* retrieve shareKey for an encrypted file
* @param \OC\Files\View $view
* @param string $userId
- * @param \OCA\Encryption\Util $util
+ * @param \OCA\Files_Encryption\Util $util
* @param string $filePath
* @return string file key or false
* @note The sharekey returned is encrypted. Decryption
* of the keyfile must be performed by client code
*/
- public static function getShareKey(\OC\Files\View $view, $userId, $util, $filePath) {
-
- // try reusing key file if part file
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
- list($owner, $filename) = $util->getUidAndFilename($filePath);
- $filename = Helper::stripPartialFileExtension($filename);
- // in case of system wide mount points the keys are stored directly in the data directory
- if ($util->isSystemWideMountPoint($filename)) {
- $shareKeyPath = '/files_encryption/share-keys/' . $filename . '.' . $userId . '.shareKey';
- } else {
- $shareKeyPath = '/' . $owner . '/files_encryption/share-keys/' . $filename . '.' . $userId . '.shareKey';
- }
-
- if ($view->file_exists($shareKeyPath)) {
-
- $result = $view->file_get_contents($shareKeyPath);
-
- } else {
-
- $result = false;
-
- }
-
- \OC_FileProxy::$enabled = $proxyStatus;
-
- return $result;
-
- }
-
- /**
- * delete all share keys of a given file
- * @param \OC\Files\View $view
- * @param string $userId owner of the file
- * @param string $filePath path to the file, relative to the owners file dir
- */
- public static function delAllShareKeys($view, $userId, $filePath) {
-
- $filePath = ltrim($filePath, '/');
-
- if ($view->file_exists('/' . $userId . '/files/' . $filePath)) {
- \OCP\Util::writeLog('Encryption library',
- 'File still exists, stop deleting share keys!', \OCP\Util::ERROR);
- return false;
- }
-
- if ($filePath === '') {
- \OCP\Util::writeLog('Encryption library',
- 'Can\'t delete share-keys empty path given!', \OCP\Util::ERROR);
- return false;
- }
-
- $util = new util($view, $userId);
-
- if ($util->isSystemWideMountPoint($filePath)) {
- $baseDir = '/files_encryption/share-keys/';
- } else {
- $baseDir = $userId . '/files_encryption/share-keys/';
- }
-
- $result = true;
-
- if ($view->is_dir($baseDir . $filePath)) {
- \OCP\Util::writeLog('files_encryption', 'delAllShareKeys: delete share keys: ' . $baseDir . $filePath, \OCP\Util::DEBUG);
- $result = $view->unlink($baseDir . $filePath);
- } else {
- $sharingEnabled = \OCP\Share::isEnabled();
- $users = $util->getSharingUsersArray($sharingEnabled, $filePath);
- foreach($users as $user) {
- $keyName = $baseDir . $filePath . '.' . $user . '.shareKey';
- if ($view->file_exists($keyName)) {
- \OCP\Util::writeLog(
- 'files_encryption',
- 'dellAllShareKeys: delete share keys: "' . $keyName . '"',
- \OCP\Util::DEBUG
- );
- $result &= $view->unlink($keyName);
- }
- }
- }
-
- return (bool)$result;
+ public static function getShareKey($view, $userId, $util, $filePath) {
+ $path = self::getShareKeyPath($view, $util, $filePath, $userId);
+ return self::getKey($path, $view);
}
/**
@@ -482,45 +427,19 @@ class Keymanager {
*
* @param \OC\Files\View $view relative to data/
* @param array $userIds list of users we want to remove
- * @param string $filename the owners name of the file for which we want to remove the users relative to data/user/files
- * @param string $owner owner of the file
+ * @param string $keyPath
+ * @param string $owner the owner of the file
+ * @param string $ownerPath the owners name of the file for which we want to remove the users relative to data/user/files
*/
- public static function delShareKey($view, $userIds, $filename, $owner) {
-
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
- $util = new Util($view, $owner);
+ public static function delShareKey($view, $userIds, $keysPath, $owner, $ownerPath) {
- if ($util->isSystemWideMountPoint($filename)) {
- $shareKeyPath = \OC\Files\Filesystem::normalizePath('/files_encryption/share-keys/' . $filename);
- } else {
- $shareKeyPath = \OC\Files\Filesystem::normalizePath('/' . $owner . '/files_encryption/share-keys/' . $filename);
+ $key = array_search($owner, $userIds, true);
+ if ($key !== false && $view->file_exists('/' . $owner . '/files/' . $ownerPath)) {
+ unset($userIds[$key]);
}
- if ($view->is_dir($shareKeyPath)) {
+ self::recursiveDelShareKeys($keysPath, $userIds, $view);
- self::recursiveDelShareKeys($shareKeyPath, $userIds, $owner, $view);
-
- } else {
-
- foreach ($userIds as $userId) {
-
- if ($userId === $owner && $view->file_exists('/' . $owner . '/files/' . $filename)) {
- \OCP\Util::writeLog('files_encryption', 'Tried to delete owner key, but the file still exists!', \OCP\Util::FATAL);
- continue;
- }
- $result = $view->unlink($shareKeyPath . '.' . $userId . '.shareKey');
- \OCP\Util::writeLog('files_encryption', 'delShareKey: delete share key: ' . $shareKeyPath . '.' . $userId . '.shareKey' , \OCP\Util::DEBUG);
- if (!$result) {
- \OCP\Util::writeLog('Encryption library',
- 'Could not delete shareKey; does not exist: "' . $shareKeyPath . '.' . $userId
- . '.shareKey"', \OCP\Util::ERROR);
- }
- }
- }
-
- \OC_FileProxy::$enabled = $proxyStatus;
}
/**
@@ -528,35 +447,23 @@ class Keymanager {
*
* @param string $dir directory
* @param array $userIds user ids for which the share keys should be deleted
- * @param string $owner owner of the file
* @param \OC\Files\View $view view relative to data/
*/
- private static function recursiveDelShareKeys($dir, $userIds, $owner, $view) {
+ private static function recursiveDelShareKeys($dir, $userIds, $view) {
$dirContent = $view->opendir($dir);
- $dirSlices = explode('/', ltrim($dir, '/'));
- $realFileDir = '/' . $owner . '/files/' . implode('/', array_slice($dirSlices, 3)) . '/';
if (is_resource($dirContent)) {
while (($file = readdir($dirContent)) !== false) {
if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
if ($view->is_dir($dir . '/' . $file)) {
- self::recursiveDelShareKeys($dir . '/' . $file, $userIds, $owner, $view);
+ self::recursiveDelShareKeys($dir . '/' . $file, $userIds, $view);
} else {
foreach ($userIds as $userId) {
- $fileNameFromShareKey = self::getFilenameFromShareKey($file, $userId);
- if (!$fileNameFromShareKey) {
- continue;
+ if ($userId . '.shareKey' === $file) {
+ \OCP\Util::writeLog('files_encryption', 'recursiveDelShareKey: delete share key: ' . $file, \OCP\Util::DEBUG);
+ self::deleteKey($view, $dir . '/' . $file);
}
- $realFile = $realFileDir . $fileNameFromShareKey;
-
- if ($userId === $owner &&
- $view->file_exists($realFile)) {
- \OCP\Util::writeLog('files_encryption', 'original file still exists, keep owners share key!', \OCP\Util::ERROR);
- continue;
- }
- \OCP\Util::writeLog('files_encryption', 'recursiveDelShareKey: delete share key: ' . $file, \OCP\Util::DEBUG);
- $view->unlink($dir . '/' . $file);
}
}
}
@@ -567,21 +474,15 @@ class Keymanager {
/**
* Make preparations to vars and filesystem for saving a keyfile
- * @param string|boolean $path
+ *
+ * @param \OC\Files\View $view
+ * @param string $path relatvie to the views root
* @param string $basePath
*/
- protected static function keySetPreparation(\OC\Files\View $view, $path, $basePath) {
-
- $targetPath = ltrim($path, '/');
-
- $path_parts = pathinfo($targetPath);
-
+ protected static function keySetPreparation($view, $path) {
// If the file resides within a subdirectory, create it
- if (
- isset($path_parts['dirname'])
- && !$view->file_exists($basePath . '/' . $path_parts['dirname'])
- ) {
- $sub_dirs = explode('/', $basePath . '/' . $path_parts['dirname']);
+ if (!$view->file_exists($path)) {
+ $sub_dirs = explode('/', $path);
$dir = '';
foreach ($sub_dirs as $sub_dir) {
$dir .= '/' . $sub_dir;
@@ -590,27 +491,6 @@ class Keymanager {
}
}
}
-
- return $targetPath;
-
}
- /**
- * extract filename from share key name
- * @param string $shareKey (filename.userid.sharekey)
- * @param string $userId
- * @return string|false filename or false
- */
- protected static function getFilenameFromShareKey($shareKey, $userId) {
- $expectedSuffix = '.' . $userId . '.' . 'shareKey';
- $suffixLen = strlen($expectedSuffix);
-
- $suffix = substr($shareKey, -$suffixLen);
-
- if ($suffix !== $expectedSuffix) {
- return false;
- }
-
- return substr($shareKey, 0, -$suffixLen);
- }
}
diff --git a/apps/files_encryption/lib/migration.php b/apps/files_encryption/lib/migration.php
index 59389911b5b..1bab1dfe4a5 100644
--- a/apps/files_encryption/lib/migration.php
+++ b/apps/files_encryption/lib/migration.php
@@ -2,8 +2,9 @@
/**
* ownCloud
*
- * @author Thomas Müller
- * @copyright 2014 Thomas Müller deepdiver@owncloud.com
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -25,26 +26,257 @@ namespace OCA\Files_Encryption;
class Migration {
- public function __construct($tableName = 'encryption') {
- $this->tableName = $tableName;
+ /**
+ * @var \OC\Files\View
+ */
+ private $view;
+ private $public_share_key_id;
+ private $recovery_key_id;
+
+ public function __construct() {
+ $this->view = new \OC\Files\View();
+ $this->public_share_key_id = Helper::getPublicShareKeyId();
+ $this->recovery_key_id = Helper::getRecoveryKeyId();
+ }
+
+ public function reorganizeFolderStructure() {
+
+ $this->createPathForKeys('/files_encryption');
+
+ // backup system wide folders
+ $this->backupSystemWideKeys();
+
+ // rename public keys
+ $this->renamePublicKeys();
+
+ // rename system wide mount point
+ $this->renameFileKeys('', '/files_encryption/keyfiles');
+
+ // rename system private keys
+ $this->renameSystemPrivateKeys();
+
+ // delete old system wide folders
+ $this->view->deleteAll('/public-keys');
+ $this->view->deleteAll('/owncloud_private_key');
+ $this->view->deleteAll('/files_encryption/share-keys');
+ $this->view->deleteAll('/files_encryption/keyfiles');
+
+ $users = \OCP\User::getUsers();
+ foreach ($users as $user) {
+ // backup all keys
+ if ($this->backupUserKeys($user)) {
+ // create new 'key' folder
+ $this->view->mkdir($user . '/files_encryption/keys');
+ // rename users private key
+ $this->renameUsersPrivateKey($user);
+ // rename file keys
+ $path = $user . '/files_encryption/keyfiles';
+ $this->renameFileKeys($user, $path);
+ $trashPath = $user . '/files_trashbin/keyfiles';
+ if (\OC_App::isEnabled('files_trashbin') && $this->view->is_dir($trashPath)) {
+ $this->renameFileKeys($user, $trashPath, true);
+ $this->view->deleteAll($trashPath);
+ $this->view->deleteAll($user . '/files_trashbin/share-keys');
+ }
+ // delete old folders
+ $this->deleteOldKeys($user);
+ }
+ }
+ }
+
+ private function backupSystemWideKeys() {
+ $backupDir = 'encryption_migration_backup_' . date("Y-m-d_H-i-s");
+ $this->view->mkdir($backupDir);
+ $this->view->copy('owncloud_private_key', $backupDir . '/owncloud_private_key');
+ $this->view->copy('public-keys', $backupDir . '/public-keys');
+ $this->view->copy('files_encryption', $backupDir . '/files_encryption');
+ }
+
+ private function backupUserKeys($user) {
+ $encryptionDir = $user . '/files_encryption';
+ if ($this->view->is_dir($encryptionDir)) {
+ $backupDir = $user . '/encryption_migration_backup_' . date("Y-m-d_H-i-s");
+ $this->view->mkdir($backupDir);
+ $this->view->copy($encryptionDir, $backupDir);
+ return true;
+ }
+ return false;
+ }
+
+ private function renamePublicKeys() {
+ $dh = $this->view->opendir('public-keys');
+
+ $this->createPathForKeys('files_encryption/public_keys');
+
+ if (is_resource($dh)) {
+ while (($oldPublicKey = readdir($dh)) !== false) {
+ if (!\OC\Files\Filesystem::isIgnoredDir($oldPublicKey)) {
+ $newPublicKey = substr($oldPublicKey, 0, strlen($oldPublicKey) - strlen('.public.key')) . '.publicKey';
+ $this->view->rename('public-keys/' . $oldPublicKey , 'files_encryption/public_keys/' . $newPublicKey);
+ }
+ }
+ closedir($dh);
+ }
+ }
+
+ private function renameSystemPrivateKeys() {
+ $dh = $this->view->opendir('owncloud_private_key');
+
+ if (is_resource($dh)) {
+ while (($oldPrivateKey = readdir($dh)) !== false) {
+ if (!\OC\Files\Filesystem::isIgnoredDir($oldPrivateKey)) {
+ $newPrivateKey = substr($oldPrivateKey, 0, strlen($oldPrivateKey) - strlen('.private.key')) . '.privateKey';
+ $this->view->rename('owncloud_private_key/' . $oldPrivateKey , 'files_encryption/' . $newPrivateKey);
+ }
+ }
+ closedir($dh);
+ }
+ }
+
+ private function renameUsersPrivateKey($user) {
+ $oldPrivateKey = $user . '/files_encryption/' . $user . '.private.key';
+ $newPrivateKey = substr($oldPrivateKey, 0, strlen($oldPrivateKey) - strlen('.private.key')) . '.privateKey';
+
+ $this->view->rename($oldPrivateKey, $newPrivateKey);
+ }
+
+ private function getFileName($file, $trash) {
+
+ $extLength = strlen('.key');
+
+ if ($trash) {
+ $parts = explode('.', $file);
+ if ($parts[count($parts) - 1] !== 'key') {
+ $extLength = $extLength + strlen('.' . $parts[count($parts) - 1]);
+ }
+ }
+
+ $filename = substr($file, 0, strlen($file) - $extLength);
+
+ return $filename;
+ }
+
+ private function getExtension($file, $trash) {
+
+ $extension = '';
+
+ if ($trash) {
+ $parts = explode('.', $file);
+ if ($parts[count($parts) - 1] !== 'key') {
+ $extension = '.' . $parts[count($parts) - 1];
+ }
+ }
+
+ return $extension;
+ }
+
+ private function getFilePath($path, $user, $trash) {
+ $offset = $trash ? strlen($user . '/files_trashbin/keyfiles') : strlen($user . '/files_encryption/keyfiles');
+ return substr($path, $offset);
+ }
+
+ private function getTargetDir($user, $filePath, $filename, $extension, $trash) {
+ if ($trash) {
+ $targetDir = $user . '/files_trashbin/keys/' . $filePath . '/' . $filename . $extension;
+ } else {
+ $targetDir = $user . '/files_encryption/keys/' . $filePath . '/' . $filename . $extension;
+ }
+
+ return $targetDir;
+ }
+
+ private function renameFileKeys($user, $path, $trash = false) {
+
+ $dh = $this->view->opendir($path);
+
+ if (is_resource($dh)) {
+ while (($file = readdir($dh)) !== false) {
+ if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
+ if ($this->view->is_dir($path . '/' . $file)) {
+ $this->renameFileKeys($user, $path . '/' . $file, $trash);
+ } else {
+ $filename = $this->getFileName($file, $trash);
+ $filePath = $this->getFilePath($path, $user, $trash);
+ $extension = $this->getExtension($file, $trash);
+ $targetDir = $this->getTargetDir($user, $filePath, $filename, $extension, $trash);
+ $this->createPathForKeys($targetDir);
+ $this->view->copy($path . '/' . $file, $targetDir . '/fileKey');
+ $this->renameShareKeys($user, $filePath, $filename, $targetDir, $trash);
+ }
+ }
+ }
+ closedir($dh);
+ }
}
- // migrate settings from oc_encryption to oc_preferences
- public function dropTableEncryption() {
- $tableName = $this->tableName;
- if (!\OC_DB::tableExists($tableName)) {
- return;
+ private function getOldShareKeyPath($user, $filePath, $trash) {
+ if ($trash) {
+ $oldShareKeyPath = $user . '/files_trashbin/share-keys/' . $filePath;
+ } else {
+ $oldShareKeyPath = $user . '/files_encryption/share-keys/' . $filePath;
}
- $sql = "select `uid`, max(`recovery_enabled`) as `recovery_enabled`, min(`migration_status`) as `migration_status` from `*PREFIX*$tableName` group by `uid`";
- $query = \OCP\DB::prepare($sql);
- $result = $query->execute(array())->fetchAll();
- foreach ($result as $row) {
- \OC_Preferences::setValue($row['uid'], 'files_encryption', 'recovery_enabled', $row['recovery_enabled']);
- \OC_Preferences::setValue($row['uid'], 'files_encryption', 'migration_status', $row['migration_status']);
+ return $oldShareKeyPath;
+ }
+
+ private function getUidFromShareKey($file, $filename, $trash) {
+ $extLength = strlen('.shareKey');
+ if ($trash) {
+ $parts = explode('.', $file);
+ if ($parts[count($parts) - 1] !== 'shareKey') {
+ $extLength = $extLength + strlen('.' . $parts[count($parts) - 1]);
+ }
}
- \OC_DB::dropTable($tableName);
+ $uid = substr($file, strlen($filename) + 1, $extLength * -1);
+
+ return $uid;
}
+ private function renameShareKeys($user, $filePath, $filename, $target, $trash) {
+ $oldShareKeyPath = $this->getOldShareKeyPath($user, $filePath, $trash);
+ $dh = $this->view->opendir($oldShareKeyPath);
+
+ if (is_resource($dh)) {
+ while (($file = readdir($dh)) !== false) {
+ if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
+ if ($this->view->is_dir($oldShareKeyPath . '/' . $file)) {
+ continue;
+ } else {
+ if (substr($file, 0, strlen($filename) +1) === $filename . '.') {
+
+ $uid = $this->getUidFromShareKey($file, $filename, $trash);
+ if ($uid === $this->public_share_key_id ||
+ $uid === $this->recovery_key_id ||
+ \OCP\User::userExists($uid)) {
+ $this->view->copy($oldShareKeyPath . '/' . $file, $target . '/' . $uid . '.shareKey');
+ }
+ }
+ }
+
+ }
+ }
+ closedir($dh);
+ }
+ }
+
+ private function deleteOldKeys($user) {
+ $this->view->deleteAll($user . '/files_encryption/keyfiles');
+ $this->view->deleteAll($user . '/files_encryption/share-keys');
+ }
+
+ private function createPathForKeys($path) {
+ if (!$this->view->file_exists($path)) {
+ $sub_dirs = explode('/', $path);
+ $dir = '';
+ foreach ($sub_dirs as $sub_dir) {
+ $dir .= '/' . $sub_dir;
+ if (!$this->view->is_dir($dir)) {
+ $this->view->mkdir($dir);
+ }
+ }
+ }
+ }
+
+
}
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 3b9dcbe7767..ba78c81aa35 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -3,10 +3,11 @@
/**
* ownCloud
*
- * @author Bjoern Schiessle, Sam Tuke, Robin Appelman
- * @copyright 2012 Sam Tuke <samtuke@owncloud.com>
- * 2012 Robin Appelman <icewind1991@gmail.com>
- * 2014 Bjoern Schiessle <schiessle@owncloud.com>
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
+ * @author Sam Tuke <samtuke@owncloud.com>
+ * @author Robin Appelman <icewind1991@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -29,11 +30,11 @@
* webui.
*/
-namespace OCA\Encryption;
+namespace OCA\Files_Encryption;
/**
* Class Proxy
- * @package OCA\Encryption
+ * @package OCA\Files_Encryption
*/
class Proxy extends \OC_FileProxy {
@@ -91,12 +92,10 @@ class Proxy extends \OC_FileProxy {
private function shouldEncrypt($path, $mode = 'w') {
$userId = Helper::getUser($path);
- $session = new Session(new \OC\Files\View());
// don't call the crypt stream wrapper, if...
if (
- $session->getInitialized() !== Session::INIT_SUCCESSFUL // encryption successful initialized
- || Crypt::mode() !== 'server' // we are not in server-side-encryption mode
+ Crypt::mode() !== 'server' // we are not in server-side-encryption mode
|| $this->isExcludedPath($path, $userId) // if path is excluded from encryption
|| substr($path, 0, 8) === 'crypt://' // we are already in crypt mode
) {
@@ -131,7 +130,7 @@ class Proxy extends \OC_FileProxy {
$view = new \OC\Files\View('/');
// get relative path
- $relativePath = \OCA\Encryption\Helper::stripUserFilesPath($path);
+ $relativePath = Helper::stripUserFilesPath($path);
if (!isset($relativePath)) {
return true;
@@ -206,11 +205,11 @@ class Proxy extends \OC_FileProxy {
public function postFile_get_contents($path, $data) {
$plainData = null;
- $view = new \OC\Files\View('/');
// If data is a catfile
if (
Crypt::mode() === 'server'
+ && $this->shouldEncrypt($path)
&& Crypt::isCatfileContent($data)
) {
@@ -339,15 +338,15 @@ class Proxy extends \OC_FileProxy {
}
// get relative path
- $relativePath = \OCA\Encryption\Helper::stripUserFilesPath($path);
+ $relativePath = Helper::stripUserFilesPath($path);
// if path is empty we cannot resolve anything
if (empty($relativePath)) {
return $size;
}
- // get file info from database/cache if not .part file
- if (empty($fileInfo) && !Helper::isPartialFilePath($path)) {
+ // get file info from database/cache
+ if (empty($fileInfo)) {
$proxyState = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$fileInfo = $view->getFileInfo($path);
diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index 7bd4fd02421..4c70bc7e8fc 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -2,8 +2,10 @@
/**
* ownCloud
*
- * @author Sam Tuke
- * @copyright 2012 Sam Tuke samtuke@owncloud.com
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Sam Tuke <samtuke@owncloud.com>
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -20,7 +22,7 @@
*
*/
-namespace OCA\Encryption;
+namespace OCA\Files_Encryption;
/**
* Class for handling encryption related session data
@@ -29,6 +31,7 @@ namespace OCA\Encryption;
class Session {
private $view;
+ private static $publicShareKey = false;
const NOT_INITIALIZED = '0';
const INIT_EXECUTED = '1';
@@ -45,64 +48,48 @@ class Session {
$this->view = $view;
- if (!$this->view->is_dir('owncloud_private_key')) {
+ if (!$this->view->is_dir('files_encryption')) {
- $this->view->mkdir('owncloud_private_key');
+ $this->view->mkdir('files_encryption');
}
$appConfig = \OC::$server->getAppConfig();
- $publicShareKeyId = $appConfig->getValue('files_encryption', 'publicShareKeyId');
+ $publicShareKeyId = Helper::getPublicShareKeyId();
- if ($publicShareKeyId === null) {
+ if ($publicShareKeyId === false) {
$publicShareKeyId = 'pubShare_' . substr(md5(time()), 0, 8);
$appConfig->setValue('files_encryption', 'publicShareKeyId', $publicShareKeyId);
}
- if (
- !$this->view->file_exists("/public-keys/" . $publicShareKeyId . ".public.key")
- || !$this->view->file_exists("/owncloud_private_key/" . $publicShareKeyId . ".private.key")
- ) {
+ if (!Keymanager::publicShareKeyExists($view)) {
$keypair = Crypt::createKeypair();
- // Disable encryption proxy to prevent recursive calls
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
// Save public key
-
- if (!$view->is_dir('/public-keys')) {
- $view->mkdir('/public-keys');
- }
-
- $this->view->file_put_contents('/public-keys/' . $publicShareKeyId . '.public.key', $keypair['publicKey']);
+ Keymanager::setPublicKey($keypair['publicKey'], $publicShareKeyId);
// Encrypt private key empty passphrase
- $cipher = \OCA\Encryption\Helper::getCipher();
- $encryptedKey = \OCA\Encryption\Crypt::symmetricEncryptFileContent($keypair['privateKey'], '', $cipher);
+ $cipher = Helper::getCipher();
+ $encryptedKey = Crypt::symmetricEncryptFileContent($keypair['privateKey'], '', $cipher);
if ($encryptedKey) {
- Keymanager::setPrivateSystemKey($encryptedKey, $publicShareKeyId . '.private.key');
+ Keymanager::setPrivateSystemKey($encryptedKey, $publicShareKeyId);
} else {
\OCP\Util::writeLog('files_encryption', 'Could not create public share keys', \OCP\Util::ERROR);
}
- \OC_FileProxy::$enabled = $proxyStatus;
-
}
- if (\OCA\Encryption\Helper::isPublicAccess()) {
+ if (Helper::isPublicAccess() && !self::getPublicSharePrivateKey()) {
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
- $encryptedKey = $this->view->file_get_contents(
- '/owncloud_private_key/' . $publicShareKeyId . '.private.key');
+ $encryptedKey = Keymanager::getPrivateSystemKey($publicShareKeyId);
$privateKey = Crypt::decryptPrivateKey($encryptedKey, '');
- $this->setPublicSharePrivateKey($privateKey);
-
- $this->setInitialized(\OCA\Encryption\Session::INIT_SUCCESSFUL);
+ self::setPublicSharePrivateKey($privateKey);
\OC_FileProxy::$enabled = $proxyStatus;
}
@@ -127,8 +114,8 @@ class Session {
* remove keys from session
*/
public function removeKeys() {
- \OC::$session->remove('publicSharePrivateKey');
- \OC::$session->remove('privateKey');
+ \OC::$server->getSession()->remove('publicSharePrivateKey');
+ \OC::$server->getSession()->remove('privateKey');
}
/**
@@ -164,6 +151,8 @@ class Session {
public function getInitialized() {
if (!is_null(\OC::$server->getSession()->get('encryptionInitialized'))) {
return \OC::$server->getSession()->get('encryptionInitialized');
+ } else if (Helper::isPublicAccess() && self::getPublicSharePrivateKey()) {
+ return self::INIT_SUCCESSFUL;
} else {
return self::NOT_INITIALIZED;
}
@@ -176,8 +165,8 @@ class Session {
*/
public function getPrivateKey() {
// return the public share private key if this is a public access
- if (\OCA\Encryption\Helper::isPublicAccess()) {
- return $this->getPublicSharePrivateKey();
+ if (Helper::isPublicAccess()) {
+ return self::getPublicSharePrivateKey();
} else {
if (!is_null(\OC::$server->getSession()->get('privateKey'))) {
return \OC::$server->getSession()->get('privateKey');
@@ -192,12 +181,9 @@ class Session {
* @param string $privateKey
* @return bool
*/
- public function setPublicSharePrivateKey($privateKey) {
-
- \OC::$server->getSession()->set('publicSharePrivateKey', $privateKey);
-
+ private static function setPublicSharePrivateKey($privateKey) {
+ self::$publicShareKey = $privateKey;
return true;
-
}
/**
@@ -205,13 +191,8 @@ class Session {
* @return string $privateKey
*
*/
- public function getPublicSharePrivateKey() {
-
- if (!is_null(\OC::$server->getSession()->get('publicSharePrivateKey'))) {
- return \OC::$server->getSession()->get('publicSharePrivateKey');
- } else {
- return false;
- }
+ private static function getPublicSharePrivateKey() {
+ return self::$publicShareKey;
}
}
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index f74812a7253..17da4eb1cdc 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -2,10 +2,11 @@
/**
* ownCloud
*
- * @author Bjoern Schiessle, Robin Appelman
- * @copyright 2014 Bjoern Schiessle <schiessle@owncloud.com>
- * 2012 Sam Tuke <samtuke@owncloud.com>,
- * 2011 Robin Appelman <icewind1991@gmail.com>
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
+ * @author Robin Appelman <icewind@owncloud.com>
+ * @author Sam Tuke <samtuke@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -29,7 +30,9 @@
* and then fopen('crypt://streams/foo');
*/
-namespace OCA\Encryption;
+namespace OCA\Files_Encryption;
+
+use OCA\Files_Encryption\Exception\EncryptionException;
/**
* Provides 'crypt://' stream wrapper protocol.
@@ -79,7 +82,7 @@ class Stream {
private $rootView; // a fsview object set to '/'
/**
- * @var \OCA\Encryption\Session
+ * @var \OCA\Files_Encryption\Session
*/
private $session;
private $privateKey;
@@ -90,6 +93,7 @@ class Stream {
* @param int $options
* @param string $opened_path
* @return bool
+ * @throw \OCA\Files_Encryption\Exception\EncryptionException
*/
public function stream_open($path, $mode, $options, &$opened_path) {
@@ -103,9 +107,13 @@ class Stream {
$this->rootView = new \OC\Files\View('/');
}
- $this->session = new \OCA\Encryption\Session($this->rootView);
+ $this->session = new Session($this->rootView);
$this->privateKey = $this->session->getPrivateKey();
+ if ($this->privateKey === false) {
+ throw new EncryptionException('Session does not contain a private key, maybe your login password changed?',
+ EncryptionException::PRIVATE_KEY_MISSING);
+ }
$normalizedPath = \OC\Files\Filesystem::normalizePath(str_replace('crypt://', '', $path));
if ($originalFile = Helper::getPathFromTmpFile($normalizedPath)) {
@@ -155,7 +163,7 @@ class Stream {
if($this->privateKey === false) {
// if private key is not valid redirect user to a error page
- \OCA\Encryption\Helper::redirectToErrorPage($this->session);
+ Helper::redirectToErrorPage($this->session);
}
$this->size = $this->rootView->filesize($this->rawPath);
@@ -244,7 +252,7 @@ class Stream {
/**
* @param int $count
* @return bool|string
- * @throws \OCA\Encryption\Exceptions\EncryptionException
+ * @throws \OCA\Files_Encryption\Exception\EncryptionException
*/
public function stream_read($count) {
@@ -252,7 +260,7 @@ class Stream {
if ($count !== Crypt::BLOCKSIZE) {
\OCP\Util::writeLog('Encryption library', 'PHP "bug" 21641 no longer holds, decryption system requires refactoring', \OCP\Util::FATAL);
- throw new \OCA\Encryption\Exceptions\EncryptionException('expected a blog size of 8192 byte', 20);
+ throw new EncryptionException('expected a blog size of 8192 byte', EncryptionException::UNEXPECTED_BLOG_SIZE);
}
// Get the data from the file handle
@@ -322,7 +330,7 @@ class Stream {
// Fetch and decrypt keyfile
// Fetch existing keyfile
- $util = new \OCA\Encryption\Util($this->rootView, $this->userId);
+ $util = new Util($this->rootView, $this->userId);
$this->encKeyfile = Keymanager::getFileKey($this->rootView, $util, $this->relPath);
// If a keyfile already exists
@@ -333,13 +341,13 @@ class Stream {
// if there is no valid private key return false
if ($this->privateKey === false) {
// if private key is not valid redirect user to a error page
- \OCA\Encryption\Helper::redirectToErrorPage($this->session);
+ Helper::redirectToErrorPage($this->session);
return false;
}
if ($shareKey === false) {
// if no share key is available redirect user to a error page
- \OCA\Encryption\Helper::redirectToErrorPage($this->session, \OCA\Encryption\Crypt::ENCRYPTION_NO_SHARE_KEY_FOUND);
+ Helper::redirectToErrorPage($this->session, Crypt::ENCRYPTION_NO_SHARE_KEY_FOUND);
return false;
}
@@ -360,14 +368,14 @@ class Stream {
/**
* write header at beginning of encrypted file
*
- * @throws Exceptions\EncryptionException
+ * @throws \OCA\Files_Encryption\Exception\EncryptionException
*/
private function writeHeader() {
$header = Crypt::generateHeader();
if (strlen($header) > Crypt::BLOCKSIZE) {
- throw new Exceptions\EncryptionException('max header size exceeded', 30);
+ throw new EncryptionException('max header size exceeded', EncryptionException::ENCRYPTION_HEADER_TO_LARGE);
}
$paddedHeader = str_pad($header, Crypt::BLOCKSIZE, self::PADDING_CHAR, STR_PAD_RIGHT);
@@ -573,6 +581,7 @@ class Stream {
\OC_FileProxy::$enabled = false;
if ($this->rootView->file_exists($this->rawPath) && $this->size === 0) {
+ fclose($this->handle);
$this->rootView->unlink($this->rawPath);
}
@@ -581,7 +590,7 @@ class Stream {
}
// if private key is not valid redirect user to a error page
- \OCA\Encryption\Helper::redirectToErrorPage($this->session);
+ Helper::redirectToErrorPage($this->session);
}
if (
@@ -632,13 +641,17 @@ class Stream {
$path = Helper::stripPartialFileExtension($this->rawPath);
$fileInfo = array(
+ 'mimetype' => $this->rootView->getMimeType($this->rawPath),
'encrypted' => true,
- 'size' => $this->size,
'unencrypted_size' => $this->unencryptedSize,
);
- // set fileinfo
- $this->rootView->putFileInfo($path, $fileInfo);
+ // if we write a part file we also store the unencrypted size for
+ // the part file so that it can be re-used later
+ $this->rootView->putFileInfo($this->rawPath, $fileInfo);
+ if ($path !== $this->rawPath) {
+ $this->rootView->putFileInfo($path, $fileInfo);
+ }
}
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index ce5e8c8b54c..4aaf7aa2571 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -2,10 +2,11 @@
/**
* ownCloud
*
- * @author Sam Tuke, Frank Karlitschek, Bjoern Schiessle
- * @copyright 2012 Sam Tuke <samtuke@owncloud.com>,
- * Frank Karlitschek <frank@owncloud.org>,
- * Bjoern Schiessle <schiessle@owncloud.com>
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Sam Tuke <samtuke@owncloud.com>,
+ * @author Frank Karlitschek <frank@owncloud.org>,
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -22,7 +23,7 @@
*
*/
-namespace OCA\Encryption;
+namespace OCA\Files_Encryption;
/**
* Class for utilities relating to encrypted file storage system
@@ -44,10 +45,10 @@ class Util {
private $client; // Client side encryption mode flag
private $publicKeyDir; // Dir containing all public user keys
private $encryptionDir; // Dir containing user's files_encryption
- private $keyfilesPath; // Dir containing user's keyfiles
- private $shareKeysPath; // Dir containing env keys for shared files
+ private $keysPath; // Dir containing all file related encryption keys
private $publicKeyPath; // Path to user's public key
private $privateKeyPath; // Path to user's private key
+ private $userFilesDir;
private $publicShareKeyId;
private $recoveryKeyId;
private $isPublic;
@@ -72,18 +73,17 @@ class Util {
$this->fileFolderName = 'files';
$this->userFilesDir =
'/' . $userId . '/' . $this->fileFolderName; // TODO: Does this need to be user configurable?
- $this->publicKeyDir = '/' . 'public-keys';
+ $this->publicKeyDir = Keymanager::getPublicKeyPath();
$this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
- $this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
- $this->shareKeysPath = $this->encryptionDir . '/' . 'share-keys';
+ $this->keysPath = $this->encryptionDir . '/' . 'keys';
$this->publicKeyPath =
- $this->publicKeyDir . '/' . $this->userId . '.public.key'; // e.g. data/public-keys/admin.public.key
+ $this->publicKeyDir . '/' . $this->userId . '.publicKey'; // e.g. data/public-keys/admin.publicKey
$this->privateKeyPath =
- $this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key
+ $this->encryptionDir . '/' . $this->userId . '.privateKey'; // e.g. data/admin/admin.privateKey
// make sure that the owners home is mounted
\OC\Files\Filesystem::initMountPoints($userId);
- if (\OCA\Encryption\Helper::isPublicAccess()) {
+ if (Helper::isPublicAccess()) {
$this->keyId = $this->publicShareKeyId;
$this->isPublic = true;
} else {
@@ -99,8 +99,7 @@ class Util {
if (
!$this->view->file_exists($this->encryptionDir)
- or !$this->view->file_exists($this->keyfilesPath)
- or !$this->view->file_exists($this->shareKeysPath)
+ or !$this->view->file_exists($this->keysPath)
or !$this->view->file_exists($this->publicKeyPath)
or !$this->view->file_exists($this->privateKeyPath)
) {
@@ -125,6 +124,18 @@ class Util {
}
/**
+ * create a new public/private key pair for the user
+ *
+ * @param string $password password for the private key
+ */
+ public function replaceUserKeys($password) {
+ $this->backupAllKeys('password_reset');
+ $this->view->unlink($this->publicKeyPath);
+ $this->view->unlink($this->privateKeyPath);
+ $this->setupServerSide($password);
+ }
+
+ /**
* Sets up user folders and keys for serverside encryption
*
* @param string $passphrase to encrypt server-stored private key with
@@ -137,8 +148,7 @@ class Util {
$this->userDir,
$this->publicKeyDir,
$this->encryptionDir,
- $this->keyfilesPath,
- $this->shareKeysPath
+ $this->keysPath
);
// Check / create all necessary dirs
@@ -215,7 +225,7 @@ class Util {
*/
public function recoveryEnabledForUser() {
- $recoveryMode = \OC_Preferences::getValue($this->userId, 'files_encryption', 'recovery_enabled', '0');
+ $recoveryMode = \OC::$server->getConfig()->getUserValue($this->userId, 'files_encryption', 'recovery_enabled', '0');
return ($recoveryMode === '1') ? true : false;
@@ -229,7 +239,12 @@ class Util {
public function setRecoveryForUser($enabled) {
$value = $enabled ? '1' : '0';
- return \OC_Preferences::setValue($this->userId, 'files_encryption', 'recovery_enabled', $value);
+ try {
+ \OC::$server->getConfig()->setUserValue($this->userId, 'files_encryption', 'recovery_enabled', $value);
+ return true;
+ } catch(\OCP\PreConditionNotMetException $e) {
+ return false;
+ }
}
@@ -262,7 +277,7 @@ class Util {
if ($file !== "." && $file !== "..") {
$filePath = $directory . '/' . $this->view->getRelativePath('/' . $file);
- $relPath = \OCA\Encryption\Helper::stripUserFilesPath($filePath);
+ $relPath = Helper::stripUserFilesPath($filePath);
// If the path is a directory, search
// its contents
@@ -436,13 +451,13 @@ class Util {
}
}
fclose($stream);
- $relPath = \OCA\Encryption\Helper::stripUserFilesPath($path);
+ $relPath = Helper::stripUserFilesPath($path);
$shareKey = Keymanager::getShareKey($this->view, $this->keyId, $this, $relPath);
if($shareKey===false) {
\OC_FileProxy::$enabled = $proxyStatus;
return $result;
}
- $session = new \OCA\Encryption\Session($this->view);
+ $session = new Session($this->view);
$privateKey = $session->getPrivateKey();
$plainKeyfile = $this->decryptKeyfile($relPath, $privateKey);
$plainKey = Crypt::multiKeyDecrypt($plainKeyfile, $shareKey, $privateKey);
@@ -715,8 +730,8 @@ class Util {
}
if ($successful) {
- $this->view->rename($this->keyfilesPath, $this->keyfilesPath . '.backup');
- $this->view->rename($this->shareKeysPath, $this->shareKeysPath . '.backup');
+ $this->backupAllKeys('decryptAll');
+ $this->view->deleteAll($this->keysPath);
}
\OC_FileProxy::$enabled = true;
@@ -833,9 +848,9 @@ class Util {
break;
- case 'keyfilesPath':
+ case 'keysPath':
- return $this->keyfilesPath;
+ return $this->keysPath;
break;
@@ -857,6 +872,25 @@ class Util {
}
/**
+ * Returns whether the given user is ready for encryption.
+ * Also returns true if the given user is the public user
+ * or the recovery key user.
+ *
+ * @param string $user user to check
+ *
+ * @return boolean true if the user is ready, false otherwise
+ */
+ private function isUserReady($user) {
+ if ($user === $this->publicShareKeyId
+ || $user === $this->recoveryKeyId
+ ) {
+ return true;
+ }
+ $util = new Util($this->view, $user);
+ return $util->ready();
+ }
+
+ /**
* Filter an array of UIDs to return only ones ready for sharing
* @param array $unfilteredUsers users to be checked for sharing readiness
* @return array as multi-dimensional array. keys: ready, unready
@@ -868,16 +902,9 @@ class Util {
// Loop through users and create array of UIDs that need new keyfiles
foreach ($unfilteredUsers as $user) {
-
- $util = new Util($this->view, $user);
-
// Check that the user is encryption capable, or is the
- // public system user 'ownCloud' (for public shares)
- if (
- $user === $this->publicShareKeyId
- or $user === $this->recoveryKeyId
- or $util->ready()
- ) {
+ // public system user (for public shares)
+ if ($this->isUserReady($user)) {
// Construct array of ready UIDs for Keymanager{}
$readyIds[] = $user;
@@ -960,7 +987,7 @@ class Util {
$plainKeyfile = $this->decryptKeyfile($filePath, $privateKey);
// Re-enc keyfile to (additional) sharekeys
$multiEncKey = Crypt::multiKeyEncrypt($plainKeyfile, $userPubKeys);
- } catch (Exceptions\EncryptionException $e) {
+ } catch (Exception\EncryptionException $e) {
$msg = 'set shareFileKeyFailed (code: ' . $e->getCode() . '): ' . $e->getMessage();
\OCP\Util::writeLog('files_encryption', $msg, \OCP\Util::FATAL);
return false;
@@ -1013,7 +1040,7 @@ class Util {
// Make sure that a share key is generated for the owner too
list($owner, $ownerPath) = $this->getUidAndFilename($filePath);
- $ownerPath = \OCA\Encryption\Helper::stripPartialFileExtension($ownerPath);
+ $ownerPath = Helper::stripPartialFileExtension($ownerPath);
// always add owner to the list of users with access to the file
$userIds = array($owner);
@@ -1080,7 +1107,12 @@ class Util {
// convert to string if preCondition is set
$preCondition = ($preCondition === null) ? null : (string)$preCondition;
- return \OC_Preferences::setValue($this->userId, 'files_encryption', 'migration_status', (string)$status, $preCondition);
+ try {
+ \OC::$server->getConfig()->setUserValue($this->userId, 'files_encryption', 'migration_status', (string)$status, $preCondition);
+ return true;
+ } catch(\OCP\PreConditionNotMetException $e) {
+ return false;
+ }
}
@@ -1132,9 +1164,9 @@ class Util {
$migrationStatus = false;
if (\OCP\User::userExists($this->userId)) {
- $migrationStatus = \OC_Preferences::getValue($this->userId, 'files_encryption', 'migration_status');
+ $migrationStatus = \OC::$server->getConfig()->getUserValue($this->userId, 'files_encryption', 'migration_status', null);
if ($migrationStatus === null) {
- \OC_Preferences::setValue($this->userId, 'files_encryption', 'migration_status', (string)self::MIGRATION_OPEN);
+ \OC::$server->getConfig()->setUserValue($this->userId, 'files_encryption', 'migration_status', (string)self::MIGRATION_OPEN);
$migrationStatus = self::MIGRATION_OPEN;
}
}
@@ -1175,13 +1207,7 @@ class Util {
// handle public access
if ($this->isPublic) {
- $filename = $path;
- $fileOwnerUid = $this->userId;
-
- return array(
- $fileOwnerUid,
- $filename
- );
+ return array($this->userId, $path);
} else {
// Check that UID is valid
@@ -1341,22 +1367,14 @@ class Util {
public function checkRecoveryPassword($password) {
$result = false;
- $pathKey = '/owncloud_private_key/' . $this->recoveryKeyId . ".private.key";
-
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
- $recoveryKey = $this->view->file_get_contents($pathKey);
+ $recoveryKey = Keymanager::getPrivateSystemKey($this->recoveryKeyId);
$decryptedRecoveryKey = Crypt::decryptPrivateKey($recoveryKey, $password);
if ($decryptedRecoveryKey) {
$result = true;
}
- \OC_FileProxy::$enabled = $proxyStatus;
-
-
return $result;
}
@@ -1371,19 +1389,17 @@ class Util {
* add recovery key to all encrypted files
*/
public function addRecoveryKeys($path = '/') {
- $dirContent = $this->view->getDirectoryContent($this->keyfilesPath . $path);
+ $dirContent = $this->view->getDirectoryContent($this->keysPath . '/' . $path);
foreach ($dirContent as $item) {
// get relative path from files_encryption/keyfiles/
- $filePath = substr($item['path'], strlen('files_encryption/keyfiles'));
- if ($item['type'] === 'dir') {
+ $filePath = substr($item['path'], strlen('files_encryption/keys'));
+ if ($this->view->is_dir($this->userFilesDir . '/' . $filePath)) {
$this->addRecoveryKeys($filePath . '/');
} else {
- $session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
+ $session = new Session(new \OC\Files\View('/'));
$sharingEnabled = \OCP\Share::isEnabled();
- // remove '.key' extension from path e.g. 'file.txt.key' to 'file.txt'
- $file = substr($filePath, 0, -4);
- $usersSharing = $this->getSharingUsersArray($sharingEnabled, $file);
- $this->setSharedFileKeyfiles($session, $usersSharing, $file);
+ $usersSharing = $this->getSharingUsersArray($sharingEnabled, $filePath);
+ $this->setSharedFileKeyfiles($session, $usersSharing, $filePath);
}
}
}
@@ -1392,16 +1408,14 @@ class Util {
* remove recovery key to all encrypted files
*/
public function removeRecoveryKeys($path = '/') {
- $dirContent = $this->view->getDirectoryContent($this->keyfilesPath . $path);
+ $dirContent = $this->view->getDirectoryContent($this->keysPath . '/' . $path);
foreach ($dirContent as $item) {
// get relative path from files_encryption/keyfiles
- $filePath = substr($item['path'], strlen('files_encryption/keyfiles'));
- if ($item['type'] === 'dir') {
+ $filePath = substr($item['path'], strlen('files_encryption/keys'));
+ if ($this->view->is_dir($this->userFilesDir . '/' . $filePath)) {
$this->removeRecoveryKeys($filePath . '/');
} else {
- // remove '.key' extension from path e.g. 'file.txt.key' to 'file.txt'
- $file = substr($filePath, 0, -4);
- $this->view->unlink($this->shareKeysPath . '/' . $file . '.' . $this->recoveryKeyId . '.shareKey');
+ $this->view->unlink($this->keysPath . '/' . $filePath . '/' . $this->recoveryKeyId . '.shareKey');
}
}
}
@@ -1431,27 +1445,17 @@ class Util {
}
$filteredUids = $this->filterShareReadyUsers($userIds);
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
//decrypt file key
- $encKeyfile = $this->view->file_get_contents($this->keyfilesPath . $file . ".key");
- $shareKey = $this->view->file_get_contents(
- $this->shareKeysPath . $file . "." . $this->recoveryKeyId . ".shareKey");
+ $encKeyfile = Keymanager::getFileKey($this->view, $this, $file);
+ $shareKey = Keymanager::getShareKey($this->view, $this->recoveryKeyId, $this, $file);
$plainKeyfile = Crypt::multiKeyDecrypt($encKeyfile, $shareKey, $privateKey);
// encrypt file key again to all users, this time with the new public key for the recovered use
$userPubKeys = Keymanager::getPublicKeys($this->view, $filteredUids['ready']);
$multiEncKey = Crypt::multiKeyEncrypt($plainKeyfile, $userPubKeys);
- // write new keys to filesystem TDOO!
- $this->view->file_put_contents($this->keyfilesPath . $file . '.key', $multiEncKey['data']);
- foreach ($multiEncKey['keys'] as $userId => $shareKey) {
- $shareKeyPath = $this->shareKeysPath . $file . '.' . $userId . '.shareKey';
- $this->view->file_put_contents($shareKeyPath, $shareKey);
- }
+ Keymanager::setFileKey($this->view, $this, $file, $multiEncKey['data']);
+ Keymanager::setShareKeys($this->view, $this, $file, $multiEncKey['keys']);
- // Return proxy to original status
- \OC_FileProxy::$enabled = $proxyStatus;
}
/**
@@ -1460,16 +1464,14 @@ class Util {
* @param string $privateKey private recovery key which is used to decrypt the files
*/
private function recoverAllFiles($path, $privateKey) {
- $dirContent = $this->view->getDirectoryContent($this->keyfilesPath . $path);
+ $dirContent = $this->view->getDirectoryContent($this->keysPath . '/' . $path);
foreach ($dirContent as $item) {
// get relative path from files_encryption/keyfiles
- $filePath = substr($item['path'], strlen('files_encryption/keyfiles'));
- if ($item['type'] === 'dir') {
+ $filePath = substr($item['path'], strlen('files_encryption/keys'));
+ if ($this->view->is_dir($this->userFilesDir . '/' . $filePath)) {
$this->recoverAllFiles($filePath . '/', $privateKey);
} else {
- // remove '.key' extension from path e.g. 'file.txt.key' to 'file.txt'
- $file = substr($filePath, 0, -4);
- $this->recoverFile($file, $privateKey);
+ $this->recoverFile($filePath, $privateKey);
}
}
}
@@ -1480,16 +1482,9 @@ class Util {
*/
public function recoverUsersFiles($recoveryPassword) {
- // Disable encryption proxy to prevent recursive calls
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
-
- $encryptedKey = $this->view->file_get_contents(
- '/owncloud_private_key/' . $this->recoveryKeyId . '.private.key');
+ $encryptedKey = Keymanager::getPrivateSystemKey( $this->recoveryKeyId);
$privateKey = Crypt::decryptPrivateKey($encryptedKey, $recoveryPassword);
- \OC_FileProxy::$enabled = $proxyStatus;
-
$this->recoverAllFiles('/', $privateKey);
}
@@ -1503,10 +1498,9 @@ class Util {
$backupDir = $this->encryptionDir . '/backup.';
$backupDir .= ($purpose === '') ? date("Y-m-d_H-i-s") . '/' : $purpose . '.' . date("Y-m-d_H-i-s") . '/';
$this->view->mkdir($backupDir);
- $this->view->copy($this->shareKeysPath, $backupDir . 'share-keys/');
- $this->view->copy($this->keyfilesPath, $backupDir . 'keyfiles/');
- $this->view->copy($this->privateKeyPath, $backupDir . $this->userId . '.private.key');
- $this->view->copy($this->publicKeyPath, $backupDir . $this->userId . '.public.key');
+ $this->view->copy($this->keysPath, $backupDir . 'keys/');
+ $this->view->copy($this->privateKeyPath, $backupDir . $this->userId . '.privateKey');
+ $this->view->copy($this->publicKeyPath, $backupDir . $this->userId . '.publicKey');
}
/**
@@ -1559,14 +1553,17 @@ class Util {
*/
public function initEncryption($params) {
- $session = new \OCA\Encryption\Session($this->view);
+ $session = new Session($this->view);
// we tried to initialize the encryption app for this session
- $session->setInitialized(\OCA\Encryption\Session::INIT_EXECUTED);
+ $session->setInitialized(Session::INIT_EXECUTED);
$encryptedKey = Keymanager::getPrivateKey($this->view, $params['uid']);
- $privateKey = Crypt::decryptPrivateKey($encryptedKey, $params['password']);
+ $privateKey = false;
+ if ($encryptedKey) {
+ $privateKey = Crypt::decryptPrivateKey($encryptedKey, $params['password']);
+ }
if ($privateKey === false) {
\OCP\Util::writeLog('Encryption library', 'Private key for user "' . $params['uid']
@@ -1575,7 +1572,7 @@ class Util {
}
$session->setPrivateKey($privateKey);
- $session->setInitialized(\OCA\Encryption\Session::INIT_SUCCESSFUL);
+ $session->setInitialized(Session::INIT_SUCCESSFUL);
return $session;
}
@@ -1584,7 +1581,7 @@ class Util {
* remove encryption related keys from the session
*/
public function closeEncryptionSession() {
- $session = new \OCA\Encryption\Session($this->view);
+ $session = new Session($this->view);
$session->closeSession();
}
diff --git a/apps/files_encryption/settings-admin.php b/apps/files_encryption/settings-admin.php
index 496a7cffb50..0f5d56a3734 100644
--- a/apps/files_encryption/settings-admin.php
+++ b/apps/files_encryption/settings-admin.php
@@ -12,7 +12,7 @@ $tmpl = new OCP\Template('files_encryption', 'settings-admin');
// Check if an adminRecovery account is enabled for recovering files after lost pwd
$recoveryAdminEnabled = \OC::$server->getAppConfig()->getValue('files_encryption', 'recoveryAdminEnabled', '0');
-$session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
+$session = new \OCA\Files_Encryption\Session(new \OC\Files\View('/'));
$initStatus = $session->getInitialized();
$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);
diff --git a/apps/files_encryption/settings-personal.php b/apps/files_encryption/settings-personal.php
index e9875518f67..834bac611ad 100644
--- a/apps/files_encryption/settings-personal.php
+++ b/apps/files_encryption/settings-personal.php
@@ -13,8 +13,8 @@ $tmpl = new OCP\Template('files_encryption', 'settings-personal');
$user = \OCP\USER::getUser();
$view = new \OC\Files\View('/');
-$util = new \OCA\Encryption\Util($view, $user);
-$session = new \OCA\Encryption\Session($view);
+$util = new \OCA\Files_Encryption\Util($view, $user);
+$session = new \OCA\Files_Encryption\Session($view);
$privateKeySet = $session->getPrivateKey() !== false;
// did we tried to initialize the keys for this session?
@@ -28,7 +28,6 @@ $result = false;
if ($recoveryAdminEnabled || !$privateKeySet) {
\OCP\Util::addscript('files_encryption', 'settings-personal');
- \OCP\Util::addScript('settings', 'personal');
$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);
$tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser);
diff --git a/apps/files_encryption/templates/invalid_private_key.php b/apps/files_encryption/templates/invalid_private_key.php
index b275b9c428c..b148e65b199 100644
--- a/apps/files_encryption/templates/invalid_private_key.php
+++ b/apps/files_encryption/templates/invalid_private_key.php
@@ -4,7 +4,7 @@
<?php p($_['message']); ?>
<br/>
- <?php if($_['errorCode'] === \OCA\Encryption\Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR): ?>
+ <?php if($_['errorCode'] === \OCA\Files_Encryption\Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR): ?>
<?php p($l->t('Go directly to your %spersonal settings%s.', array('<a href="'.$location.'">', '</a>'))); ?>
<?php endif; ?>
<br/>
diff --git a/apps/files_encryption/templates/settings-admin.php b/apps/files_encryption/templates/settings-admin.php
index d003f245bb3..4c1d724b6dd 100644
--- a/apps/files_encryption/templates/settings-admin.php
+++ b/apps/files_encryption/templates/settings-admin.php
@@ -1,7 +1,7 @@
<form id="encryption" class="section">
<h2><?php p($l->t('Encryption')); ?></h2>
- <?php if($_["initStatus"] === \OCA\Encryption\Session::NOT_INITIALIZED): ?>
+ <?php if($_["initStatus"] === \OCA\Files_Encryption\Session::NOT_INITIALIZED): ?>
<?php p($l->t("Encryption App is enabled but your keys are not initialized, please log-out and log-in again")); ?>
<?php else: ?>
<p id="encryptionSetRecoveryKey">
diff --git a/apps/files_encryption/templates/settings-personal.php b/apps/files_encryption/templates/settings-personal.php
index ce8cf6aec28..17123a154d9 100644
--- a/apps/files_encryption/templates/settings-personal.php
+++ b/apps/files_encryption/templates/settings-personal.php
@@ -1,11 +1,11 @@
<form id="encryption" class="section">
<h2><?php p( $l->t( 'Encryption' ) ); ?></h2>
- <?php if ( $_["initialized"] === \OCA\Encryption\Session::NOT_INITIALIZED ): ?>
+ <?php if ( $_["initialized"] === \OCA\Files_Encryption\Session::NOT_INITIALIZED ): ?>
<?php p($l->t("Encryption App is enabled but your keys are not initialized, please log-out and log-in again")); ?>
- <?php elseif ( $_["initialized"] === \OCA\Encryption\Session::INIT_EXECUTED ): ?>
+ <?php elseif ( $_["initialized"] === \OCA\Files_Encryption\Session::INIT_EXECUTED ): ?>
<p>
<a name="changePKPasswd" />
<label for="changePrivateKeyPasswd">
@@ -37,7 +37,7 @@
<span class="msg"></span>
</p>
- <?php elseif ( $_["recoveryEnabled"] && $_["privateKeySet"] && $_["initialized"] === \OCA\Encryption\Session::INIT_SUCCESSFUL ): ?>
+ <?php elseif ( $_["recoveryEnabled"] && $_["privateKeySet"] && $_["initialized"] === \OCA\Files_Encryption\Session::INIT_SUCCESSFUL ): ?>
<br />
<p id="userEnableRecovery">
<label for="userEnableRecovery"><?php p( $l->t( "Enable password recovery:" ) ); ?></label>
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php
index 1b8291fea28..3165279c558 100755
--- a/apps/files_encryption/tests/crypt.php
+++ b/apps/files_encryption/tests/crypt.php
@@ -7,12 +7,12 @@
* See the COPYING-README file.
*/
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Crypt
+ * Class Crypt
*/
-class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
+class Crypt extends TestCase {
const TEST_ENCRYPTION_CRYPT_USER1 = "test-crypt-user1";
@@ -23,37 +23,30 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
public $dataUrl;
public $dataShort;
/**
- * @var OC\Files\View
+ * @var \OC\Files\View
*/
public $view;
public $legacyEncryptedData;
public $genPrivateKey;
public $genPublicKey;
- public static function setUpBeforeClass() {
- // reset backend
- \OC_User::clearBackends();
- \OC_User::useBackend('database');
-
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerFilesystemHooks();
-
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerUserHooks();
+ /** @var \OCP\IConfig */
+ private $config;
- // clear and register hooks
- \OC_FileProxy::clearProxies();
- \OC_FileProxy::register(new OCA\Encryption\Proxy());
+ public static function setUpBeforeClass() {
+ parent::setUpBeforeClass();
// create test user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_CRYPT_USER1, true);
}
- function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
// set user id
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1);
- $this->userId = \Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1;
- $this->pass = \Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1;
+ self::loginHelper(self::TEST_ENCRYPTION_CRYPT_USER1);
+ $this->userId = self::TEST_ENCRYPTION_CRYPT_USER1;
+ $this->pass = self::TEST_ENCRYPTION_CRYPT_USER1;
// set content for encrypting / decrypting in tests
$this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
@@ -62,72 +55,70 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->legacyData = __DIR__ . '/legacy-text.txt';
$this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';
$this->legacyEncryptedDataKey = __DIR__ . '/encryption.key';
- $this->randomKey = Encryption\Crypt::generateKey();
+ $this->randomKey = \OCA\Files_Encryption\Crypt::generateKey();
- $keypair = Encryption\Crypt::createKeypair();
+ $keypair = \OCA\Files_Encryption\Crypt::createKeypair();
$this->genPublicKey = $keypair['publicKey'];
$this->genPrivateKey = $keypair['privateKey'];
$this->view = new \OC\Files\View('/');
// remember files_trashbin state
- $this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+ $this->stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we don't want to tests with app files_trashbin enabled
\OC_App::disable('files_trashbin');
+
+ $this->config = \OC::$server->getConfig();
}
- function tearDown() {
+ protected function tearDown() {
// reset app files_trashbin
if ($this->stateFilesTrashbin) {
- OC_App::enable('files_trashbin');
+ \OC_App::enable('files_trashbin');
} else {
- OC_App::disable('files_trashbin');
+ \OC_App::disable('files_trashbin');
}
$this->assertTrue(\OC_FileProxy::$enabled);
- \OCP\Config::deleteSystemValue('cipher');
+ $this->config->deleteSystemValue('cipher');
+
+ parent::tearDown();
}
public static function tearDownAfterClass() {
// cleanup test user
- \OC_User::deleteUser(\Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1);
-
- \OC_Hook::clear();
- \OC_FileProxy::clearProxies();
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_CRYPT_USER1);
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
+ parent::tearDownAfterClass();
}
/**
* @medium
*/
- function testGenerateKey() {
+ public function testGenerateKey() {
# TODO: use more accurate (larger) string length for test confirmation
- $key = Encryption\Crypt::generateKey();
+ $key = \OCA\Files_Encryption\Crypt::generateKey();
$this->assertTrue(strlen($key) > 16);
}
- function testDecryptPrivateKey() {
+ public function testDecryptPrivateKey() {
// test successful decrypt
- $crypted = Encryption\Crypt::symmetricEncryptFileContent($this->genPrivateKey, 'hat');
+ $crypted = \OCA\Files_Encryption\Crypt::symmetricEncryptFileContent($this->genPrivateKey, 'hat');
- $header = Encryption\Crypt::generateHeader();
+ $header = \OCA\Files_Encryption\Crypt::generateHeader();
- $decrypted = Encryption\Crypt::decryptPrivateKey($header . $crypted, 'hat');
+ $decrypted = \OCA\Files_Encryption\Crypt::decryptPrivateKey($header . $crypted, 'hat');
$this->assertEquals($this->genPrivateKey, $decrypted);
//test private key decrypt with wrong password
- $wrongPasswd = Encryption\Crypt::decryptPrivateKey($crypted, 'hat2');
+ $wrongPasswd = \OCA\Files_Encryption\Crypt::decryptPrivateKey($crypted, 'hat2');
$this->assertEquals(false, $wrongPasswd);
@@ -137,16 +128,16 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testSymmetricEncryptFileContent() {
+ public function testSymmetricEncryptFileContent() {
# TODO: search in keyfile for actual content as IV will ensure this test always passes
- $crypted = Encryption\Crypt::symmetricEncryptFileContent($this->dataShort, 'hat');
+ $crypted = \OCA\Files_Encryption\Crypt::symmetricEncryptFileContent($this->dataShort, 'hat');
$this->assertNotEquals($this->dataShort, $crypted);
- $decrypt = Encryption\Crypt::symmetricDecryptFileContent($crypted, 'hat');
+ $decrypt = \OCA\Files_Encryption\Crypt::symmetricDecryptFileContent($crypted, 'hat');
$this->assertEquals($this->dataShort, $decrypt);
@@ -155,16 +146,16 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testSymmetricEncryptFileContentAes128() {
+ public function testSymmetricEncryptFileContentAes128() {
# TODO: search in keyfile for actual content as IV will ensure this test always passes
- $crypted = Encryption\Crypt::symmetricEncryptFileContent($this->dataShort, 'hat', 'AES-128-CFB');
+ $crypted = \OCA\Files_Encryption\Crypt::symmetricEncryptFileContent($this->dataShort, 'hat', 'AES-128-CFB');
$this->assertNotEquals($this->dataShort, $crypted);
- $decrypt = Encryption\Crypt::symmetricDecryptFileContent($crypted, 'hat', 'AES-128-CFB');
+ $decrypt = \OCA\Files_Encryption\Crypt::symmetricDecryptFileContent($crypted, 'hat', 'AES-128-CFB');
$this->assertEquals($this->dataShort, $decrypt);
@@ -173,9 +164,9 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testSymmetricStreamEncryptShortFileContent() {
+ public function testSymmetricStreamEncryptShortFileContent() {
- $filename = 'tmp-' . uniqid() . '.test';
+ $filename = 'tmp-' . $this->getUniqueID() . '.test';
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/'. $filename, $this->dataShort);
@@ -203,25 +194,23 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
// Teardown
$this->view->unlink($this->userId . '/files/' . $filename);
-
- Encryption\Keymanager::deleteFileKey($this->view, $filename);
}
/**
* @medium
*/
- function testSymmetricStreamEncryptShortFileContentAes128() {
+ public function testSymmetricStreamEncryptShortFileContentAes128() {
- $filename = 'tmp-' . uniqid() . '.test';
+ $filename = 'tmp-' . $this->getUniqueID() . '.test';
- \OCP\Config::setSystemValue('cipher', 'AES-128-CFB');
+ $this->config->setSystemValue('cipher', 'AES-128-CFB');
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/'. $filename, $this->dataShort);
// Test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
- \OCP\Config::deleteSystemValue('cipher');
+ $this->config->deleteSystemValue('cipher');
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
@@ -244,8 +233,6 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
// Teardown
$this->view->unlink($this->userId . '/files/' . $filename);
-
- Encryption\Keymanager::deleteFileKey($this->view, $filename);
}
/**
@@ -255,10 +242,10 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
* @note If this test fails with truncate content, check that enough array slices are being rejoined to form $e, as the crypt.php file may have gotten longer and broken the manual
* reassembly of its data
*/
- function testSymmetricStreamEncryptLongFileContent() {
+ public function testSymmetricStreamEncryptLongFileContent() {
// Generate a a random filename
- $filename = 'tmp-' . uniqid() . '.test';
+ $filename = 'tmp-' . $this->getUniqueID() . '.test';
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong);
@@ -285,11 +272,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataLong . $this->dataLong, $decrypted);
// Teardown
-
$this->view->unlink($this->userId . '/files/' . $filename);
-
- Encryption\Keymanager::deleteFileKey($this->view, $filename);
-
}
/**
@@ -299,12 +282,12 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
* @note If this test fails with truncate content, check that enough array slices are being rejoined to form $e, as the crypt.php file may have gotten longer and broken the manual
* reassembly of its data
*/
- function testSymmetricStreamEncryptLongFileContentAes128() {
+ public function testSymmetricStreamEncryptLongFileContentAes128() {
// Generate a a random filename
- $filename = 'tmp-' . uniqid() . '.test';
+ $filename = 'tmp-' . $this->getUniqueID() . '.test';
- \OCP\Config::setSystemValue('cipher', 'AES-128-CFB');
+ $this->config->setSystemValue('cipher', 'AES-128-CFB');
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong);
@@ -316,7 +299,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
- \OCP\Config::deleteSystemValue('cipher');
+ $this->config->deleteSystemValue('cipher');
// Get file contents without using any wrapper to get it's actual contents on disk
$retreivedCryptedFile = $this->view->file_get_contents($this->userId . '/files/' . $filename);
@@ -333,11 +316,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataLong . $this->dataLong, $decrypted);
// Teardown
-
$this->view->unlink($this->userId . '/files/' . $filename);
-
- Encryption\Keymanager::deleteFileKey($this->view, $filename);
-
}
/**
@@ -347,17 +326,17 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
* @note If this test fails with truncate content, check that enough array slices are being rejoined to form $e, as the crypt.php file may have gotten longer and broken the manual
* reassembly of its data
*/
- function testStreamDecryptLongFileContentWithoutHeader() {
+ public function testStreamDecryptLongFileContentWithoutHeader() {
// Generate a a random filename
- $filename = 'tmp-' . uniqid() . '.test';
+ $filename = 'tmp-' . $this->getUniqueID() . '.test';
- \OCP\Config::setSystemValue('cipher', 'AES-128-CFB');
+ $this->config->setSystemValue('cipher', 'AES-128-CFB');
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong);
- \OCP\Config::deleteSystemValue('cipher');
+ $this->config->deleteSystemValue('cipher');
// Test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
@@ -374,7 +353,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
// remove the header to check if we can also decrypt old files without a header,
// this files should fall back to AES-128
- $cryptedWithoutHeader = substr($retreivedCryptedFile, Encryption\Crypt::BLOCKSIZE);
+ $cryptedWithoutHeader = substr($retreivedCryptedFile, \OCA\Files_Encryption\Crypt::BLOCKSIZE);
$this->view->file_put_contents($this->userId . '/files/' . $filename, $cryptedWithoutHeader);
// Re-enable proxy - our work is done
@@ -385,36 +364,32 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataLong . $this->dataLong, $decrypted);
// Teardown
-
$this->view->unlink($this->userId . '/files/' . $filename);
-
- Encryption\Keymanager::deleteFileKey($this->view, $filename);
-
}
/**
* @medium
*/
- function testIsEncryptedContent() {
+ public function testIsEncryptedContent() {
- $this->assertFalse(Encryption\Crypt::isCatfileContent($this->dataUrl));
+ $this->assertFalse(\OCA\Files_Encryption\Crypt::isCatfileContent($this->dataUrl));
- $this->assertFalse(Encryption\Crypt::isCatfileContent($this->legacyEncryptedData));
+ $this->assertFalse(\OCA\Files_Encryption\Crypt::isCatfileContent($this->legacyEncryptedData));
- $keyfileContent = Encryption\Crypt::symmetricEncryptFileContent($this->dataUrl, 'hat', 'AES-128-CFB');
+ $keyfileContent = \OCA\Files_Encryption\Crypt::symmetricEncryptFileContent($this->dataUrl, 'hat', 'AES-128-CFB');
- $this->assertTrue(Encryption\Crypt::isCatfileContent($keyfileContent));
+ $this->assertTrue(\OCA\Files_Encryption\Crypt::isCatfileContent($keyfileContent));
}
/**
* @large
*/
- function testMultiKeyEncrypt() {
+ public function testMultiKeyEncrypt() {
# TODO: search in keyfile for actual content as IV will ensure this test always passes
- $pair1 = Encryption\Crypt::createKeypair();
+ $pair1 = \OCA\Files_Encryption\Crypt::createKeypair();
$this->assertEquals(2, count($pair1));
@@ -423,12 +398,12 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertTrue(strlen($pair1['privateKey']) > 1);
- $crypted = Encryption\Crypt::multiKeyEncrypt($this->dataShort, array($pair1['publicKey']));
+ $crypted = \OCA\Files_Encryption\Crypt::multiKeyEncrypt($this->dataShort, array($pair1['publicKey']));
$this->assertNotEquals($this->dataShort, $crypted['data']);
- $decrypt = Encryption\Crypt::multiKeyDecrypt($crypted['data'], $crypted['keys'][0], $pair1['privateKey']);
+ $decrypt = \OCA\Files_Encryption\Crypt::multiKeyDecrypt($crypted['data'], $crypted['keys'][0], $pair1['privateKey']);
$this->assertEquals($this->dataShort, $decrypt);
@@ -437,9 +412,9 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testRenameFile() {
+ public function testRenameFile() {
- $filename = 'tmp-' . uniqid();
+ $filename = 'tmp-' . $this->getUniqueID();
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong);
@@ -452,7 +427,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataLong, $decrypt);
- $newFilename = 'tmp-new-' . uniqid();
+ $newFilename = 'tmp-new-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
$view->rename($filename, $newFilename);
@@ -468,9 +443,9 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testMoveFileIntoFolder() {
+ public function testMoveFileIntoFolder() {
- $filename = 'tmp-' . uniqid();
+ $filename = 'tmp-' . $this->getUniqueID();
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong);
@@ -483,8 +458,8 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataLong, $decrypt);
- $newFolder = '/newfolder' . uniqid();
- $newFilename = 'tmp-new-' . uniqid();
+ $newFolder = '/newfolder' . $this->getUniqueID();
+ $newFilename = 'tmp-new-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
$view->mkdir($newFolder);
$view->rename($filename, $newFolder . '/' . $newFilename);
@@ -501,12 +476,12 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testMoveFolder() {
+ public function testMoveFolder() {
$view = new \OC\Files\View('/' . $this->userId . '/files');
- $filename = '/tmp-' . uniqid();
- $folder = '/folder' . uniqid();
+ $filename = '/tmp-' . $this->getUniqueID();
+ $folder = '/folder' . $this->getUniqueID();
$view->mkdir($folder);
@@ -521,7 +496,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataLong, $decrypt);
- $newFolder = '/newfolder/subfolder' . uniqid();
+ $newFolder = '/newfolder/subfolder' . $this->getUniqueID();
$view->mkdir('/newfolder');
$view->rename($folder, $newFolder);
@@ -539,8 +514,8 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testChangePassphrase() {
- $filename = 'tmp-' . uniqid();
+ public function testChangePassphrase() {
+ $filename = 'tmp-' . $this->getUniqueID();
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong);
@@ -559,7 +534,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
// relogin
$params['uid'] = $this->userId;
$params['password'] = 'test';
- OCA\Encryption\Hooks::login($params);
+ \OCA\Files_Encryption\Hooks::login($params);
// Get file decrypted contents
$newDecrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $filename);
@@ -576,9 +551,9 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testViewFilePutAndGetContents() {
+ public function testViewFilePutAndGetContents() {
- $filename = '/tmp-' . uniqid();
+ $filename = '/tmp-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
// Save short data as encrypted file using stream wrapper
@@ -610,8 +585,8 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @large
*/
- function testTouchExistingFile() {
- $filename = '/tmp-' . uniqid();
+ public function testTouchExistingFile() {
+ $filename = '/tmp-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
// Save short data as encrypted file using stream wrapper
@@ -634,8 +609,8 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testTouchFile() {
- $filename = '/tmp-' . uniqid();
+ public function testTouchFile() {
+ $filename = '/tmp-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
$view->touch($filename);
@@ -658,8 +633,8 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/**
* @medium
*/
- function testFopenFile() {
- $filename = '/tmp-' . uniqid();
+ public function testFopenFile() {
+ $filename = '/tmp-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
// Save short data as encrypted file using stream wrapper
@@ -676,6 +651,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataShort, $decrypt);
// tear down
+ fclose($handle);
$view->unlink($filename);
}
diff --git a/apps/files_encryption/tests/helper.php b/apps/files_encryption/tests/helper.php
index ed543bf89f6..bf86860125a 100644
--- a/apps/files_encryption/tests/helper.php
+++ b/apps/files_encryption/tests/helper.php
@@ -6,39 +6,39 @@
* See the COPYING-README file.
*/
-require_once __DIR__ . '/util.php';
-
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Helper
+ * Class Helper
*/
-class Test_Encryption_Helper extends \PHPUnit_Framework_TestCase {
+class Helper extends TestCase {
const TEST_ENCRYPTION_HELPER_USER1 = "test-helper-user1";
const TEST_ENCRYPTION_HELPER_USER2 = "test-helper-user2";
- public function setUp() {
+ protected function setUpUsers() {
// create test user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER2, true);
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_HELPER_USER2, true);
+ self::loginHelper(self::TEST_ENCRYPTION_HELPER_USER1, true);
}
- public function tearDown() {
+ protected function cleanUpUsers() {
// cleanup test user
- \OC_User::deleteUser(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER1);
- \OC_User::deleteUser(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER2);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_HELPER_USER1);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_HELPER_USER2);
}
- public static function tearDownAfterClass() {
+ public static function setupHooks() {
+ // Filesystem related hooks
+ \OCA\Files_Encryption\Helper::registerFilesystemHooks();
- \OC_Hook::clear();
+ // clear and register hooks
\OC_FileProxy::clearProxies();
+ \OC_FileProxy::register(new \OCA\Files_Encryption\Proxy());
+ }
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
+ public static function tearDownAfterClass() {
+ parent::tearDownAfterClass();
}
/**
@@ -49,13 +49,13 @@ class Test_Encryption_Helper extends \PHPUnit_Framework_TestCase {
$partFilename = 'testfile.txt.part';
$filename = 'testfile.txt';
- $this->assertTrue(Encryption\Helper::isPartialFilePath($partFilename));
+ $this->assertTrue(\OCA\Files_Encryption\Helper::isPartialFilePath($partFilename));
- $this->assertEquals('testfile.txt', Encryption\Helper::stripPartialFileExtension($partFilename));
+ $this->assertEquals('testfile.txt', \OCA\Files_Encryption\Helper::stripPartialFileExtension($partFilename));
- $this->assertFalse(Encryption\Helper::isPartialFilePath($filename));
+ $this->assertFalse(\OCA\Files_Encryption\Helper::isPartialFilePath($filename));
- $this->assertEquals('testfile.txt', Encryption\Helper::stripPartialFileExtension($filename));
+ $this->assertEquals('testfile.txt', \OCA\Files_Encryption\Helper::stripPartialFileExtension($filename));
}
@@ -67,13 +67,13 @@ class Test_Encryption_Helper extends \PHPUnit_Framework_TestCase {
$partFilename = 'testfile.txt.ocTransferId643653835.part';
$filename = 'testfile.txt';
- $this->assertTrue(Encryption\Helper::isPartialFilePath($partFilename));
+ $this->assertTrue(\OCA\Files_Encryption\Helper::isPartialFilePath($partFilename));
- $this->assertEquals('testfile.txt', Encryption\Helper::stripPartialFileExtension($partFilename));
+ $this->assertEquals('testfile.txt', \OCA\Files_Encryption\Helper::stripPartialFileExtension($partFilename));
- $this->assertFalse(Encryption\Helper::isPartialFilePath($filename));
+ $this->assertFalse(\OCA\Files_Encryption\Helper::isPartialFilePath($filename));
- $this->assertEquals('testfile.txt', Encryption\Helper::stripPartialFileExtension($filename));
+ $this->assertEquals('testfile.txt', \OCA\Files_Encryption\Helper::stripPartialFileExtension($filename));
}
function testGetPathToRealFile() {
@@ -85,85 +85,36 @@ class Test_Encryption_Helper extends \PHPUnit_Framework_TestCase {
$versionPath = "/user/files_versions/foo/bar/test.txt.v456756835";
$cachePath = "/user/cache/transferid636483/foo/bar/test.txt";
- $this->assertEquals($relativePath, Encryption\Helper::getPathToRealFile($versionPath));
- $this->assertEquals($relativePath, Encryption\Helper::getPathToRealFile($cachePath));
+ $this->assertEquals($relativePath, \OCA\Files_Encryption\Helper::getPathToRealFile($versionPath));
+ $this->assertEquals($relativePath, \OCA\Files_Encryption\Helper::getPathToRealFile($cachePath));
}
function testGetUser() {
+ self::setUpUsers();
$path1 = "/" . self::TEST_ENCRYPTION_HELPER_USER1 . "/files/foo/bar.txt";
$path2 = "/" . self::TEST_ENCRYPTION_HELPER_USER1 . "/cache/foo/bar.txt";
$path3 = "/" . self::TEST_ENCRYPTION_HELPER_USER2 . "/thumbnails/foo";
$path4 ="/" . "/" . self::TEST_ENCRYPTION_HELPER_USER1;
- \Test_Encryption_Util::loginHelper(self::TEST_ENCRYPTION_HELPER_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_HELPER_USER1);
// if we are logged-in every path should return the currently logged-in user
- $this->assertEquals(self::TEST_ENCRYPTION_HELPER_USER1, Encryption\Helper::getUser($path3));
+ $this->assertEquals(self::TEST_ENCRYPTION_HELPER_USER1, \OCA\Files_Encryption\Helper::getUser($path3));
// now log out
- \Test_Encryption_Util::logoutHelper();
+ self::logoutHelper();
// now we should only get the user from /user/files and user/cache paths
- $this->assertEquals(self::TEST_ENCRYPTION_HELPER_USER1, Encryption\Helper::getUser($path1));
- $this->assertEquals(self::TEST_ENCRYPTION_HELPER_USER1, Encryption\Helper::getUser($path2));
+ $this->assertEquals(self::TEST_ENCRYPTION_HELPER_USER1, \OCA\Files_Encryption\Helper::getUser($path1));
+ $this->assertEquals(self::TEST_ENCRYPTION_HELPER_USER1, \OCA\Files_Encryption\Helper::getUser($path2));
- $this->assertFalse(Encryption\Helper::getUser($path3));
- $this->assertFalse(Encryption\Helper::getUser($path4));
+ $this->assertFalse(\OCA\Files_Encryption\Helper::getUser($path3));
+ $this->assertFalse(\OCA\Files_Encryption\Helper::getUser($path4));
// Log-in again
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER1);
- }
-
- function userNamesProvider() {
- return array(
- array('testuser' . uniqid()),
- array('user.name.with.dots'),
- );
- }
-
- /**
- * Tests whether share keys can be found
- *
- * @dataProvider userNamesProvider
- */
- function testFindShareKeys($userName) {
- // note: not using dataProvider as we want to make
- // sure that the correct keys are match and not any
- // other ones that might happen to have similar names
- \Test_Encryption_Util::setupHooks();
- \Test_Encryption_Util::loginHelper($userName, true);
- $testDir = 'testFindShareKeys' . uniqid() . '/';
- $baseDir = $userName . '/files/' . $testDir;
- $fileList = array(
- 't est.txt',
- 't est_.txt',
- 't est.doc.txt',
- 't est(.*).txt', // make sure the regexp is escaped
- 'multiple.dots.can.happen.too.txt',
- 't est.' . $userName . '.txt',
- 't est_.' . $userName . '.shareKey.txt',
- 'who would upload their.shareKey',
- 'user ones file.txt',
- 'user ones file.txt.backup',
- '.t est.txt'
- );
-
- $rootView = new \OC\Files\View('/');
- $rootView->mkdir($baseDir);
- foreach ($fileList as $fileName) {
- $rootView->file_put_contents($baseDir . $fileName, 'dummy');
- }
-
- $shareKeysDir = $userName . '/files_encryption/share-keys/' . $testDir;
- foreach ($fileList as $fileName) {
- // make sure that every file only gets its correct respective keys
- $result = Encryption\Helper::findShareKeys($baseDir . $fileName, $shareKeysDir . $fileName, $rootView);
- $this->assertEquals(
- array($shareKeysDir . $fileName . '.' . $userName . '.shareKey'),
- $result
- );
- }
+ self::loginHelper(self::TEST_ENCRYPTION_HELPER_USER1);
+ self::cleanUpUsers();
}
}
diff --git a/apps/files_encryption/tests/hooks.php b/apps/files_encryption/tests/hooks.php
index c2434c0f5f6..7c60024d637 100644
--- a/apps/files_encryption/tests/hooks.php
+++ b/apps/files_encryption/tests/hooks.php
@@ -20,24 +20,22 @@
*
*/
-require_once __DIR__ . '/util.php';
-
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Hooks
+ * Class Hooks
* this class provide basic hook app tests
*/
-class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
+class Hooks extends TestCase {
const TEST_ENCRYPTION_HOOKS_USER1 = "test-encryption-hooks-user1.dot";
const TEST_ENCRYPTION_HOOKS_USER2 = "test-encryption-hooks-user2.dot";
- /**
- * @var \OC\Files\View
- */
+ /** @var \OC\Files\View */
public $user1View; // view on /data/user1/files
+ /** @var \OC\Files\View */
public $user2View; // view on /data/user2/files
+ /** @var \OC\Files\View */
public $rootView; // view on /data/user
public $data;
public $filename;
@@ -46,6 +44,8 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
private static $testFiles;
public static function setUpBeforeClass() {
+ parent::setUpBeforeClass();
+
// note: not using a data provider because these
// files all need to coexist to make sure the
// share keys are found properly (pattern matching)
@@ -63,62 +63,36 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
'.t est.txt'
);
- // reset backend
- \OC_User::clearBackends();
- \OC_User::useBackend('database');
-
- \OC_Hook::clear('OC_Filesystem');
- \OC_Hook::clear('OC_User');
-
- // clear share hooks
- \OC_Hook::clear('OCP\\Share');
- \OC::registerShareHooks();
- \OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Shared', 'setup');
-
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerFilesystemHooks();
-
- // Sharing related hooks
- \OCA\Encryption\Helper::registerShareHooks();
-
- // clear and register proxies
- \OC_FileProxy::clearProxies();
- \OC_FileProxy::register(new OCA\Encryption\Proxy());
-
// create test user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1, true);
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2, true);
+ self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER2, true);
}
- function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
// set user id
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
- \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER1);
+ \OC_User::setUserId(self::TEST_ENCRYPTION_HOOKS_USER1);
// init filesystem view
- $this->user1View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '/files');
- $this->user2View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '/files');
+ $this->user1View = new \OC\Files\View('/'. self::TEST_ENCRYPTION_HOOKS_USER1 . '/files');
+ $this->user2View = new \OC\Files\View('/'. self::TEST_ENCRYPTION_HOOKS_USER2 . '/files');
$this->rootView = new \OC\Files\View('/');
// init short data
$this->data = 'hats';
- $this->filename = 'enc_hooks_tests-' . uniqid() . '.txt';
- $this->folder = 'enc_hooks_tests_folder-' . uniqid();
+ $this->filename = 'enc_hooks_tests-' . $this->getUniqueID() . '.txt';
+ $this->folder = 'enc_hooks_tests_folder-' . $this->getUniqueID();
}
public static function tearDownAfterClass() {
// cleanup test user
- \OC_User::deleteUser(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
- \OC_User::deleteUser(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2);
-
- \OC_Hook::clear();
- \OC_FileProxy::clearProxies();
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_HOOKS_USER1);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_HOOKS_USER2);
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
+ parent::tearDownAfterClass();
}
function testDisableHook() {
@@ -130,7 +104,7 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
$this->assertTrue(is_array($row));
// disabling the app should delete all user specific settings
- \OCA\Encryption\Hooks::preDisable(array('app' => 'files_encryption'));
+ \OCA\Files_Encryption\Hooks::preDisable(array('app' => 'files_encryption'));
// check if user specific settings for the encryption app are really gone
$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*preferences` WHERE `appid` = ?');
@@ -140,14 +114,14 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
// relogin user to initialize the encryption again
$user = \OCP\User::getUser();
- \Test_Encryption_Util::loginHelper($user);
+ self::loginHelper($user);
}
function testDeleteHooks() {
// remember files_trashbin state
- $stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+ $stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we want to tests with app files_trashbin disabled
\OC_App::disable('files_trashbin');
@@ -159,25 +133,25 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
// check if all keys are generated
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/fileKey'));
- \Test_Encryption_Util::logoutHelper();
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2);
- \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2);
+ self::logoutHelper();
+ self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER2);
+ \OC_User::setUserId(self::TEST_ENCRYPTION_HOOKS_USER2);
$this->user2View->file_put_contents($this->filename, $this->data);
// check if all keys are generated
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
+ self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/' . $this->filename . '/fileKey'));
// create a dummy file that we can delete something outside of data/user/files
@@ -189,10 +163,10 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
// all keys should still exist
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
+ self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/' . $this->filename . '/fileKey'));
// delete the file in data/user/files
@@ -201,34 +175,34 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
// check if keys from user2 are really deleted
$this->assertFalse($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
$this->assertFalse($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
+ self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/' . $this->filename . '/fileKey'));
// but user1 keys should still exist
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/fileKey'));
if ($stateFilesTrashbin) {
- OC_App::enable('files_trashbin');
+ \OC_App::enable('files_trashbin');
}
else {
- OC_App::disable('files_trashbin');
+ \OC_App::disable('files_trashbin');
}
}
function testDeleteHooksForSharedFiles() {
- \Test_Encryption_Util::logoutHelper();
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
- \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
+ self::logoutHelper();
+ self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER1);
+ \OC_User::setUserId(self::TEST_ENCRYPTION_HOOKS_USER1);
// remember files_trashbin state
- $stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+ $stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we want to tests with app files_trashbin disabled
\OC_App::disable('files_trashbin');
@@ -240,10 +214,10 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
// check if all keys are generated
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/fileKey'));
// get the file info from previous created file
$fileInfo = $this->user1View->getFileInfo($this->filename);
@@ -252,26 +226,26 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the file with user2
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_HOOKS_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_HOOKS_USER2, \OCP\Constants::PERMISSION_ALL);
// check if new share key exists
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
- \Test_Encryption_Util::logoutHelper();
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2);
- \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2);
+ self::logoutHelper();
+ self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER2);
+ \OC_User::setUserId(self::TEST_ENCRYPTION_HOOKS_USER2);
// user2 update the shared file
$this->user2View->file_put_contents($this->filename, $this->data);
// keys should be stored at user1s dir, not in user2s
$this->assertFalse($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
$this->assertFalse($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
+ self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/' . $this->filename . '/fileKey'));
// delete the Shared file from user1 in data/user2/files/Shared
$result = $this->user2View->unlink($this->filename);
@@ -280,25 +254,25 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
// share key for user2 from user1s home should be gone, all other keys should still exists
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertFalse($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
+ self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/fileKey'));
// cleanup
- \Test_Encryption_Util::logoutHelper();
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
- \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
+ self::logoutHelper();
+ self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER1);
+ \OC_User::setUserId(self::TEST_ENCRYPTION_HOOKS_USER1);
if ($stateFilesTrashbin) {
- OC_App::enable('files_trashbin');
+ \OC_App::enable('files_trashbin');
}
else {
- OC_App::disable('files_trashbin');
+ \OC_App::disable('files_trashbin');
}
}
@@ -323,12 +297,12 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
function doTestRenameHook($filename) {
// check if keys exists
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $filename . '.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/'
- . $filename . '.key'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $filename . '/fileKey'));
// make subfolder and sub-subfolder
$this->rootView->mkdir('/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files/' . $this->folder);
@@ -347,18 +321,18 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
// keys should be renamed too
$this->assertFalse($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $filename . '.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertFalse($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/'
- . $filename . '.key'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $filename . '/fileKey'));
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/' . $this->folder . '/' . $this->folder . '/'
- . $filename . '.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->folder . '/' . $this->folder . '/'
+ . $filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/' . $this->folder . '/' . $this->folder . '/'
- . $filename . '.key'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->folder . '/' . $this->folder . '/'
+ . $filename . '/fileKey'));
// cleanup
$this->rootView->unlink('/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files/' . $this->folder);
@@ -385,12 +359,12 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
function doTestCopyHook($filename) {
// check if keys exists
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $filename . '.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/'
- . $filename . '.key'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $filename . '/fileKey'));
// make subfolder and sub-subfolder
$this->rootView->mkdir('/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files/' . $this->folder);
@@ -406,18 +380,18 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
// keys should be copied too
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/'
- . $filename . '.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/'
- . $filename . '.key'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/'
+ . $filename . '/fileKey'));
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/' . $this->folder . '/' . $this->folder . '/'
- . $filename . '.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->folder . '/' . $this->folder . '/'
+ . $filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey'));
$this->assertTrue($this->rootView->file_exists(
- '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/' . $this->folder . '/' . $this->folder . '/'
- . $filename . '.key'));
+ '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->folder . '/' . $this->folder . '/'
+ . $filename . '/fileKey'));
// cleanup
$this->rootView->unlink('/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files/' . $this->folder);
@@ -433,35 +407,35 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
$view = new \OC\Files\View();
// set user password for the first time
- \OCA\Encryption\Hooks::postCreateUser(array('uid' => 'newUser', 'password' => 'newUserPassword'));
+ \OCA\Files_Encryption\Hooks::postCreateUser(array('uid' => 'newUser', 'password' => 'newUserPassword'));
- $this->assertTrue($view->file_exists('public-keys/newUser.public.key'));
- $this->assertTrue($view->file_exists('newUser/files_encryption/newUser.private.key'));
+ $this->assertTrue($view->file_exists(\OCA\Files_Encryption\Keymanager::getPublicKeyPath() . '/newUser.publicKey'));
+ $this->assertTrue($view->file_exists('newUser/files_encryption/newUser.privateKey'));
// check if we are able to decrypt the private key
- $encryptedKey = \OCA\Encryption\Keymanager::getPrivateKey($view, 'newUser');
- $privateKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, 'newUserPassword');
+ $encryptedKey = \OCA\Files_Encryption\Keymanager::getPrivateKey($view, 'newUser');
+ $privateKey = \OCA\Files_Encryption\Crypt::decryptPrivateKey($encryptedKey, 'newUserPassword');
$this->assertTrue(is_string($privateKey));
// change the password before the user logged-in for the first time,
// we can replace the encryption keys
- \OCA\Encryption\Hooks::setPassphrase(array('uid' => 'newUser', 'password' => 'passwordChanged'));
+ \OCA\Files_Encryption\Hooks::setPassphrase(array('uid' => 'newUser', 'password' => 'passwordChanged'));
- $encryptedKey = \OCA\Encryption\Keymanager::getPrivateKey($view, 'newUser');
- $privateKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, 'passwordChanged');
+ $encryptedKey = \OCA\Files_Encryption\Keymanager::getPrivateKey($view, 'newUser');
+ $privateKey = \OCA\Files_Encryption\Crypt::decryptPrivateKey($encryptedKey, 'passwordChanged');
$this->assertTrue(is_string($privateKey));
// now create a files folder to simulate a already used account
$view->mkdir('/newUser/files');
// change the password after the user logged in, now the password should not change
- \OCA\Encryption\Hooks::setPassphrase(array('uid' => 'newUser', 'password' => 'passwordChanged2'));
+ \OCA\Files_Encryption\Hooks::setPassphrase(array('uid' => 'newUser', 'password' => 'passwordChanged2'));
- $encryptedKey = \OCA\Encryption\Keymanager::getPrivateKey($view, 'newUser');
- $privateKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, 'passwordChanged2');
+ $encryptedKey = \OCA\Files_Encryption\Keymanager::getPrivateKey($view, 'newUser');
+ $privateKey = \OCA\Files_Encryption\Crypt::decryptPrivateKey($encryptedKey, 'passwordChanged2');
$this->assertFalse($privateKey);
- $privateKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, 'passwordChanged');
+ $privateKey = \OCA\Files_Encryption\Crypt::decryptPrivateKey($encryptedKey, 'passwordChanged');
$this->assertTrue(is_string($privateKey));
}
diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php
index e2486ee93eb..0d17923664d 100644
--- a/apps/files_encryption/tests/keymanager.php
+++ b/apps/files_encryption/tests/keymanager.php
@@ -6,14 +6,12 @@
* See the COPYING-README file.
*/
-require_once __DIR__ . '/util.php';
-
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Keymanager
+ * Class Keymanager
*/
-class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
+class Keymanager extends TestCase {
const TEST_USER = "test-keymanager-user.dot";
@@ -21,83 +19,87 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
public $pass;
public static $stateFilesTrashbin;
/**
- * @var OC\Files\View
+ * @var \OC\Files\View
*/
public $view;
public $randomKey;
public $dataShort;
public static function setUpBeforeClass() {
- // reset backend
- \OC_User::clearBackends();
- \OC_User::useBackend('database');
-
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerFilesystemHooks();
-
- // clear and register hooks
- \OC_FileProxy::clearProxies();
- \OC_FileProxy::register(new OCA\Encryption\Proxy());
+ parent::setUpBeforeClass();
// disable file proxy by default
\OC_FileProxy::$enabled = false;
// remember files_trashbin state
- self::$stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+ self::$stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we don't want to tests with app files_trashbin enabled
\OC_App::disable('files_trashbin');
// create test user
- \OC_User::deleteUser(\Test_Encryption_Keymanager::TEST_USER);
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Keymanager::TEST_USER, true);
+ \OC_User::deleteUser(self::TEST_USER);
+ parent::loginHelper(self::TEST_USER, true);
}
- function setUp() {
+ protected function setUp() {
+ parent::setUp();
// set content for encrypting / decrypting in tests
$this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
$this->dataShort = 'hats';
$this->dataUrl = __DIR__ . '/../lib/crypt.php';
$this->legacyData = __DIR__ . '/legacy-text.txt';
$this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';
- $this->randomKey = Encryption\Crypt::generateKey();
+ $this->randomKey = \OCA\Files_Encryption\Crypt::generateKey();
- $keypair = Encryption\Crypt::createKeypair();
+ $keypair = \OCA\Files_Encryption\Crypt::createKeypair();
$this->genPublicKey = $keypair['publicKey'];
$this->genPrivateKey = $keypair['privateKey'];
$this->view = new \OC\Files\View('/');
- \Test_Encryption_Util::loginHelper(Test_Encryption_Keymanager::TEST_USER);
- $this->userId = \Test_Encryption_Keymanager::TEST_USER;
- $this->pass = \Test_Encryption_Keymanager::TEST_USER;
+ self::loginHelper(self::TEST_USER);
+ $this->userId = self::TEST_USER;
+ $this->pass = self::TEST_USER;
$userHome = \OC_User::getHome($this->userId);
$this->dataDir = str_replace('/' . $this->userId, '', $userHome);
}
function tearDown() {
- $this->view->deleteAll('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys');
- $this->view->deleteAll('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles');
+ $this->view->deleteAll('/' . self::TEST_USER . '/files_encryption/keys');
+ parent::tearDown();
}
public static function tearDownAfterClass() {
\OC_FileProxy::$enabled = true;
// cleanup test user
- \OC_User::deleteUser(\Test_Encryption_Keymanager::TEST_USER);
+ \OC_User::deleteUser(self::TEST_USER);
// reset app files_trashbin
if (self::$stateFilesTrashbin) {
- OC_App::enable('files_trashbin');
+ \OC_App::enable('files_trashbin');
}
- \OC_Hook::clear();
- \OC_FileProxy::clearProxies();
+ parent::tearDownAfterClass();
+ }
+
+ function testKeyCacheUpdate() {
+ $testUser = 'testKeyCacheUpdate';
+ \OCA\Files_Encryption\Keymanager::setPublicKey('oldKey', $testUser);
+
+ $this->assertSame('oldKey',
+ \OCA\Files_Encryption\Keymanager::getPublicKey($this->view, $testUser));
+
+ // update key
+ \OCA\Files_Encryption\Keymanager::setPublicKey('newKey', $testUser);
+
+ $this->assertSame('newKey',
+ \OCA\Files_Encryption\Keymanager::getPublicKey($this->view, $testUser));
+
+ // cleanup
+ \OCA\Files_Encryption\Keymanager::deletePublicKey($this->view, $testUser);
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
}
/**
@@ -105,9 +107,9 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
*/
function testGetPrivateKey() {
- $key = Encryption\Keymanager::getPrivateKey($this->view, $this->userId);
+ $key = \OCA\Files_Encryption\Keymanager::getPrivateKey($this->view, $this->userId);
- $privateKey = Encryption\Crypt::decryptPrivateKey($key, $this->pass);
+ $privateKey = \OCA\Files_Encryption\Crypt::decryptPrivateKey($key, $this->pass);
$res = openssl_pkey_get_private($privateKey);
@@ -124,7 +126,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
*/
function testGetPublicKey() {
- $publiceKey = Encryption\Keymanager::getPublicKey($this->view, $this->userId);
+ $publiceKey = \OCA\Files_Encryption\Keymanager::getPublicKey($this->view, $this->userId);
$res = openssl_pkey_get_public($publiceKey);
@@ -135,27 +137,6 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
$this->assertArrayHasKey('key', $sslInfo);
}
- function fileNameFromShareKeyProvider() {
- return array(
- array('file.user.shareKey', 'user', 'file'),
- array('file.name.with.dots.user.shareKey', 'user', 'file.name.with.dots'),
- array('file.name.user.with.dots.shareKey', 'user.with.dots', 'file.name'),
- array('file.txt', 'user', false),
- array('user.shareKey', 'user', false),
- );
- }
-
- /**
- * @small
- *
- * @dataProvider fileNameFromShareKeyProvider
- */
- function testGetFilenameFromShareKey($fileName, $user, $expectedFileName) {
- $this->assertEquals($expectedFileName,
- \TestProtectedKeymanagerMethods::testGetFilenameFromShareKey($fileName, $user)
- );
- }
-
/**
* @medium
*/
@@ -163,9 +144,9 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
$key = $this->randomKey;
- $file = 'unittest-' . uniqid() . '.txt';
+ $file = 'unittest-' . $this->getUniqueID() . '.txt';
- $util = new Encryption\Util($this->view, $this->userId);
+ $util = new \OCA\Files_Encryption\Util($this->view, $this->userId);
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
@@ -173,9 +154,9 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
$this->view->file_put_contents($this->userId . '/files/' . $file, $this->dataShort);
- Encryption\Keymanager::setFileKey($this->view, $util, $file, $key);
+ \OCA\Files_Encryption\Keymanager::setFileKey($this->view, $util, $file, $key);
- $this->assertTrue($this->view->file_exists('/' . $this->userId . '/files_encryption/keyfiles/' . $file . '.key'));
+ $this->assertTrue($this->view->file_exists('/' . $this->userId . '/files_encryption/keys/' . $file . '/fileKey'));
// cleanup
$this->view->unlink('/' . $this->userId . '/files/' . $file);
@@ -191,9 +172,9 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
$key = "dummy key";
- Encryption\Keymanager::setPrivateKey($key, 'dummyUser');
+ \OCA\Files_Encryption\Keymanager::setPrivateKey($key, 'dummyUser');
- $this->assertTrue($this->view->file_exists('/dummyUser/files_encryption/dummyUser.private.key'));
+ $this->assertTrue($this->view->file_exists('/dummyUser/files_encryption/dummyUser.privateKey'));
//clean up
$this->view->deleteAll('/dummyUser');
@@ -205,14 +186,19 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
function testSetPrivateSystemKey() {
$key = "dummy key";
- $keyName = "myDummyKey.private.key";
+ $keyName = "myDummyKey";
+ $encHeader = \OCA\Files_Encryption\Crypt::generateHeader();
- Encryption\Keymanager::setPrivateSystemKey($key, $keyName);
+ \OCA\Files_Encryption\Keymanager::setPrivateSystemKey($key, $keyName);
- $this->assertTrue($this->view->file_exists('/owncloud_private_key/' . $keyName));
+ $this->assertTrue($this->view->file_exists('/files_encryption/' . $keyName . '.privateKey'));
+
+ $result = \OCA\Files_Encryption\Keymanager::getPrivateSystemKey($keyName);
+
+ $this->assertSame($encHeader . $key, $result);
// clean up
- $this->view->unlink('/owncloud_private_key/' . $keyName);
+ $this->view->unlink('/files_encryption/' . $keyName.'.privateKey');
}
@@ -221,7 +207,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
*/
function testGetUserKeys() {
- $keys = Encryption\Keymanager::getUserKeys($this->view, $this->userId);
+ $keys = \OCA\Files_Encryption\Keymanager::getUserKeys($this->view, $this->userId);
$resPublic = openssl_pkey_get_public($keys['publicKey']);
@@ -231,7 +217,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
$this->assertArrayHasKey('key', $sslInfoPublic);
- $privateKey = Encryption\Crypt::decryptPrivateKey($keys['privateKey'], $this->pass);
+ $privateKey = \OCA\Files_Encryption\Crypt::decryptPrivateKey($keys['privateKey'], $this->pass);
$resPrivate = openssl_pkey_get_private($privateKey);
@@ -247,77 +233,85 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
*/
function testRecursiveDelShareKeysFolder() {
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1/existingFile.txt', 'data');
+ $this->view->mkdir('/' . self::TEST_USER . '/files/folder1');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files/folder1/existingFile.txt', 'data');
// create folder structure for some dummy share key files
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1');
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder');
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder/subsubfolder');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1/file1');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1/file2');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/file2');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/subsubfolder');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/subsubfolder/file1');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/subsubfolder/file2');
// create some dummy share keys
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user1.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.user1.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.user1.test.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.test-keymanager-userxdot.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.userx.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.' . Test_Encryption_Keymanager::TEST_USER . '.userx.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.user1.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.' . Test_Encryption_Keymanager::TEST_USER . '.user1.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file2.user2.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file2.user3.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder/file2.user3.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder/subsubfolder/file1.user1.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder/subsubfolder/file2.user2.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder/subsubfolder/file2.user3.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/user1.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/' . self::TEST_USER . '.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/user1.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/user1.test.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/test-keymanager-userxdot.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/userx.' . self::TEST_USER . '.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/' . self::TEST_USER . '.userx.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/user1.' . self::TEST_USER . '.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/' . self::TEST_USER . '.user1.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/file2/user2.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/file2/user3.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/file2/user3.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/subsubfolder/file1/user1.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/subsubfolder/file2/user2.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/subsubfolder/file2/user3.shareKey', 'data');
// recursive delete share keys from user1 and user2
- Encryption\Keymanager::delShareKey($this->view, array('user1', 'user2', Test_Encryption_Keymanager::TEST_USER), '/folder1/', Test_Encryption_Keymanager::TEST_USER);
+ \OCA\Files_Encryption\Keymanager::delShareKey($this->view,
+ array('user1', 'user2', self::TEST_USER),
+ \OCA\Files_Encryption\Keymanager::getKeyPath($this->view, new \OCA\Files_Encryption\Util($this->view, self::TEST_USER), '/folder1'),
+ self::TEST_USER,
+ '/folder1');
// check if share keys from user1 and user2 are deleted
$this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.user1.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/user1.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.user1.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/share-keys/folder1/file1/user1.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file2.user2.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/share-keys/folder1/file2/user2.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder/subsubfolder/file1.user1.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/share-keys/folder1/subfolder/subsubfolder/file1/user1.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder/subsubfolder/file2.user2.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/share-keys/folder1/subfolder/subsubfolder/file2/user2.shareKey'));
// check if share keys from user3 still exists
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file2.user3.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/file2/user3.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder/subsubfolder/file2.user3.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/subsubfolder/file2/user3.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/subfolder/file2.user3.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/subfolder/file2/user3.shareKey'));
- // check if share keys for user or file with similar name
+ // check if share keys for user or file with similar name
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.user1.test.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/user1.test.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.test-keymanager-userxdot.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/test-keymanager-userxdot.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.' . Test_Encryption_Keymanager::TEST_USER . '.userx.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/' . self::TEST_USER . '.userx.shareKey'));
// FIXME: this case currently cannot be distinguished, needs further fixing
- /*
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.userx.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/userx.' . self::TEST_USER . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.user1.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/user1.' . self::TEST_USER . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/file1.' . Test_Encryption_Keymanager::TEST_USER . '.user1.shareKey'));
- */
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/file1/' . self::TEST_USER . '.user1.shareKey'));
// owner key from existing file should still exists because the file is still there
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/' . self::TEST_USER . '.shareKey'));
// cleanup
- $this->view->deleteAll('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
+ $this->view->deleteAll('/' . self::TEST_USER . '/files/folder1');
}
@@ -326,178 +320,53 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
*/
function testRecursiveDelShareKeysFile() {
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1/existingFile.txt', 'data');
+ $this->view->mkdir('/' . self::TEST_USER . '/files/folder1');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files/folder1/existingFile.txt', 'data');
// create folder structure for some dummy share key files
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1');
+ $this->view->mkdir('/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt');
// create some dummy share keys
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user1.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user2.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user3.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/user1.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/user2.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/user3.shareKey', 'data');
+ $this->view->file_put_contents('/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/' . self::TEST_USER . '.shareKey', 'data');
// recursive delete share keys from user1 and user2
- Encryption\Keymanager::delShareKey($this->view, array('user1', 'user2', Test_Encryption_Keymanager::TEST_USER), '/folder1/existingFile.txt', Test_Encryption_Keymanager::TEST_USER);
+ \OCA\Files_Encryption\Keymanager::delShareKey($this->view,
+ array('user1', 'user2', self::TEST_USER),
+ \OCA\Files_Encryption\Keymanager::getKeyPath($this->view, new \OCA\Files_Encryption\Util($this->view, self::TEST_USER), '/folder1/existingFile.txt'),
+ self::TEST_USER,
+ '/folder1/existingFile.txt');
+
// check if share keys from user1 and user2 are deleted
$this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.user1.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile/user1.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.user2.shareKey'));
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile/user2.shareKey'));
// check if share keys for user3 and owner
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey'));
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user3.shareKey'));
- // cleanup
- $this->view->deleteAll('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
-
- }
-
- /**
- * @medium
- */
- function testDeleteFileKey() {
-
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1/existingFile.txt', 'data');
-
- // create folder structure for some dummy file key files
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1');
-
- // create dummy keyfile
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1/dummyFile.txt.key', 'data');
-
- // recursive delete share keys from user1 and user2
- $result = Encryption\Keymanager::deleteFileKey($this->view, '/folder1/existingFile.txt');
- $this->assertFalse($result);
-
- $result2 = Encryption\Keymanager::deleteFileKey($this->view, '/folder1/dummyFile.txt');
- $this->assertTrue($result2);
-
- // check if file key from dummyFile was deleted
- $this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1/dummyFile.txt.key'));
-
- // check if file key from existing file still exists
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/' . self::TEST_USER . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1/existingFile.txt.key'));
-
+ '/' . self::TEST_USER . '/files_encryption/keys/folder1/existingFile.txt/user3.shareKey'));
// cleanup
- $this->view->deleteAll('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
-
- }
-
- /**
- * @medium
- */
- function testDeleteFileKeyFolder() {
-
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1/existingFile.txt', 'data');
-
- // create folder structure for some dummy file key files
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1');
-
- // create dummy keyfile
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1/dummyFile.txt.key', 'data');
-
- // recursive delete share keys from user1 and user2
- $result = Encryption\Keymanager::deleteFileKey($this->view, '/folder1');
- $this->assertFalse($result);
-
- // all file keys should still exists if we try to delete a folder with keys for which some files still exists
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1/dummyFile.txt.key'));
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1/existingFile.txt.key'));
-
- // delete folder
- $this->view->unlink('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
- // create dummy keyfile
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1/dummyFile.txt.key', 'data');
-
- // now file keys should be deleted since the folder no longer exists
- $result = Encryption\Keymanager::deleteFileKey($this->view, '/folder1');
- $this->assertTrue($result);
-
- $this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/keyfiles/folder1'));
-
- // cleanup
- $this->view->deleteAll('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
-
- }
-
- function testDelAllShareKeysFile() {
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1/existingFile.txt', 'data');
-
- // create folder structure for some dummy share key files
- $this->view->mkdir('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1');
-
- // create some dummy share keys for the existing file
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user1.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user2.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user3.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey', 'data');
-
- // create some dummy share keys for a non-existing file
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/nonexistingFile.txt.user1.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/nonexistingFile.txt.user2.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/nonexistingFile.txt.user3.shareKey', 'data');
- $this->view->file_put_contents('/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/nonexistingFile.txt.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey', 'data');
-
- // try to del all share keys from a existing file, should fail because the file still exists
- $result = Encryption\Keymanager::delAllShareKeys($this->view, Test_Encryption_Keymanager::TEST_USER, 'folder1/existingFile.txt');
- $this->assertFalse($result);
-
- // check if share keys still exists
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey'));
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user1.shareKey'));
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user2.shareKey'));
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/existingFile.txt.user3.shareKey'));
-
- // try to del all share keys from file, should succeed because the does not exist any more
- $result2 = Encryption\Keymanager::delAllShareKeys($this->view, Test_Encryption_Keymanager::TEST_USER, 'folder1/nonexistingFile.txt');
- $this->assertTrue($result2);
-
- // check if share keys are really gone
- $this->assertFalse($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/nonexistingFile.txt.' . Test_Encryption_Keymanager::TEST_USER . '.shareKey'));
- // check that it only deleted keys or users who had access, others remain
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/nonexistingFile.txt.user1.shareKey'));
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/nonexistingFile.txt.user2.shareKey'));
- $this->assertTrue($this->view->file_exists(
- '/'.Test_Encryption_Keymanager::TEST_USER.'/files_encryption/share-keys/folder1/nonexistingFile.txt.user3.shareKey'));
-
- // cleanup
- $this->view->deleteAll('/'.Test_Encryption_Keymanager::TEST_USER.'/files/folder1');
+ $this->view->deleteAll('/' . self::TEST_USER . '/files/folder1');
}
function testKeySetPreperation() {
- $basePath = '/'.Test_Encryption_Keymanager::TEST_USER.'/files';
+ $basePath = '/' . self::TEST_USER . '/files';
$path = '/folder1/subfolder/subsubfolder/file.txt';
$this->assertFalse($this->view->is_dir($basePath . '/testKeySetPreperation'));
- $result = TestProtectedKeymanagerMethods::testKeySetPreperation($this->view, $path, $basePath);
-
- // return path without leading slash
- $this->assertSame('folder1/subfolder/subsubfolder/file.txt', $result);
+ TestProtectedKeymanagerMethods::testKeySetPreperation($this->view, $basePath . $path);
// check if directory structure was created
- $this->assertTrue($this->view->is_dir($basePath . '/folder1/subfolder/subsubfolder'));
+ $this->assertTrue($this->view->is_dir($basePath . $path));
// cleanup
$this->view->deleteAll($basePath . '/folder1');
@@ -506,23 +375,16 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
}
/**
- * dummy class to access protected methods of \OCA\Encryption\Keymanager for testing
+ * dummy class to access protected methods of \OCA\Files_Encryption\Keymanager for testing
*/
-class TestProtectedKeymanagerMethods extends \OCA\Encryption\Keymanager {
-
- /**
- * @param string $sharekey
- */
- public static function testGetFilenameFromShareKey($sharekey, $user) {
- return self::getFilenameFromShareKey($sharekey, $user);
- }
+class TestProtectedKeymanagerMethods extends \OCA\Files_Encryption\Keymanager {
/**
* @param \OC\Files\View $view relative to data/
* @param string $path
* @param string $basePath
*/
- public static function testKeySetPreperation($view, $path, $basePath) {
- return self::keySetPreparation($view, $path, $basePath);
+ public static function testKeySetPreperation($view, $path) {
+ self::keySetPreparation($view, $path);
}
}
diff --git a/apps/files_encryption/tests/migration.php b/apps/files_encryption/tests/migration.php
index 80f30d4e793..f0d1ba202ed 100644
--- a/apps/files_encryption/tests/migration.php
+++ b/apps/files_encryption/tests/migration.php
@@ -2,8 +2,9 @@
/**
* ownCloud
*
- * @author Thomas Müller
- * @copyright 2014 Thomas Müller deepdiver@owncloud.com
+ * @copyright (C) 2014 ownCloud, Inc.
+ *
+ * @author Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -20,34 +21,51 @@
*
*/
-use OCA\Encryption;
-use OCA\Files_Encryption\Migration;
+namespace OCA\Files_Encryption\Tests;
-class Test_Migration extends PHPUnit_Framework_TestCase {
+class Migration extends TestCase {
- public function tearDown() {
- if (OC_DB::tableExists('encryption_test')) {
- OC_DB::dropTable('encryption_test');
- }
- $this->assertTableNotExist('encryption_test');
- }
+ const TEST_ENCRYPTION_MIGRATION_USER1='test_encryption_user1';
+ const TEST_ENCRYPTION_MIGRATION_USER2='test_encryption_user2';
+ const TEST_ENCRYPTION_MIGRATION_USER3='test_encryption_user3';
- public function setUp() {
- if (OC_DB::tableExists('encryption_test')) {
- OC_DB::dropTable('encryption_test');
- }
- $this->assertTableNotExist('encryption_test');
+ /** @var \OC\Files\View */
+ private $view;
+ private $public_share_key_id;
+ private $recovery_key_id;
+
+ public static function setUpBeforeClass() {
+ parent::setUpBeforeClass();
+ self::loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER2, true);
+ self::loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER3, true);
}
- public function testEncryptionTableDoesNotExist() {
+ public static function tearDownAfterClass() {
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_MIGRATION_USER1);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_MIGRATION_USER2);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_MIGRATION_USER3);
+ parent::tearDownAfterClass();
+ }
+ protected function tearDown() {
+ if (\OC_DB::tableExists('encryption_test')) {
+ \OC_DB::dropTable('encryption_test');
+ }
$this->assertTableNotExist('encryption_test');
- $migration = new Migration('encryption_test');
- $migration->dropTableEncryption();
+ parent::tearDown();
+ }
+ public function setUp() {
+ $this->loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER1);
+ $this->view = new \OC\Files\View();
+ $this->public_share_key_id = \OCA\Files_Encryption\Helper::getPublicShareKeyId();
+ $this->recovery_key_id = \OCA\Files_Encryption\Helper::getRecoveryKeyId();
+ if (\OC_DB::tableExists('encryption_test')) {
+ \OC_DB::dropTable('encryption_test');
+ }
$this->assertTableNotExist('encryption_test');
-
}
public function checkLastIndexId() {
@@ -83,93 +101,164 @@ class Test_Migration extends PHPUnit_Framework_TestCase {
// create test table
$this->checkLastIndexId();
- OC_DB::createDbFromStructure(__DIR__ . '/encryption_table.xml');
+ \OC_DB::createDbFromStructure(__DIR__ . '/encryption_table.xml');
$this->checkLastIndexId();
}
- public function testDataMigration() {
- // TODO travis
- if (getenv('TRAVIS')) {
- $this->markTestSkipped('Fails on travis');
+ /**
+ * @param string $table
+ */
+ public function assertTableNotExist($table) {
+ $type = \OC_Config::getValue( "dbtype", "sqlite" );
+ if( $type == 'sqlite' || $type == 'sqlite3' ) {
+ // sqlite removes the tables after closing the DB
+ $this->assertTrue(true);
+ } else {
+ $this->assertFalse(\OC_DB::tableExists($table), 'Table ' . $table . ' exists.');
}
-
- $this->assertTableNotExist('encryption_test');
-
- // create test table
- OC_DB::createDbFromStructure(__DIR__ . '/encryption_table.xml');
- $this->assertTableExist('encryption_test');
-
- OC_DB::executeAudited('INSERT INTO `*PREFIX*encryption_test` values(?, ?, ?, ?)',
- array('user1', 'server-side', 1, 1));
-
- // preform migration
- $migration = new Migration('encryption_test');
- $migration->dropTableEncryption();
-
- // assert
- $this->assertTableNotExist('encryption_test');
-
- $rec = \OC_Preferences::getValue('user1', 'files_encryption', 'recovery_enabled');
- $mig = \OC_Preferences::getValue('user1', 'files_encryption', 'migration_status');
-
- $this->assertEquals(1, $rec);
- $this->assertEquals(1, $mig);
}
- public function testDuplicateDataMigration() {
- // TODO travis
- if (getenv('TRAVIS')) {
- $this->markTestSkipped('Fails on travis');
+ protected function createDummyShareKeys($uid) {
+ $this->view->mkdir($uid . '/files_encryption/share-keys/folder1/folder2/folder3');
+ $this->view->mkdir($uid . '/files_encryption/share-keys/folder2/');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder1/folder2/folder3/file3.' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder1/folder2/folder3/file3.' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder1/folder2/folder3/file3.' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder1/folder2/file2.' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder1/folder2/file2.' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder1/folder2/file2.' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder1/file.1.' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder1/file.1.' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder1/file.1.' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder2/file.2.1.' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder2/file.2.1.' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.shareKey' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder2/file.2.1.' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.shareKey' , 'data');
+ if ($this->public_share_key_id) {
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder2/file.2.1.' . $this->public_share_key_id . '.shareKey' , 'data');
}
-
- // create test table
- OC_DB::createDbFromStructure(__DIR__ . '/encryption_table.xml');
-
- // in case of duplicate entries we want to preserve 0 on migration status and 1 on recovery
- $data = array(
- array('user1', 'server-side', 1, 1),
- array('user1', 'server-side', 1, 0),
- array('user1', 'server-side', 0, 1),
- array('user1', 'server-side', 0, 0),
- );
- foreach ($data as $d) {
- OC_DB::executeAudited(
- 'INSERT INTO `*PREFIX*encryption_test` values(?, ?, ?, ?)',
- $d);
+ if ($this->recovery_key_id) {
+ $this->view->file_put_contents($uid . '/files_encryption/share-keys/folder2/file.2.1.' . $this->recovery_key_id . '.shareKey' , 'data');
}
+ }
- // preform migration
- $migration = new Migration('encryption_test');
- $migration->dropTableEncryption();
+ protected function createDummyFileKeys($uid) {
+ $this->view->mkdir($uid . '/files_encryption/keyfiles/folder1/folder2/folder3');
+ $this->view->mkdir($uid . '/files_encryption/keyfiles/folder2/');
+ $this->view->file_put_contents($uid . '/files_encryption/keyfiles/folder1/folder2/folder3/file3.key' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/keyfiles/folder1/folder2/file2.key' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/keyfiles/folder1/file.1.key' , 'data');
+ $this->view->file_put_contents($uid . '/files_encryption/keyfiles/folder2/file.2.1.key' , 'data');
+ }
- // assert
- $this->assertTableNotExist('encryption_test');
+ protected function createDummyFilesInTrash($uid) {
+ $this->view->mkdir($uid . '/files_trashbin/share-keys');
+ $this->view->mkdir($uid . '/files_trashbin/share-keys/folder1.d7437648723');
+ $this->view->file_put_contents($uid . '/files_trashbin/share-keys/file1.' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey.d5457864' , 'data');
+ $this->view->file_put_contents($uid . '/files_trashbin/share-keys/file1.' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey.d5457864' , 'data');
+ $this->view->file_put_contents($uid . '/files_trashbin/share-keys/folder1.d7437648723/file2.' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey' , 'data');
+
+ $this->view->mkdir($uid . '/files_trashbin/keyfiles');
+ $this->view->mkdir($uid . '/files_trashbin/keyfiles/folder1.d7437648723');
+ $this->view->file_put_contents($uid . '/files_trashbin/keyfiles/file1.key.d5457864' , 'data');
+ $this->view->file_put_contents($uid . '/files_trashbin/keyfiles/folder1.d7437648723/file2.key' , 'data');
+ }
- $rec = \OC_Preferences::getValue('user1', 'files_encryption', 'recovery_enabled');
- $mig = \OC_Preferences::getValue('user1', 'files_encryption', 'migration_status');
+ protected function createDummySystemWideKeys() {
+ $this->view->mkdir('owncloud_private_key');
+ $this->view->file_put_contents('owncloud_private_key/systemwide_1.private.key', 'data');
+ $this->view->file_put_contents('owncloud_private_key/systemwide_2.private.key', 'data');
+ }
+
+ public function testMigrateToNewFolderStructure() {
+
+ // go back to the state before migration
+ $this->view->rename('/files_encryption/public_keys', '/public-keys');
+ $this->view->rename('/public-keys/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.publicKey', '/public-keys/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.public.key');
+ $this->view->rename('/public-keys/' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.publicKey', '/public-keys/' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.public.key');
+ $this->view->rename('/public-keys/' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.publicKey', '/public-keys/' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.public.key');
+ $this->view->deleteAll(self::TEST_ENCRYPTION_MIGRATION_USER1 . '/files_encryption/keys');
+ $this->view->deleteAll(self::TEST_ENCRYPTION_MIGRATION_USER2 . '/files_encryption/keys');
+ $this->view->deleteAll(self::TEST_ENCRYPTION_MIGRATION_USER3 . '/files_encryption/keys');
+ $this->view->rename(self::TEST_ENCRYPTION_MIGRATION_USER1 . '/files_encryption/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.privateKey',
+ self::TEST_ENCRYPTION_MIGRATION_USER1 . '/files_encryption/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.private.key');
+ $this->view->rename(self::TEST_ENCRYPTION_MIGRATION_USER2 . '/files_encryption/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.privateKey',
+ self::TEST_ENCRYPTION_MIGRATION_USER2 . '/files_encryption/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.private.key');
+ $this->view->rename(self::TEST_ENCRYPTION_MIGRATION_USER3 . '/files_encryption/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.privateKey',
+ self::TEST_ENCRYPTION_MIGRATION_USER3 . '/files_encryption/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.private.key');
+
+ $this->createDummyShareKeys(self::TEST_ENCRYPTION_MIGRATION_USER1);
+ $this->createDummyShareKeys(self::TEST_ENCRYPTION_MIGRATION_USER2);
+ $this->createDummyShareKeys(self::TEST_ENCRYPTION_MIGRATION_USER3);
+
+ $this->createDummyFileKeys(self::TEST_ENCRYPTION_MIGRATION_USER1);
+ $this->createDummyFileKeys(self::TEST_ENCRYPTION_MIGRATION_USER2);
+ $this->createDummyFileKeys(self::TEST_ENCRYPTION_MIGRATION_USER3);
+
+ $this->createDummyFilesInTrash(self::TEST_ENCRYPTION_MIGRATION_USER2);
+
+ // no user for system wide mount points
+ $this->createDummyFileKeys('');
+ $this->createDummyShareKeys('');
+
+ $this->createDummySystemWideKeys();
+
+ $m = new \OCA\Files_Encryption\Migration();
+ $m->reorganizeFolderStructure();
+
+ // TODO Verify that all files at the right place
+ $this->assertTrue($this->view->file_exists('/files_encryption/public_keys/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.publicKey'));
+ $this->assertTrue($this->view->file_exists('/files_encryption/public_keys/' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.publicKey'));
+ $this->assertTrue($this->view->file_exists('/files_encryption/public_keys/' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.publicKey'));
+ $this->verifyNewKeyPath(self::TEST_ENCRYPTION_MIGRATION_USER1);
+ $this->verifyNewKeyPath(self::TEST_ENCRYPTION_MIGRATION_USER2);
+ $this->verifyNewKeyPath(self::TEST_ENCRYPTION_MIGRATION_USER3);
+ // system wide keys
+ $this->verifyNewKeyPath('');
+ // trash
+ $this->verifyFilesInTrash(self::TEST_ENCRYPTION_MIGRATION_USER2);
- $this->assertEquals(1, $rec);
- $this->assertEquals(0, $mig);
}
- /**
- * @param string $table
- */
- public function assertTableExist($table) {
- $this->assertTrue(OC_DB::tableExists($table), 'Table ' . $table . ' does not exist');
+ protected function verifyFilesInTrash($uid) {
+ // share keys
+ $this->view->file_exists($uid . '/files_trashbin/keys/file1.d5457864/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey.d5457864' , 'data');
+ $this->view->file_exists($uid . '/files_trashbin/keys/file1.d5457864/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey.d5457864' , 'data');
+ $this->view->file_exists($uid . '/files_trashbin/keys/folder1.d7437648723/file2/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey' , 'data');
+
+ // file keys
+ $this->view->file_exists($uid . '/files_trashbin/keys/file1.d5457864/fileKey.d5457864' , 'data');
+ $this->view->file_exists($uid . '/files_trashbin/keyfiles/file1.d5457864/fileKey.d5457864' , 'data');
+ $this->view->file_exists($uid . '/files_trashbin/keyfiles/folder1.d7437648723/file2/fileKey' , 'data');
}
- /**
- * @param string $table
- */
- public function assertTableNotExist($table) {
- $type=OC_Config::getValue( "dbtype", "sqlite" );
- if( $type == 'sqlite' || $type == 'sqlite3' ) {
- // sqlite removes the tables after closing the DB
- $this->assertTrue(true);
- } else {
- $this->assertFalse(OC_DB::tableExists($table), 'Table ' . $table . ' exists.');
+ protected function verifyNewKeyPath($uid) {
+ // private key
+ if ($uid !== '') {
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/' . $uid . '.privateKey'));
+ }
+ // file keys
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/folder2/folder3/file3/fileKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/folder2/file2/fileKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/file.1/fileKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder2/file.2.1/fileKey'));
+ // share keys
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/folder2/folder3/file3/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/folder2/folder3/file3/' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/folder2/folder3/file3/' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/folder2/file2/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/folder2/file2/' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/folder2/file2/' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/file.1/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/file.1/' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder1/file.1/' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder2/file.2.1/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder2/file.2.1/' . self::TEST_ENCRYPTION_MIGRATION_USER2 . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder2/file.2.1/' . self::TEST_ENCRYPTION_MIGRATION_USER3 . '.shareKey'));
+ if ($this->public_share_key_id) {
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder2/file.2.1/' . $this->public_share_key_id . '.shareKey'));
+ }
+ if ($this->recovery_key_id) {
+ $this->assertTrue($this->view->file_exists($uid . '/files_encryption/keys/folder2/file.2.1/' . $this->recovery_key_id . '.shareKey'));
}
}
-
}
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
index d3e568f8914..d5d9cc7daee 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -20,15 +20,13 @@
*
*/
-require_once __DIR__ . '/util.php';
-
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Proxy
+ * Class Proxy
* this class provide basic proxy app tests
*/
-class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase {
+class Proxy extends TestCase {
const TEST_ENCRYPTION_PROXY_USER1 = "test-proxy-user1";
@@ -44,52 +42,36 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase {
public $filename;
public static function setUpBeforeClass() {
- // reset backend
- \OC_User::clearBackends();
- \OC_User::useBackend('database');
-
- \OC_Hook::clear('OC_Filesystem');
- \OC_Hook::clear('OC_User');
-
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerFilesystemHooks();
-
- // clear and register hooks
- \OC_FileProxy::clearProxies();
- \OC_FileProxy::register(new OCA\Encryption\Proxy());
+ parent::setUpBeforeClass();
// create test user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_PROXY_USER1, true);
}
- function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
// set user id
- \OC_User::setUserId(\Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1);
- $this->userId = \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1;
- $this->pass = \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1;
+ \OC_User::setUserId(self::TEST_ENCRYPTION_PROXY_USER1);
+ $this->userId = self::TEST_ENCRYPTION_PROXY_USER1;
+ $this->pass = self::TEST_ENCRYPTION_PROXY_USER1;
// init filesystem view
- $this->view = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files');
- $this->rootView = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 );
+ $this->view = new \OC\Files\View('/'. self::TEST_ENCRYPTION_PROXY_USER1 . '/files');
+ $this->rootView = new \OC\Files\View('/'. self::TEST_ENCRYPTION_PROXY_USER1 );
// init short data
$this->data = 'hats';
$this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
- $this->filename = 'enc_proxy_tests-' . uniqid() . '.txt';
+ $this->filename = 'enc_proxy_tests-' . $this->getUniqueID() . '.txt';
}
public static function tearDownAfterClass() {
// cleanup test user
- \OC_User::deleteUser(\Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1);
-
- \OC_Hook::clear();
- \OC_FileProxy::clearProxies();
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_PROXY_USER1);
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
+ parent::tearDownAfterClass();
}
/**
@@ -155,13 +137,13 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase {
public function isExcludedPathProvider() {
return array(
- array ('/' . \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files/test.txt', false),
- array (\Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files/test.txt', false),
+ array ('/' . self::TEST_ENCRYPTION_PROXY_USER1 . '/files/test.txt', false),
+ array (self::TEST_ENCRYPTION_PROXY_USER1 . '/files/test.txt', false),
array ('/files/test.txt', true),
- array ('/' . \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files/versions/test.txt', false),
- array ('/' . \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files_versions/test.txt', false),
- array ('/' . \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files_trashbin/test.txt', true),
- array ('/' . \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/file/test.txt', true),
+ array ('/' . self::TEST_ENCRYPTION_PROXY_USER1 . '/files/versions/test.txt', false),
+ array ('/' . self::TEST_ENCRYPTION_PROXY_USER1 . '/files_versions/test.txt', false),
+ array ('/' . self::TEST_ENCRYPTION_PROXY_USER1 . '/files_trashbin/test.txt', true),
+ array ('/' . self::TEST_ENCRYPTION_PROXY_USER1 . '/file/test.txt', true),
);
}
@@ -171,7 +153,7 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase {
/**
* Dummy class to make protected methods available for testing
*/
-class DummyProxy extends \OCA\Encryption\Proxy {
+class DummyProxy extends \OCA\Files_Encryption\Proxy {
public function isExcludedPathTesting($path, $uid) {
return $this->isExcludedPath($path, $uid);
}
diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php
index d7efe21a8fd..d29e6a191c8 100755
--- a/apps/files_encryption/tests/share.php
+++ b/apps/files_encryption/tests/share.php
@@ -20,14 +20,12 @@
*
*/
-require_once __DIR__ . '/util.php';
-
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Share
+ * Class Share
*/
-class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
+class Share extends TestCase {
const TEST_ENCRYPTION_SHARE_USER1 = "test-share-user1";
const TEST_ENCRYPTION_SHARE_USER2 = "test-share-user2";
@@ -39,7 +37,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
public $filename;
public $dataShort;
/**
- * @var OC\Files\View
+ * @var \OC\Files\View
*/
public $view;
public $folder1;
@@ -47,44 +45,33 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
public $subsubfolder;
public static function setUpBeforeClass() {
- // reset backend
- \OC_User::clearBackends();
- \OC_User::useBackend('database');
+ parent::setUpBeforeClass();
// enable resharing
\OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', 'yes');
- // clear share hooks
- \OC_Hook::clear('OCP\\Share');
-
// register share hooks
\OC::registerShareHooks();
\OCA\Files_Sharing\Helper::registerHooks();
- // Sharing related hooks
- \OCA\Encryption\Helper::registerShareHooks();
-
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerFilesystemHooks();
-
// clear and register hooks
- \OC_FileProxy::clearProxies();
- \OC_FileProxy::register(new OCA\Files\Share\Proxy());
- \OC_FileProxy::register(new OCA\Encryption\Proxy());
+ \OC_FileProxy::register(new \OCA\Files\Share\Proxy());
// create users
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1, true);
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, true);
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, true);
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4, true);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2, true);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER3, true);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER4, true);
// create group and assign users
- \OC_Group::createGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
- \OC_Group::addToGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
- \OC_Group::addToGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
+ \OC_Group::createGroup(self::TEST_ENCRYPTION_SHARE_GROUP1);
+ \OC_Group::addToGroup(self::TEST_ENCRYPTION_SHARE_USER3, self::TEST_ENCRYPTION_SHARE_GROUP1);
+ \OC_Group::addToGroup(self::TEST_ENCRYPTION_SHARE_USER4, self::TEST_ENCRYPTION_SHARE_GROUP1);
}
- function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
$this->dataShort = 'hats';
$this->view = new \OC\Files\View('/');
@@ -95,43 +82,124 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$this->filename = 'share-tmp.test';
// remember files_trashbin state
- $this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+ $this->stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we don't want to tests with app files_trashbin enabled
\OC_App::disable('files_trashbin');
// login as first user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
}
- function tearDown() {
+ protected function tearDown() {
// reset app files_trashbin
if ($this->stateFilesTrashbin) {
- OC_App::enable('files_trashbin');
+ \OC_App::enable('files_trashbin');
} else {
- OC_App::disable('files_trashbin');
+ \OC_App::disable('files_trashbin');
}
+
+ parent::tearDown();
}
public static function tearDownAfterClass() {
// clean group
- \OC_Group::deleteGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
+ \OC_Group::deleteGroup(self::TEST_ENCRYPTION_SHARE_GROUP1);
// cleanup users
- \OC_User::deleteUser(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
- \OC_User::deleteUser(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
- \OC_User::deleteUser(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3);
- \OC_User::deleteUser(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4);
-
- \OC_Hook::clear();
- \OC_FileProxy::clearProxies();
-
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_SHARE_USER1);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_SHARE_USER2);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_SHARE_USER3);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_SHARE_USER4);
+
+ parent::tearDownAfterClass();
+ }
+
+ /**
+ * @medium
+ */
+ function testDeclineServer2ServerShare() {
+
+ $config = $this->getMockBuilder('\OCP\IConfig')
+ ->disableOriginalConstructor()->getMock();
+ $certificateManager = $this->getMock('\OCP\ICertificateManager');
+ $httpHelperMock = $this->getMockBuilder('\OC\HTTPHelper')
+ ->setConstructorArgs(array($config, $certificateManager))
+ ->getMock();
+ $httpHelperMock->expects($this->once())->method('post')->with($this->anything())->will($this->returnValue(true));
+
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
+
+ // save file with content
+ $cryptedFile = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
+
+ // test that data was successfully written
+ $this->assertTrue(is_int($cryptedFile));
+
+ // get the file info from previous created file
+ $fileInfo = $this->view->getFileInfo(
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
+
+
+ // share the file
+ $token = \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, '', \OCP\Constants::PERMISSION_ALL);
+ $this->assertTrue(is_string($token));
+
+ $publicShareKeyId = \OC::$server->getConfig()->getAppValue('files_encryption', 'publicShareKeyId');
+
+ // check if share key for public exists
+ $this->assertTrue($this->view->file_exists(
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . $publicShareKeyId . '.shareKey'));
+
+ // manipulate share
+ $query = \OC::$server->getDatabaseConnection()->prepare('UPDATE `*PREFIX*share` SET `share_type` = ?, `share_with` = ? WHERE `token`=?');
+ $this->assertTrue($query->execute(array(\OCP\Share::SHARE_TYPE_REMOTE, 'foo@bar', $token)));
+
+ // check if share key not exists
+ $this->assertTrue($this->view->file_exists(
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . $publicShareKeyId . '.shareKey'));
+
+
+ $query = \OC::$server->getDatabaseConnection()->prepare('SELECT * FROM `*PREFIX*share` WHERE `token`=?');
+ $query->execute(array($token));
+
+ $share = $query->fetch();
+
+ $this->registerHttpHelper($httpHelperMock);
+ $_POST['token'] = $token;
+ $s2s = new \OCA\Files_Sharing\API\Server2Server();
+ $s2s->declineShare(array('id' => $share['id']));
+ $this->restoreHttpHelper();
+
+ $this->assertFalse($this->view->file_exists(
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . $publicShareKeyId . '.shareKey'));
+
+ }
+
+
+ /**
+ * Register an http helper mock for testing purposes.
+ * @param $httpHelper http helper mock
+ */
+ private function registerHttpHelper($httpHelper) {
+ $this->oldHttpHelper = \OC::$server->query('HTTPHelper');
+ \OC::$server->registerService('HTTPHelper', function ($c) use ($httpHelper) {
+ return $httpHelper;
+ });
}
+ /**
+ * Restore the original http helper
+ */
+ private function restoreHttpHelper() {
+ $oldHttpHelper = $this->oldHttpHelper;
+ \OC::$server->registerService('HTTPHelper', function ($c) use ($oldHttpHelper) {
+ return $oldHttpHelper;
+ });
+ }
/**
* @medium
@@ -139,10 +207,10 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
*/
function testShareFile($withTeardown = true) {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// save file with content
- $cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
+ $cryptedFile = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
// test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
@@ -153,7 +221,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// get the file info from previous created file
$fileInfo = $this->view->getFileInfo(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
// check if we have a valid file info
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
@@ -165,22 +233,22 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the file
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// check if share key for user1 exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// login as user1
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2);
// get file contents
$retrievedCryptedFile = $this->view->file_get_contents(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
// check if data is the same as we previously written
$this->assertEquals($this->dataShort, $retrievedCryptedFile);
@@ -189,25 +257,25 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
if ($withTeardown) {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// unshare the file
- \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER2);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// cleanup
- $this->view->chroot('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
+ $this->view->chroot('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
$this->view->unlink($this->filename);
$this->view->chroot('/');
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
}
}
@@ -219,29 +287,29 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$this->testShareFile(false);
// login as user2
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2);
// get the file info
$fileInfo = $this->view->getFileInfo(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
// share the file with user3
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER3, \OCP\Constants::PERMISSION_ALL);
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// check if share key for user2 exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
// login as user2
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER3);
// get file contents
$retrievedCryptedFile = $this->view->file_get_contents(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '/files/' . $this->filename);
// check if data is the same as previously written
$this->assertEquals($this->dataShort, $retrievedCryptedFile);
@@ -250,36 +318,36 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
if ($withTeardown) {
// login as user1
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2);
// unshare the file with user2
- \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3);
+ \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER3);
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
// unshare the file with user1
- \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER2);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// cleanup
- $this->view->chroot('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
+ $this->view->chroot('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
$this->view->unlink($this->filename);
$this->view->chroot('/');
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
}
}
@@ -290,19 +358,19 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
*/
function testShareFolder($withTeardown = true) {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// create folder structure
- $this->view->mkdir('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1);
+ $this->view->mkdir('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1);
$this->view->mkdir(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1 . $this->subfolder);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1 . $this->subfolder);
$this->view->mkdir(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1 . $this->subfolder
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1 . $this->subfolder
. $this->subsubfolder);
// save file with content
- $cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
- . $this->filename, $this->dataShort);
+ $cryptedFile = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
+ . $this->filename, $this->dataShort);
// test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
@@ -313,7 +381,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// get the file info from previous created folder
$fileInfo = $this->view->getFileInfo(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1);
// check if we have a valid file info
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
@@ -322,23 +390,23 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the folder with user1
- \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// check if share key for user1 exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// login as user1
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2);
// get file contents
$retrievedCryptedFile = $this->view->file_get_contents(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/' . $this->filename);
// check if data is the same
@@ -348,27 +416,27 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
if ($withTeardown) {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// unshare the folder with user1
- \OCP\Share::unshare('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ \OCP\Share::unshare('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER2);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys'
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys'
. $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// cleanup
- $this->view->chroot('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files');
+ $this->view->chroot('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files');
$this->view->unlink($this->folder1);
$this->view->chroot('/');
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys'
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys'
. $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
}
return $fileInfo;
@@ -382,7 +450,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$fileInfoFolder1 = $this->testShareFolder(false);
// login as user2
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2);
// disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
@@ -390,7 +458,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// get the file info from previous created folder
$fileInfoSubFolder = $this->view->getFileInfo(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1
. $this->subfolder);
// check if we have a valid file info
@@ -400,23 +468,23 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the file with user3
- \OCP\Share::shareItem('folder', $fileInfoSubFolder['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $fileInfoSubFolder['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER3, \OCP\Constants::PERMISSION_ALL);
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// check if share key for user3 exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
// login as user3
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER3);
// get file contents
$retrievedCryptedFile = $this->view->file_get_contents(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '/files/' . $this->subfolder
+ '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '/files/' . $this->subfolder
. $this->subsubfolder . '/' . $this->filename);
// check if data is the same
@@ -424,30 +492,30 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// get the file info
$fileInfo = $this->view->getFileInfo(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '/files/' . $this->subfolder
+ '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '/files/' . $this->subfolder
. $this->subsubfolder . '/' . $this->filename);
// check if we have fileInfos
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the file with user3
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER4, \OCP\Constants::PERMISSION_ALL);
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// check if share key for user3 exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER4 . '.shareKey'));
// login as user3
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER4);
// get file contents
$retrievedCryptedFile = $this->view->file_get_contents(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER4 . '/files/' . $this->filename);
// check if data is the same
$this->assertEquals($this->dataShort, $retrievedCryptedFile);
@@ -456,61 +524,61 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
if ($withTeardown) {
// login as user2
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER3);
// unshare the file with user3
- \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4);
+ \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER4);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys'
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys'
. $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER4 . '.shareKey'));
// login as user1
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2);
// unshare the folder with user2
- \OCP\Share::unshare('folder', $fileInfoSubFolder['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3);
+ \OCP\Share::unshare('folder', $fileInfoSubFolder['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER3);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys'
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys'
. $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// unshare the folder1 with user1
- \OCP\Share::unshare('folder', $fileInfoFolder1['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ \OCP\Share::unshare('folder', $fileInfoFolder1['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER2);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys'
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys'
. $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// cleanup
- $this->view->chroot('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files');
+ $this->view->chroot('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files');
$this->view->unlink($this->folder1 . $this->subfolder . $this->subsubfolder . '/' . $this->filename);
$this->view->chroot('/');
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys'
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys'
. $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
}
}
function testPublicShareFile() {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// save file with content
- $cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
+ $cryptedFile = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
// test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
@@ -521,7 +589,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// get the file info from previous created file
$fileInfo = $this->view->getFileInfo(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
// check if we have a valid file info
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
@@ -533,25 +601,25 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the file
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, false, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, false, \OCP\Constants::PERMISSION_ALL);
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
$publicShareKeyId = \OC::$server->getAppConfig()->getValue('files_encryption', 'publicShareKeyId');
// check if share key for public exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . $publicShareKeyId . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . $publicShareKeyId . '.shareKey'));
// some hacking to simulate public link
//$GLOBALS['app'] = 'files_sharing';
- //$GLOBALS['fileOwner'] = \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1;
- \Test_Encryption_Util::logoutHelper();
+ //$GLOBALS['fileOwner'] = self::TEST_ENCRYPTION_SHARE_USER1;
+ self::logoutHelper();
// get file contents
- $retrievedCryptedFile = file_get_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
+ $retrievedCryptedFile = file_get_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
// check if data is the same as we previously written
$this->assertEquals($this->dataShort, $retrievedCryptedFile);
@@ -559,25 +627,25 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// tear down
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// unshare the file
\OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, null);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . $publicShareKeyId . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . $publicShareKeyId . '.shareKey'));
// cleanup
- $this->view->chroot('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
+ $this->view->chroot('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
$this->view->unlink($this->filename);
$this->view->chroot('/');
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
}
/**
@@ -585,10 +653,10 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
*/
function testShareFileWithGroup() {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// save file with content
- $cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
+ $cryptedFile = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
// test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
@@ -599,7 +667,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// get the file info from previous created file
$fileInfo = $this->view->getFileInfo(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
// check if we have a valid file info
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
@@ -611,52 +679,52 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the file
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, self::TEST_ENCRYPTION_SHARE_GROUP1, \OCP\Constants::PERMISSION_ALL);
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// check if share key for user2 and user3 exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER4 . '.shareKey'));
// login as user1
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER3);
// get file contents
$retrievedCryptedFile = $this->view->file_get_contents(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '/files/' . $this->filename);
// check if data is the same as we previously written
$this->assertEquals($this->dataShort, $retrievedCryptedFile);
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// unshare the file
- \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
+ \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, self::TEST_ENCRYPTION_SHARE_GROUP1);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER4 . '.shareKey'));
// cleanup
- $this->view->chroot('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
+ $this->view->chroot('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
$this->view->unlink($this->filename);
$this->view->chroot('/');
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
}
@@ -666,15 +734,15 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
function testRecoveryFile() {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
- \OCA\Encryption\Helper::adminEnableRecovery(null, 'test123');
+ \OCA\Files_Encryption\Helper::adminEnableRecovery(null, 'test123');
$recoveryKeyId = \OC::$server->getAppConfig()->getValue('files_encryption', 'recoveryKeyId');
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
- $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ $util = new \OCA\Files_Encryption\Util(new \OC\Files\View('/'), self::TEST_ENCRYPTION_SHARE_USER1);
// check if recovery password match
$this->assertTrue($util->checkRecoveryPassword('test123'));
@@ -684,17 +752,17 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$util->addRecoveryKeys();
// create folder structure
- $this->view->mkdir('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1);
+ $this->view->mkdir('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1);
$this->view->mkdir(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1 . $this->subfolder);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1 . $this->subfolder);
$this->view->mkdir(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1 . $this->subfolder
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files' . $this->folder1 . $this->subfolder
. $this->subsubfolder);
// save file with content
- $cryptedFile1 = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
- $cryptedFile2 = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
- . $this->filename, $this->dataShort);
+ $cryptedFile1 = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
+ $cryptedFile2 = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
+ . $this->filename, $this->dataShort);
// test that data was successfully written
$this->assertTrue(is_int($cryptedFile1));
@@ -702,19 +770,19 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// check if share key for admin and recovery exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
// disable recovery for admin
$this->assertTrue($util->setRecoveryForUser(0));
@@ -724,12 +792,12 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// check if share key for recovery not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
// enable recovery for admin
$this->assertTrue($util->setRecoveryForUser(1));
@@ -739,30 +807,30 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// check if share key for admin and recovery exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
// cleanup
- $this->view->chroot('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
+ $this->view->chroot('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
$this->view->unlink($this->filename);
$this->view->unlink($this->folder1);
$this->view->chroot('/');
// check if share key for recovery not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
- $this->assertTrue(\OCA\Encryption\Helper::adminEnableRecovery(null, 'test123'));
- $this->assertTrue(\OCA\Encryption\Helper::adminDisableRecovery('test123'));
+ $this->assertTrue(\OCA\Files_Encryption\Helper::adminEnableRecovery(null, 'test123'));
+ $this->assertTrue(\OCA\Files_Encryption\Helper::adminDisableRecovery('test123'));
$this->assertEquals(0, \OC::$server->getAppConfig()->getValue('files_encryption', 'recoveryAdminEnabled'));
}
@@ -772,17 +840,17 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
function testRecoveryForUser() {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
- $result = \OCA\Encryption\Helper::adminEnableRecovery(null, 'test123');
+ $result = \OCA\Files_Encryption\Helper::adminEnableRecovery(null, 'test123');
$this->assertTrue($result);
$recoveryKeyId = \OC::$server->getAppConfig()->getValue('files_encryption', 'recoveryKeyId');
// login as user2
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2);
- $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ $util = new \OCA\Files_Encryption\Util(new \OC\Files\View('/'), self::TEST_ENCRYPTION_SHARE_USER2);
// enable recovery for admin
$this->assertTrue($util->setRecoveryForUser(1));
@@ -791,17 +859,17 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$util->addRecoveryKeys();
// create folder structure
- $this->view->mkdir('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1);
+ $this->view->mkdir('/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1);
$this->view->mkdir(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1 . $this->subfolder);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1 . $this->subfolder);
$this->view->mkdir(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1 . $this->subfolder
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1 . $this->subfolder
. $this->subsubfolder);
// save file with content
- $cryptedFile1 = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2. '/files/' . $this->filename, $this->dataShort);
- $cryptedFile2 = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
- . $this->filename, $this->dataShort);
+ $cryptedFile1 = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER2. '/files/' . $this->filename, $this->dataShort);
+ $cryptedFile2 = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
+ . $this->filename, $this->dataShort);
// test that data was successfully written
$this->assertTrue(is_int($cryptedFile1));
@@ -809,76 +877,76 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// check if share key for user and recovery exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/share-keys/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/keys/'
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/share-keys/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/keys/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/share-keys/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/keys/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// change password
- \OC_User::setPassword(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, 'test', 'test123');
- $params = array('uid' => \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2,
+ \OC_User::setPassword(self::TEST_ENCRYPTION_SHARE_USER2, 'test', 'test123');
+ $params = array('uid' => self::TEST_ENCRYPTION_SHARE_USER2,
'password' => 'test',
'recoveryPassword' => 'test123');
- \OCA\Encryption\Hooks::setPassphrase($params);
+ \OCA\Files_Encryption\Hooks::setPassphrase($params);
// login as user2
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, false, 'test');
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2, false, 'test');
// get file contents
- $retrievedCryptedFile1 = file_get_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
+ $retrievedCryptedFile1 = file_get_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
$retrievedCryptedFile2 = file_get_contents(
- 'crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/' . $this->filename);
+ 'crypt:///' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/' . $this->filename);
// check if data is the same as we previously written
$this->assertEquals($this->dataShort, $retrievedCryptedFile1);
$this->assertEquals($this->dataShort, $retrievedCryptedFile2);
// cleanup
- $this->view->chroot('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/');
+ $this->view->chroot('/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/');
$this->view->unlink($this->folder1);
$this->view->unlink($this->filename);
$this->view->chroot('/');
// check if share key for user and recovery exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/share-keys/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/keys/'
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/share-keys/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/keys/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/share-keys/' . $this->folder1
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files_encryption/keys/' . $this->folder1
. $this->subfolder . $this->subsubfolder . '/'
- . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+ . $this->filename . '/' . $recoveryKeyId . '.shareKey'));
// enable recovery for admin
$this->assertTrue($util->setRecoveryForUser(0));
- \OCA\Encryption\Helper::adminDisableRecovery('test123');
+ \OCA\Files_Encryption\Helper::adminDisableRecovery('test123');
$this->assertEquals(0, \OC::$server->getAppConfig()->getValue('files_encryption', 'recoveryAdminEnabled'));
//clean up, reset passwords
- \OC_User::setPassword(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, 'test123');
- $params = array('uid' => \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2,
- 'password' => \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2,
+ \OC_User::setPassword(self::TEST_ENCRYPTION_SHARE_USER2, self::TEST_ENCRYPTION_SHARE_USER2, 'test123');
+ $params = array('uid' => self::TEST_ENCRYPTION_SHARE_USER2,
+ 'password' => self::TEST_ENCRYPTION_SHARE_USER2,
'recoveryPassword' => 'test123');
- \OCA\Encryption\Hooks::setPassphrase($params);
+ \OCA\Files_Encryption\Hooks::setPassphrase($params);
}
/**
@@ -886,10 +954,10 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
*/
function testFailShareFile() {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// save file with content
- $cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
+ $cryptedFile = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
// test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
@@ -900,7 +968,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// get the file info from previous created file
$fileInfo = $this->view->getFileInfo(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
// check if we have a valid file info
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
@@ -909,27 +977,27 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$this->assertGreaterThan(0, $fileInfo['unencrypted_size']);
// break users public key
- $this->view->rename('/public-keys/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.public.key',
- '/public-keys/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.public.key_backup');
+ $this->view->rename(\OCA\Files_Encryption\Keymanager::getPublicKeyPath() . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.publicKey',
+ \OCA\Files_Encryption\Keymanager::getPublicKeyPath() . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.publicKey_backup');
// re-enable the file proxy
\OC_FileProxy::$enabled = $proxyStatus;
// share the file
try {
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1, OCP\PERMISSION_ALL);
- } catch (Exception $e) {
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, self::TEST_ENCRYPTION_SHARE_GROUP1, \OCP\Constants::PERMISSION_ALL);
+ } catch (\Exception $e) {
$this->assertEquals(0, strpos($e->getMessage(), "Following users are not set up for encryption"));
}
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// check if share key for user1 not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
// disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
@@ -937,27 +1005,27 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// break user1 public key
$this->view->rename(
- '/public-keys/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.public.key_backup',
- '/public-keys/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.public.key');
+ \OCA\Files_Encryption\Keymanager::getPublicKeyPath() . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.publicKey_backup',
+ \OCA\Files_Encryption\Keymanager::getPublicKeyPath() . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.publicKey');
// remove share file
- $this->view->unlink('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3
- . '.shareKey');
+ $this->view->unlink('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER3
+ . '.shareKey');
// re-enable the file proxy
\OC_FileProxy::$enabled = $proxyStatus;
// unshare the file with user1
- \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
+ \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, self::TEST_ENCRYPTION_SHARE_GROUP1);
// check if share key not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER3 . '.shareKey'));
// cleanup
- $this->view->chroot('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
+ $this->view->chroot('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/');
$this->view->unlink($this->filename);
$this->view->chroot('/');
}
@@ -969,56 +1037,56 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
function testRename() {
// login as admin
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// save file with content
- $cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
+ $cryptedFile = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
// test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
// get the file info from previous created file
$fileInfo = $this->view->getFileInfo(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
// check if we have a valid file info
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the file
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
// check if share key for user2 exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files_encryption/keys/'
+ . $this->filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// login as user2
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2);
- $this->assertTrue($this->view->file_exists('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename));
+ $this->assertTrue($this->view->file_exists('/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename));
// get file contents
$retrievedCryptedFile = $this->view->file_get_contents(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
// check if data is the same as we previously written
$this->assertEquals($this->dataShort, $retrievedCryptedFile);
// move the file to a subfolder
- $this->view->rename('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename,
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1 . $this->filename);
+ $this->view->rename('/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename,
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1 . $this->filename);
// check if we can read the moved file
$retrievedRenamedFile = $this->view->file_get_contents(
- '/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1 . $this->filename);
+ '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1 . $this->filename);
// check if data is the same as we previously written
$this->assertEquals($this->dataShort, $retrievedRenamedFile);
// cleanup
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
- $this->view->unlink('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
+ $this->view->unlink('/' . self::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
}
/**
@@ -1027,10 +1095,10 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
*/
function testMoveFolder() {
- $view = new \OC\Files\View('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ $view = new \OC\Files\View('/' . self::TEST_ENCRYPTION_SHARE_USER1);
- $filename = '/tmp-' . uniqid();
- $folder = '/folder' . uniqid();
+ $filename = '/tmp-' . $this->getUniqueID();
+ $folder = '/folder' . $this->getUniqueID();
\OC\Files\Filesystem::mkdir($folder);
@@ -1045,7 +1113,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataShort, $decrypt);
- $newFolder = '/newfolder/subfolder' . uniqid();
+ $newFolder = '/newfolder/subfolder' . $this->getUniqueID();
\OC\Files\Filesystem::mkdir('/newfolder');
// get the file info from previous created file
@@ -1053,7 +1121,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the folder
- \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
\OC\Files\Filesystem::rename($folder, $newFolder);
@@ -1062,10 +1130,10 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataShort, $newDecrypt);
// check if additional share key for user2 exists
- $this->assertTrue($view->file_exists('files_encryption/share-keys' . $newFolder . '/' . $filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ $this->assertTrue($view->file_exists('files_encryption/keys' . $newFolder . '/' . $filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// check that old keys were removed/moved properly
- $this->assertFalse($view->file_exists('files_encryption/share-keys' . $folder . '/' . $filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ $this->assertFalse($view->file_exists('files_encryption/keys' . $folder . '/' . $filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// tear down
\OC\Files\Filesystem::unlink($newFolder);
@@ -1075,9 +1143,9 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
function usersProvider() {
return array(
// test as owner
- array(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1),
+ array(self::TEST_ENCRYPTION_SHARE_USER1),
// test as share receiver
- array(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2),
+ array(self::TEST_ENCRYPTION_SHARE_USER2),
);
}
@@ -1085,10 +1153,10 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
* @dataProvider usersProvider
*/
function testMoveFileToFolder($userId) {
- $view = new \OC\Files\View('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ $view = new \OC\Files\View('/' . self::TEST_ENCRYPTION_SHARE_USER1);
- $filename = '/tmp-' . uniqid();
- $folder = '/folder' . uniqid();
+ $filename = '/tmp-' . $this->getUniqueID();
+ $folder = '/folder' . $this->getUniqueID();
\OC\Files\Filesystem::mkdir($folder);
@@ -1103,7 +1171,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataShort, $decrypt);
- $subFolder = $folder . '/subfolder' . uniqid();
+ $subFolder = $folder . '/subfolder' . $this->getUniqueID();
\OC\Files\Filesystem::mkdir($subFolder);
// get the file info from previous created file
@@ -1111,32 +1179,32 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the folder
- \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
// check that the share keys exist
- $this->assertTrue($view->file_exists('files_encryption/share-keys' . $folder . '/' . $filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
- $this->assertTrue($view->file_exists('files_encryption/share-keys' . $folder . '/' . $filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ $this->assertTrue($view->file_exists('files_encryption/keys' . $folder . '/' . $filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ $this->assertTrue($view->file_exists('files_encryption/keys' . $folder . '/' . $filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// move the file into the subfolder as the test user
- \Test_Encryption_Util::loginHelper($userId);
+ self::loginHelper($userId);
\OC\Files\Filesystem::rename($folder . $filename, $subFolder . $filename);
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1);
// Get file decrypted contents
$newDecrypt = \OC\Files\Filesystem::file_get_contents($subFolder . $filename);
$this->assertEquals($this->dataShort, $newDecrypt);
// check if additional share key for user2 exists
- $this->assertTrue($view->file_exists('files_encryption/share-keys' . $subFolder . '/' . $filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
- $this->assertTrue($view->file_exists('files_encryption/share-keys' . $subFolder . '/' . $filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ $this->assertTrue($view->file_exists('files_encryption/keys' . $subFolder . '/' . $filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ $this->assertTrue($view->file_exists('files_encryption/keys' . $subFolder . '/' . $filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// check that old keys were removed/moved properly
- $this->assertFalse($view->file_exists('files_encryption/share-keys' . $folder . '/' . $filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
- $this->assertFalse($view->file_exists('files_encryption/share-keys' . $folder . '/' . $filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
+ $this->assertFalse($view->file_exists('files_encryption/keys' . $folder . '/' . $filename . '/' . self::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
+ $this->assertFalse($view->file_exists('files_encryption/keys' . $folder . '/' . $filename . '/' . self::TEST_ENCRYPTION_SHARE_USER2 . '.shareKey'));
// tear down
\OC\Files\Filesystem::unlink($subFolder);
\OC\Files\Filesystem::unlink($folder);
}
-}
+} \ No newline at end of file
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index 2b57f11c680..8295ddd9523 100644
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -20,15 +20,13 @@
*
*/
-require_once __DIR__ . '/util.php';
-
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Stream
+ * Class Stream
* this class provide basic stream tests
*/
-class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
+class Stream extends TestCase {
const TEST_ENCRYPTION_STREAM_USER1 = "test-stream-user1";
@@ -42,26 +40,19 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
public $stateFilesTrashbin;
public static function setUpBeforeClass() {
- // reset backend
- \OC_User::clearBackends();
- \OC_User::useBackend('database');
-
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerFilesystemHooks();
-
- // clear and register hooks
- \OC_FileProxy::clearProxies();
- \OC_FileProxy::register(new OCA\Encryption\Proxy());
+ parent::setUpBeforeClass();
// create test user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_STREAM_USER1, true);
}
- function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
// set user id
- \OC_User::setUserId(\Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1);
- $this->userId = \Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1;
- $this->pass = \Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1;
+ \OC_User::setUserId(self::TEST_ENCRYPTION_STREAM_USER1);
+ $this->userId = self::TEST_ENCRYPTION_STREAM_USER1;
+ $this->pass = self::TEST_ENCRYPTION_STREAM_USER1;
// init filesystem view
$this->view = new \OC\Files\View('/');
@@ -70,37 +61,33 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
$this->dataShort = 'hats';
// remember files_trashbin state
- $this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+ $this->stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we don't want to tests with app files_trashbin enabled
\OC_App::disable('files_trashbin');
}
- function tearDown() {
+ protected function tearDown() {
// reset app files_trashbin
if ($this->stateFilesTrashbin) {
- OC_App::enable('files_trashbin');
+ \OC_App::enable('files_trashbin');
}
else {
- OC_App::disable('files_trashbin');
+ \OC_App::disable('files_trashbin');
}
+
+ parent::tearDown();
}
public static function tearDownAfterClass() {
// cleanup test user
- \OC_User::deleteUser(\Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1);
-
- \OC_Hook::clear();
- \OC_FileProxy::clearProxies();
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_STREAM_USER1);
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
+ parent::tearDownAfterClass();
}
function testStreamOptions() {
- $filename = '/tmp-' . uniqid();
+ $filename = '/tmp-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
// Save short data as encrypted file using stream wrapper
@@ -118,12 +105,14 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
$this->assertTrue(flock($handle, LOCK_SH));
$this->assertTrue(flock($handle, LOCK_UN));
+ fclose($handle);
+
// tear down
$view->unlink($filename);
}
function testStreamSetBlocking() {
- $filename = '/tmp-' . uniqid();
+ $filename = '/tmp-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
// Save short data as encrypted file using stream wrapper
@@ -134,6 +123,13 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
$handle = $view->fopen($filename, 'r');
+
+ if (\OC_Util::runningOnWindows()) {
+ fclose($handle);
+ $view->unlink($filename);
+ $this->markTestSkipped('[Windows] stream_set_blocking() does not work as expected on Windows.');
+ }
+
// set stream options
$this->assertTrue(stream_set_blocking($handle, 1));
@@ -147,7 +143,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
* @medium
*/
function testStreamSetTimeout() {
- $filename = '/tmp-' . uniqid();
+ $filename = '/tmp-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
// Save short data as encrypted file using stream wrapper
@@ -168,7 +164,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
}
function testStreamSetWriteBuffer() {
- $filename = '/tmp-' . uniqid();
+ $filename = '/tmp-' . $this->getUniqueID();
$view = new \OC\Files\View('/' . $this->userId . '/files');
// Save short data as encrypted file using stream wrapper
@@ -194,9 +190,9 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
*/
function testStreamFromLocalFile() {
- $filename = '/' . $this->userId . '/files/' . 'tmp-' . uniqid().'.txt';
+ $filename = '/' . $this->userId . '/files/' . 'tmp-' . $this->getUniqueID().'.txt';
- $tmpFilename = "/tmp/" . uniqid() . ".txt";
+ $tmpFilename = "/tmp/" . $this->getUniqueID() . ".txt";
// write an encrypted file
$cryptedFile = $this->view->file_put_contents($filename, $this->dataShort);
@@ -212,7 +208,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
file_put_contents($tmpFilename, $encryptedContent);
- \OCA\Encryption\Helper::addTmpFileToMapper($tmpFilename, $filename);
+ \OCA\Files_Encryption\Helper::addTmpFileToMapper($tmpFilename, $filename);
// try to read the file from /tmp
$handle = fopen("crypt://".$tmpFilename, "r");
@@ -221,6 +217,8 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
// check if it was successful
$this->assertEquals($this->dataShort, $contentFromTmpFile);
+ fclose($handle);
+
// clean up
unlink($tmpFilename);
$this->view->unlink($filename);
diff --git a/apps/files_encryption/tests/testcase.php b/apps/files_encryption/tests/testcase.php
new file mode 100644
index 00000000000..c2e5f4de8c1
--- /dev/null
+++ b/apps/files_encryption/tests/testcase.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Copyright (c) 2012 Sam Tuke <samtuke@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCA\Files_Encryption\Tests;
+
+/**
+ * Class TestCase
+ */
+abstract class TestCase extends \Test\TestCase {
+
+ /**
+ * @param string $user
+ * @param bool $create
+ * @param bool $password
+ */
+ public static function loginHelper($user, $create = false, $password = false, $loadEncryption = true) {
+ if ($create) {
+ try {
+ \OC_User::createUser($user, $user);
+ } catch (\Exception $e) {
+ // catch username is already being used from previous aborted runs
+ }
+ }
+
+ if ($password === false) {
+ $password = $user;
+ }
+
+ \OC_Util::tearDownFS();
+ \OC_User::setUserId('');
+ \OC\Files\Filesystem::tearDown();
+ \OC_User::setUserId($user);
+ \OC_Util::setupFS($user);
+
+ if ($loadEncryption) {
+ $params['uid'] = $user;
+ $params['password'] = $password;
+ \OCA\Files_Encryption\Hooks::login($params);
+ }
+ }
+
+ public static function logoutHelper() {
+ \OC_Util::tearDownFS();
+ \OC_User::setUserId(false);
+ \OC\Files\Filesystem::tearDown();
+ }
+
+ public static function setUpBeforeClass() {
+ parent::setUpBeforeClass();
+
+ // reset backend
+ \OC_User::clearBackends();
+ \OC_User::useBackend('database');
+
+ \OCA\Files_Encryption\Helper::registerFilesystemHooks();
+ \OCA\Files_Encryption\Helper::registerUserHooks();
+ \OCA\Files_Encryption\Helper::registerShareHooks();
+
+ \OC::registerShareHooks();
+ \OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Shared', 'setup');
+
+ // clear and register hooks
+ \OC_FileProxy::clearProxies();
+ \OC_FileProxy::register(new \OCA\Files_Encryption\Proxy());
+ }
+
+ public static function tearDownAfterClass() {
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->deleteAll('files_encryption');
+
+ parent::tearDownAfterClass();
+ }
+
+ protected function tearDown() {
+ parent::tearDown();
+ $this->resetKeyCache();
+ }
+
+ protected function resetKeyCache() {
+ // reset key cache for every testrun
+ $keyCache = new \ReflectionProperty('\OCA\Files_Encryption\Keymanager', 'key_cache');
+ $keyCache->setAccessible(true);
+ $keyCache->setValue(array());
+ $keyCache->setAccessible(false);
+ }
+
+}
diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php
index d795240399c..d924b8ac77a 100755
--- a/apps/files_encryption/tests/trashbin.php
+++ b/apps/files_encryption/tests/trashbin.php
@@ -20,15 +20,13 @@
*
*/
-require_once __DIR__ . '/util.php';
-
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Trashbin
+ * Class Trashbin
* this class provide basic trashbin app tests
*/
-class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
+class Trashbin extends TestCase {
const TEST_ENCRYPTION_TRASHBIN_USER1 = "test-trashbin-user1";
@@ -45,32 +43,22 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
public $subsubfolder;
public static function setUpBeforeClass() {
- // reset backend
- \OC_User::clearBackends();
- \OC_User::useBackend('database');
-
- \OC_Hook::clear('OC_Filesystem');
- \OC_Hook::clear('OC_User');
+ parent::setUpBeforeClass();
// trashbin hooks
\OCA\Files_Trashbin\Trashbin::registerHooks();
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerFilesystemHooks();
-
- // clear and register hooks
- \OC_FileProxy::clearProxies();
- \OC_FileProxy::register(new OCA\Encryption\Proxy());
-
// create test user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_TRASHBIN_USER1, true);
}
- function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
// set user id
- \OC_User::setUserId(\Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1);
- $this->userId = \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1;
- $this->pass = \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1;
+ \OC_User::setUserId(self::TEST_ENCRYPTION_TRASHBIN_USER1);
+ $this->userId = self::TEST_ENCRYPTION_TRASHBIN_USER1;
+ $this->pass = self::TEST_ENCRYPTION_TRASHBIN_USER1;
// init filesystem view
$this->view = new \OC\Files\View('/');
@@ -83,33 +71,29 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
$this->subsubfolder = '/subsubfolder1';
// remember files_trashbin state
- $this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+ $this->stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we want to tests with app files_trashbin enabled
\OC_App::enable('files_trashbin');
}
- function tearDown() {
+ protected function tearDown() {
// reset app files_trashbin
if ($this->stateFilesTrashbin) {
- OC_App::enable('files_trashbin');
+ \OC_App::enable('files_trashbin');
}
else {
- OC_App::disable('files_trashbin');
+ \OC_App::disable('files_trashbin');
}
+
+ parent::tearDown();
}
public static function tearDownAfterClass() {
// cleanup test user
- \OC_User::deleteUser(\Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_TRASHBIN_USER1);
- \OC_Hook::clear();
- \OC_FileProxy::clearProxies();
-
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
+ parent::tearDownAfterClass();
}
/**
@@ -119,12 +103,12 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
function testDeleteFile() {
// generate filename
- $filename = 'tmp-' . uniqid() . '.txt';
+ $filename = 'tmp-' . $this->getUniqueID() . '.txt';
$filename2 = $filename . '.backup'; // a second file with similar name
// save file with content
- $cryptedFile = file_put_contents('crypt:///' .\Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1. '/files/'. $filename, $this->dataShort);
- $cryptedFile2 = file_put_contents('crypt:///' .\Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1. '/files/'. $filename2, $this->dataShort);
+ $cryptedFile = file_put_contents('crypt:///' .self::TEST_ENCRYPTION_TRASHBIN_USER1. '/files/'. $filename, $this->dataShort);
+ $cryptedFile2 = file_put_contents('crypt:///' .self::TEST_ENCRYPTION_TRASHBIN_USER1. '/files/'. $filename2, $this->dataShort);
// test that data was successfully written
$this->assertTrue(is_int($cryptedFile));
@@ -132,59 +116,55 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
// check if key for admin exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keyfiles/' . $filename
- . '.key'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/' . $filename . '/fileKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keyfiles/' . $filename2
- . '.key'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/' . $filename2 . '/fileKey'));
// check if share key for admin exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/share-keys/'
- . $filename . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/share-keys/'
- . $filename2 . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/'
+ . $filename2 . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
// delete first file
- \OC\FIles\Filesystem::unlink($filename);
+ \OC\Files\Filesystem::unlink($filename);
// check if file not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename));
// check if key for admin not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keyfiles/' . $filename
- . '.key'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/' . $filename . '/fileKey'));
// check if share key for admin not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/share-keys/'
- . $filename . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
// check that second file still exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename2));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename2));
// check that key for second file still exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keyfiles/' . $filename2
- . '.key'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/' . $filename2 . '/fileKey'));
// check that share key for second file still exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/share-keys/'
- . $filename2 . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/'
+ . $filename2 . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
// get files
$trashFiles = $this->view->getDirectoryContent(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/files/');
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/files/');
$trashFileSuffix = null;
// find created file with timestamp
foreach ($trashFiles as $file) {
- if (strncmp($file['path'], $filename, strlen($filename))) {
+ if (strpos($file['path'], $filename . '.d') !== false) {
$path_parts = pathinfo($file['name']);
$trashFileSuffix = $path_parts['extension'];
}
@@ -193,15 +173,16 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
// check if we found the file we created
$this->assertNotNull($trashFileSuffix);
+ $this->assertTrue($this->view->is_dir('/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keys/' . $filename . '.' . $trashFileSuffix));
+
// check if key for admin not exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keyfiles/' . $filename
- . '.key.' . $trashFileSuffix));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keys/' . $filename . '.' . $trashFileSuffix . '/fileKey'));
// check if share key for admin not exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/share-keys/' . $filename
- . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey.' . $trashFileSuffix));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keys/' . $filename
+ . '.' . $trashFileSuffix . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
}
/**
@@ -210,67 +191,67 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
*/
function testRestoreFile() {
// generate filename
- $filename = 'tmp-' . uniqid() . '.txt';
+ $filename = 'tmp-' . $this->getUniqueID() . '.txt';
$filename2 = $filename . '.backup'; // a second file with similar name
// save file with content
- $cryptedFile = file_put_contents('crypt:///' .\Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1. '/files/'. $filename, $this->dataShort);
- $cryptedFile2 = file_put_contents('crypt:///' .\Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1. '/files/'. $filename2, $this->dataShort);
+ $cryptedFile = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_TRASHBIN_USER1. '/files/'. $filename, $this->dataShort);
+ $cryptedFile2 = file_put_contents('crypt:///' . self::TEST_ENCRYPTION_TRASHBIN_USER1. '/files/'. $filename2, $this->dataShort);
// delete both files
\OC\Files\Filesystem::unlink($filename);
\OC\Files\Filesystem::unlink($filename2);
- $trashFiles = $this->view->getDirectoryContent(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/files/');
+ $trashFiles = $this->view->getDirectoryContent('/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/files/');
$trashFileSuffix = null;
$trashFileSuffix2 = null;
// find created file with timestamp
foreach ($trashFiles as $file) {
- if (strncmp($file['path'], $filename, strlen($filename))) {
+ if (strpos($file['path'], $filename . '.d') !== false) {
$path_parts = pathinfo($file['name']);
$trashFileSuffix = $path_parts['extension'];
}
- if (strncmp($file['path'], $filename2, strlen($filename2))) {
- $path_parts = pathinfo($file['name']);
- $trashFileSuffix2 = $path_parts['extension'];
- }
}
// prepare file information
$timestamp = str_replace('d', '', $trashFileSuffix);
+ // before calling the restore operation the keys shouldn't be there
+ $this->assertFalse($this->view->file_exists(
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/' . $filename . '/fileKey'));
+ $this->assertFalse($this->view->file_exists(
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
+
// restore first file
$this->assertTrue(\OCA\Files_Trashbin\Trashbin::restore($filename . '.' . $trashFileSuffix, $filename, $timestamp));
// check if file exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename));
// check if key for admin exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keyfiles/'
- . $filename . '.key'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/' . $filename . '/fileKey'));
// check if share key for admin exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/share-keys/'
- . $filename . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
// check that second file was NOT restored
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename2));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename2));
// check if key for admin exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keyfiles/'
- . $filename2 . '.key'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/' . $filename2 . '/fileKey'));
// check if share key for admin exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/share-keys/'
- . $filename2 . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/'
+ . $filename2 . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
}
/**
@@ -280,7 +261,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
function testPermanentDeleteFile() {
// generate filename
- $filename = 'tmp-' . uniqid() . '.txt';
+ $filename = 'tmp-' . $this->getUniqueID() . '.txt';
// save file with content
$cryptedFile = file_put_contents('crypt:///' .$this->userId. '/files/' . $filename, $this->dataShort);
@@ -290,30 +271,29 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
// check if key for admin exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keyfiles/' . $filename
- . '.key'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/' . $filename . '/fileKey'));
// check if share key for admin exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/share-keys/'
- . $filename . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
// delete file
\OC\Files\Filesystem::unlink($filename);
// check if file not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files/' . $filename));
// check if key for admin not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keyfiles/' . $filename
- . '.key'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/' . $filename . '/'
+ . $filename . '.key'));
// check if share key for admin not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/share-keys/'
- . $filename . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_encryption/keys/'
+ . $filename . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
// find created file with timestamp
$query = \OC_DB::prepare('SELECT `timestamp`,`type` FROM `*PREFIX*files_trash`'
@@ -327,13 +307,13 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
// check if key for admin exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keyfiles/' . $filename
- . '.key.' . $trashFileSuffix));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keys/' . $filename
+ . '.' . $trashFileSuffix . '/fileKey'));
// check if share key for admin exists
$this->assertTrue($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/share-keys/' . $filename
- . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey.' . $trashFileSuffix));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keys/'
+ . $filename . '.' . $trashFileSuffix . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
// get timestamp from file
$timestamp = str_replace('d', '', $trashFileSuffix);
@@ -343,18 +323,18 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
// check if key for admin not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/files/' . $filename . '.'
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/files/' . $filename . '.'
. $trashFileSuffix));
// check if key for admin not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keyfiles/' . $filename
- . '.key.' . $trashFileSuffix));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keys/' . $filename
+ . '.' . $trashFileSuffix . '/fileKey'));
// check if share key for admin not exists
$this->assertFalse($this->view->file_exists(
- '/' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/share-keys/' . $filename
- . '.' . \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey.' . $trashFileSuffix));
+ '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '/files_trashbin/keys/' . $filename
+ . '.' . $trashFileSuffix . '/' . self::TEST_ENCRYPTION_TRASHBIN_USER1 . '.shareKey'));
}
}
diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php
index 210ffcc5410..c75f406cb61 100755
--- a/apps/files_encryption/tests/util.php
+++ b/apps/files_encryption/tests/util.php
@@ -6,12 +6,12 @@
* See the COPYING-README file.
*/
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Util
+ * Class Util
*/
-class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
+class Util extends TestCase {
const TEST_ENCRYPTION_UTIL_USER1 = "test-util-user1";
const TEST_ENCRYPTION_UTIL_USER2 = "test-util-user2";
@@ -24,14 +24,14 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
public $publicKeyDir;
public $pass;
/**
- * @var OC\Files\View
+ * @var \OC\Files\View
*/
public $view;
public $keyfilesPath;
public $publicKeyPath;
public $privateKeyPath;
/**
- * @var \OCA\Encryption\Util
+ * @var \OCA\Files_Encryption\Util
*/
public $util;
public $dataShort;
@@ -41,16 +41,12 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
public $stateFilesTrashbin;
public static function setUpBeforeClass() {
- // reset backend
- \OC_User::clearBackends();
- \OC_User::useBackend('database');
-
- self::setupHooks();
+ parent::setUpBeforeClass();
// create test user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1, true);
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER2, true);
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER, true);
+ self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER2, true);
+ self::loginHelper(self::TEST_ENCRYPTION_UTIL_LEGACY_USER, true);
// create groups
\OC_Group::createGroup(self::TEST_ENCRYPTION_UTIL_GROUP1);
@@ -60,13 +56,14 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
\OC_Group::addToGroup(self::TEST_ENCRYPTION_UTIL_USER1, self::TEST_ENCRYPTION_UTIL_GROUP1);
}
+ protected function setUp() {
+ parent::setUp();
- function setUp() {
// login user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1);
- \OC_User::setUserId(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1);
- $this->userId = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1;
- $this->pass = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1;
+ self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER1);
+ \OC_User::setUserId(self::TEST_ENCRYPTION_UTIL_USER1);
+ $this->userId = self::TEST_ENCRYPTION_UTIL_USER1;
+ $this->pass = self::TEST_ENCRYPTION_UTIL_USER1;
// set content for encrypting / decrypting in tests
$this->dataUrl = __DIR__ . '/../lib/crypt.php';
@@ -77,66 +74,53 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$this->legacyEncryptedDataKey = __DIR__ . '/encryption.key';
$this->legacyKey = "30943623843030686906\0\0\0\0";
- $keypair = Encryption\Crypt::createKeypair();
+ $keypair = \OCA\Files_Encryption\Crypt::createKeypair();
$this->genPublicKey = $keypair['publicKey'];
$this->genPrivateKey = $keypair['privateKey'];
- $this->publicKeyDir = '/' . 'public-keys';
+ $this->publicKeyDir = \OCA\Files_Encryption\Keymanager::getPublicKeyPath();
$this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
- $this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
+ $this->keysPath = $this->encryptionDir . '/' . 'keys';
$this->publicKeyPath =
- $this->publicKeyDir . '/' . $this->userId . '.public.key'; // e.g. data/public-keys/admin.public.key
+ $this->publicKeyDir . '/' . $this->userId . '.publicKey'; // e.g. data/public-keys/admin.publicKey
$this->privateKeyPath =
- $this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key
+ $this->encryptionDir . '/' . $this->userId . '.privateKey'; // e.g. data/admin/admin.privateKey
$this->view = new \OC\Files\View('/');
- $this->util = new Encryption\Util($this->view, $this->userId);
+ $this->util = new \OCA\Files_Encryption\Util($this->view, $this->userId);
// remember files_trashbin state
- $this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+ $this->stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we don't want to tests with app files_trashbin enabled
\OC_App::disable('files_trashbin');
}
- function tearDown() {
+ protected function tearDown() {
// reset app files_trashbin
if ($this->stateFilesTrashbin) {
- OC_App::enable('files_trashbin');
+ \OC_App::enable('files_trashbin');
}
else {
- OC_App::disable('files_trashbin');
+ \OC_App::disable('files_trashbin');
}
+
+ parent::tearDown();
}
public static function tearDownAfterClass() {
// cleanup test user
- \OC_User::deleteUser(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1);
- \OC_User::deleteUser(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER2);
- \OC_User::deleteUser(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_UTIL_USER1);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_UTIL_USER2);
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_UTIL_LEGACY_USER);
//cleanup groups
\OC_Group::deleteGroup(self::TEST_ENCRYPTION_UTIL_GROUP1);
\OC_Group::deleteGroup(self::TEST_ENCRYPTION_UTIL_GROUP2);
- \OC_Hook::clear();
- \OC_FileProxy::clearProxies();
-
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
- }
-
- public static function setupHooks() {
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerFilesystemHooks();
-
- // clear and register hooks
- \OC_FileProxy::clearProxies();
- \OC_FileProxy::register(new OCA\Encryption\Proxy());
+ parent::tearDownAfterClass();
}
/**
@@ -144,11 +128,11 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
* test that paths set during User construction are correct
*/
function testKeyPaths() {
- $util = new Encryption\Util($this->view, $this->userId);
+ $util = new \OCA\Files_Encryption\Util($this->view, $this->userId);
$this->assertEquals($this->publicKeyDir, $util->getPath('publicKeyDir'));
$this->assertEquals($this->encryptionDir, $util->getPath('encryptionDir'));
- $this->assertEquals($this->keyfilesPath, $util->getPath('keyfilesPath'));
+ $this->assertEquals($this->keysPath, $util->getPath('keysPath'));
$this->assertEquals($this->publicKeyPath, $util->getPath('publicKeyPath'));
$this->assertEquals($this->privateKeyPath, $util->getPath('privateKeyPath'));
@@ -160,12 +144,12 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
*/
function testIsEncryptedPath() {
- $util = new Encryption\Util($this->view, $this->userId);
+ $util = new \OCA\Files_Encryption\Util($this->view, $this->userId);
self::loginHelper($this->userId);
- $unencryptedFile = '/tmpUnencrypted-' . uniqid() . '.txt';
- $encryptedFile = '/tmpEncrypted-' . uniqid() . '.txt';
+ $unencryptedFile = '/tmpUnencrypted-' . $this->getUniqueID() . '.txt';
+ $encryptedFile = '/tmpEncrypted-' . $this->getUniqueID() . '.txt';
// Disable encryption proxy to write a unencrypted file
$proxyStatus = \OC_FileProxy::$enabled;
@@ -213,7 +197,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
//
// $params['uid'] = $this->userId;
// $params['password'] = $this->pass;
-// $this->assertFalse(OCA\Encryption\Hooks::login($params));
+// $this->assertFalse(OCA\Files_Encryption\Hooks::login($params));
//
// $this->view->unlink($this->privateKeyPath);
// }
@@ -223,7 +207,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
*/
function testRecoveryEnabledForUser() {
- $util = new Encryption\Util($this->view, $this->userId);
+ $util = new \OCA\Files_Encryption\Util($this->view, $this->userId);
// Record the value so we can return it to it's original state later
$enabled = $util->recoveryEnabledForUser();
@@ -244,9 +228,9 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
*/
function testGetUidAndFilename() {
- \OC_User::setUserId(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1);
+ \OC_User::setUserId(self::TEST_ENCRYPTION_UTIL_USER1);
- $filename = '/tmp-' . uniqid() . '.test';
+ $filename = '/tmp-' . $this->getUniqueID() . '.test';
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
@@ -257,11 +241,11 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
// Re-enable proxy - our work is done
\OC_FileProxy::$enabled = $proxyStatus;
- $util = new Encryption\Util($this->view, $this->userId);
+ $util = new \OCA\Files_Encryption\Util($this->view, $this->userId);
list($fileOwnerUid, $file) = $util->getUidAndFilename($filename);
- $this->assertEquals(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1, $fileOwnerUid);
+ $this->assertEquals(self::TEST_ENCRYPTION_UTIL_USER1, $fileOwnerUid);
$this->assertEquals($file, $filename);
@@ -272,9 +256,9 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
* Test that data that is read by the crypto stream wrapper
*/
function testGetFileSize() {
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER1);
- $filename = 'tmp-' . uniqid();
+ $filename = 'tmp-' . $this->getUniqueID();
$externalFilename = '/' . $this->userId . '/files/' . $filename;
// Test for 0 byte files
@@ -298,8 +282,8 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
function testEncryptAll() {
- $filename = "/encryptAll" . uniqid() . ".txt";
- $util = new Encryption\Util($this->view, $this->userId);
+ $filename = "/encryptAll" . $this->getUniqueID() . ".txt";
+ $util = new \OCA\Files_Encryption\Util($this->view, $this->userId);
// disable encryption to upload a unencrypted file
\OC_App::disable('files_encryption');
@@ -329,7 +313,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
function testDecryptAll() {
- $filename = "/decryptAll" . uniqid() . ".txt";
+ $filename = "/decryptAll" . $this->getUniqueID() . ".txt";
$datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
$userdir = $datadir . '/' . $this->userId . '/files/';
@@ -354,18 +338,18 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$this->assertSame($encContent, $content);
// now we load the encryption app again
- OC_App::loadApp('files_encryption');
+ \OC_App::loadApp('files_encryption');
// init encryption app
$params = array('uid' => \OCP\User::getUser(),
'password' => \OCP\User::getUser());
- $view = new OC\Files\View('/');
- $util = new \OCA\Encryption\Util($view, \OCP\User::getUser());
+ $view = new \OC\Files\View('/');
+ $util = new \OCA\Files_Encryption\Util($view, \OCP\User::getUser());
$result = $util->initEncryption($params);
- $this->assertTrue($result instanceof \OCA\Encryption\Session);
+ $this->assertTrue($result instanceof \OCA\Files_Encryption\Session);
$successful = $util->decryptAll();
@@ -389,17 +373,19 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
// file should no longer be encrypted
$this->assertEquals(0, $fileInfoUnencrypted['encrypted']);
+ $backupPath = $this->getBackupPath('decryptAll');
+
// check if the keys where moved to the backup location
- $this->assertTrue($this->view->is_dir($this->userId . '/files_encryption/keyfiles.backup'));
- $this->assertTrue($this->view->file_exists($this->userId . '/files_encryption/keyfiles.backup/' . $filename . '.key'));
- $this->assertTrue($this->view->is_dir($this->userId . '/files_encryption/share-keys.backup'));
- $this->assertTrue($this->view->file_exists($this->userId . '/files_encryption/share-keys.backup/' . $filename . '.' . $user . '.shareKey'));
+ $this->assertTrue($this->view->is_dir($backupPath . '/keys'));
+ $this->assertTrue($this->view->file_exists($backupPath . '/keys/' . $filename . '/fileKey'));
+ $this->assertTrue($this->view->file_exists($backupPath . '/keys/' . $filename . '/' . $user . '.shareKey'));
+ $this->assertTrue($this->view->file_exists($backupPath . '/' . $user . '.privateKey'));
+ $this->assertTrue($this->view->file_exists($backupPath . '/' . $user . '.publicKey'));
// cleanup
$this->view->unlink($this->userId . '/files/' . $filename);
- $this->view->deleteAll($this->userId . '/files_encryption/keyfiles.backup');
- $this->view->deleteAll($this->userId . '/files_encryption/share-keys.backup');
- OC_App::enable('files_encryption');
+ $this->view->deleteAll($backupPath);
+ \OC_App::enable('files_encryption');
}
@@ -411,47 +397,37 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
// create some dummy key files
$encPath = '/' . self::TEST_ENCRYPTION_UTIL_USER1 . '/files_encryption';
- $this->view->file_put_contents($encPath . '/keyfiles/foo.key', 'key');
- $this->view->file_put_contents($encPath . '/share-keys/foo.user1.shareKey', 'share key');
-
- $util = new \OCA\Encryption\Util($this->view, self::TEST_ENCRYPTION_UTIL_USER1);
-
- $util->backupAllKeys('testing');
+ $this->view->mkdir($encPath . '/keys/foo');
+ $this->view->file_put_contents($encPath . '/keys/foo/fileKey', 'key');
+ $this->view->file_put_contents($encPath . '/keys/foo/user1.shareKey', 'share key');
- $encFolderContent = $this->view->getDirectoryContent($encPath);
+ $util = new \OCA\Files_Encryption\Util($this->view, self::TEST_ENCRYPTION_UTIL_USER1);
- $backupPath = '';
- foreach ($encFolderContent as $c) {
- $name = $c['name'];
- if (substr($name, 0, strlen('backup')) === 'backup') {
- $backupPath = $encPath . '/'. $c['name'];
- break;
- }
- }
+ $util->backupAllKeys('testBackupAllKeys');
- $this->assertTrue($backupPath !== '');
+ $backupPath = $this->getBackupPath('testBackupAllKeys');
// check backupDir Content
- $this->assertTrue($this->view->is_dir($backupPath . '/keyfiles'));
- $this->assertTrue($this->view->is_dir($backupPath . '/share-keys'));
- $this->assertTrue($this->view->file_exists($backupPath . '/keyfiles/foo.key'));
- $this->assertTrue($this->view->file_exists($backupPath . '/share-keys/foo.user1.shareKey'));
- $this->assertTrue($this->view->file_exists($backupPath . '/' . self::TEST_ENCRYPTION_UTIL_USER1 . '.private.key'));
- $this->assertTrue($this->view->file_exists($backupPath . '/' . self::TEST_ENCRYPTION_UTIL_USER1 . '.public.key'));
+ $this->assertTrue($this->view->is_dir($backupPath . '/keys'));
+ $this->assertTrue($this->view->is_dir($backupPath . '/keys/foo'));
+ $this->assertTrue($this->view->file_exists($backupPath . '/keys/foo/fileKey'));
+ $this->assertTrue($this->view->file_exists($backupPath . '/keys/foo/user1.shareKey'));
+ $this->assertTrue($this->view->file_exists($backupPath . '/' . self::TEST_ENCRYPTION_UTIL_USER1 . '.privateKey'));
+ $this->assertTrue($this->view->file_exists($backupPath . '/' . self::TEST_ENCRYPTION_UTIL_USER1 . '.publicKey'));
//cleanup
$this->view->deleteAll($backupPath);
- $this->view->unlink($encPath . '/keyfiles/foo.key', 'key');
- $this->view->unlink($encPath . '/share-keys/foo.user1.shareKey', 'share key');
+ $this->view->unlink($encPath . '/keys/foo/fileKey');
+ $this->view->unlink($encPath . '/keys/foo/user1.shareKey');
}
function testDescryptAllWithBrokenFiles() {
- $file1 = "/decryptAll1" . uniqid() . ".txt";
- $file2 = "/decryptAll2" . uniqid() . ".txt";
+ $file1 = "/decryptAll1" . $this->getUniqueID() . ".txt";
+ $file2 = "/decryptAll2" . $this->getUniqueID() . ".txt";
- $util = new Encryption\Util($this->view, $this->userId);
+ $util = new \OCA\Files_Encryption\Util($this->view, $this->userId);
$this->view->file_put_contents($this->userId . '/files/' . $file1, $this->dataShort);
$this->view->file_put_contents($this->userId . '/files/' . $file2, $this->dataShort);
@@ -466,8 +442,11 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
// rename keyfile for file1 so that the decryption for file1 fails
// Expected behaviour: decryptAll() returns false, file2 gets decrypted anyway
- $this->view->rename($this->userId . '/files_encryption/keyfiles/' . $file1 . '.key',
- $this->userId . '/files_encryption/keyfiles/' . $file1 . '.key.moved');
+ $this->view->rename($this->userId . '/files_encryption/keys/' . $file1 . '/fileKey',
+ $this->userId . '/files_encryption/keys/' . $file1 . '/fileKey.moved');
+
+ // need to reset key cache that we don't use the cached key
+ $this->resetKeyCache();
// decrypt all encrypted files
$result = $util->decryptAll();
@@ -485,12 +464,13 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$this->assertEquals(0, $fileInfoUnencrypted2['encrypted']);
// keyfiles and share keys should still exist
- $this->assertTrue($this->view->is_dir($this->userId . '/files_encryption/keyfiles/'));
- $this->assertTrue($this->view->is_dir($this->userId . '/files_encryption/share-keys/'));
+ $this->assertTrue($this->view->is_dir($this->userId . '/files_encryption/keys/'));
+ $this->assertTrue($this->view->file_exists($this->userId . '/files_encryption/keys/' . $file1 . '/fileKey.moved'));
+ $this->assertTrue($this->view->file_exists($this->userId . '/files_encryption/keys/' . $file1 . '/' . $this->userId . '.shareKey'));
// rename the keyfile for file1 back
- $this->view->rename($this->userId . '/files_encryption/keyfiles/' . $file1 . '.key.moved',
- $this->userId . '/files_encryption/keyfiles/' . $file1 . '.key');
+ $this->view->rename($this->userId . '/files_encryption/keys/' . $file1 . '/fileKey.moved',
+ $this->userId . '/files_encryption/keys/' . $file1 . '/fileKey');
// try again to decrypt all encrypted files
$result = $util->decryptAll();
@@ -508,15 +488,30 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$this->assertEquals(0, $fileInfoUnencrypted2['encrypted']);
// keyfiles and share keys should be deleted
- $this->assertFalse($this->view->is_dir($this->userId . '/files_encryption/keyfiles/'));
- $this->assertFalse($this->view->is_dir($this->userId . '/files_encryption/share-keys/'));
+ $this->assertFalse($this->view->is_dir($this->userId . '/files_encryption/keys/'));
//cleanup
+ $backupPath = $this->getBackupPath('decryptAll');
$this->view->unlink($this->userId . '/files/' . $file1);
$this->view->unlink($this->userId . '/files/' . $file2);
- $this->view->deleteAll($this->userId . '/files_encryption/keyfiles.backup');
- $this->view->deleteAll($this->userId . '/files_encryption/share-keys.backup');
+ $this->view->deleteAll($backupPath);
+
+ }
+
+ function getBackupPath($extension) {
+ $encPath = '/' . self::TEST_ENCRYPTION_UTIL_USER1 . '/files_encryption';
+ $encFolderContent = $this->view->getDirectoryContent($encPath);
+
+ $backupPath = '';
+ foreach ($encFolderContent as $c) {
+ $name = $c['name'];
+ if (substr($name, 0, strlen('backup.' . $extension)) === 'backup.' . $extension) {
+ $backupPath = $encPath . '/'. $c['name'];
+ break;
+ }
+ }
+ return $backupPath;
}
/**
@@ -543,6 +538,43 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
}
/**
+ * Tests that filterShareReadyUsers() returns the correct list of
+ * users that are ready or not ready for encryption
+ */
+ public function testFilterShareReadyUsers() {
+ $appConfig = \OC::$server->getAppConfig();
+
+ $publicShareKeyId = $appConfig->getValue('files_encryption', 'publicShareKeyId');
+ $recoveryKeyId = $appConfig->getValue('files_encryption', 'recoveryKeyId');
+
+ $usersToTest = array(
+ 'readyUser',
+ 'notReadyUser',
+ 'nonExistingUser',
+ $publicShareKeyId,
+ $recoveryKeyId,
+ );
+ self::loginHelper('readyUser', true);
+ self::loginHelper('notReadyUser', true);
+ // delete encryption dir to make it not ready
+ $this->view->unlink('notReadyUser/files_encryption/');
+
+ // login as user1
+ self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER1);
+
+ $result = $this->util->filterShareReadyUsers($usersToTest);
+ $this->assertEquals(
+ array('readyUser', $publicShareKeyId, $recoveryKeyId),
+ $result['ready']
+ );
+ $this->assertEquals(
+ array('notReadyUser', 'nonExistingUser'),
+ $result['unready']
+ );
+ \OC_User::deleteUser('readyUser');
+ }
+
+ /**
* @param string $user
* @param bool $create
* @param bool $password
@@ -569,7 +601,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
if ($loadEncryption) {
$params['uid'] = $user;
$params['password'] = $password;
- OCA\Encryption\Hooks::login($params);
+ \OCA\Files_Encryption\Hooks::login($params);
}
}
@@ -588,15 +620,17 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
* @return boolean
*/
private function setMigrationStatus($status, $user) {
- return \OC_Preferences::setValue($user, 'files_encryption', 'migration_status', (string)$status);
+ \OC::$server->getConfig()->setUserValue($user, 'files_encryption', 'migration_status', (string)$status);
+ // the update will definitely be executed -> return value is always true
+ return true;
}
}
/**
- * dummy class extends \OCA\Encryption\Util to access protected methods for testing
+ * dummy class extends \OCA\Files_Encryption\Util to access protected methods for testing
*/
-class DummyUtilClass extends \OCA\Encryption\Util {
+class DummyUtilClass extends \OCA\Files_Encryption\Util {
public function testIsMountPointApplicableToUser($mount) {
return $this->isMountPointApplicableToUser($mount);
}
diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php
index c838ddd29d1..83f4c0a77de 100755
--- a/apps/files_encryption/tests/webdav.php
+++ b/apps/files_encryption/tests/webdav.php
@@ -20,16 +20,14 @@
*
*/
-require_once __DIR__ . '/util.php';
-
-use OCA\Encryption;
+namespace OCA\Files_Encryption\Tests;
/**
- * Class Test_Encryption_Webdav
+ * Class Webdav
*
* this class provide basic webdav tests for PUT,GET and DELETE
*/
-class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
+class Webdav extends TestCase {
const TEST_ENCRYPTION_WEBDAV_USER1 = "test-webdav-user1";
@@ -45,33 +43,23 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
private $storage;
public static function setUpBeforeClass() {
- // reset backend
- \OC_User::clearBackends();
- \OC_User::useBackend('database');
-
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerFilesystemHooks();
-
- // Filesystem related hooks
- \OCA\Encryption\Helper::registerUserHooks();
-
- // clear and register hooks
- \OC_FileProxy::clearProxies();
- \OC_FileProxy::register(new OCA\Encryption\Proxy());
+ parent::setUpBeforeClass();
// create test user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1, true);
+ self::loginHelper(self::TEST_ENCRYPTION_WEBDAV_USER1, true);
}
- function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
// reset backend
\OC_User::useBackend('database');
// set user id
- \OC_User::setUserId(\Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1);
- $this->userId = \Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1;
- $this->pass = \Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1;
+ \OC_User::setUserId(self::TEST_ENCRYPTION_WEBDAV_USER1);
+ $this->userId = self::TEST_ENCRYPTION_WEBDAV_USER1;
+ $this->pass = self::TEST_ENCRYPTION_WEBDAV_USER1;
// init filesystem view
$this->view = new \OC\Files\View('/');
@@ -80,35 +68,31 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
$this->dataShort = 'hats';
// remember files_trashbin state
- $this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+ $this->stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
// we don't want to tests with app files_trashbin enabled
\OC_App::disable('files_trashbin');
// create test user
- \Test_Encryption_Util::loginHelper(\Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1);
+ self::loginHelper(self::TEST_ENCRYPTION_WEBDAV_USER1);
}
- function tearDown() {
+ protected function tearDown() {
// reset app files_trashbin
if ($this->stateFilesTrashbin) {
- OC_App::enable('files_trashbin');
+ \OC_App::enable('files_trashbin');
} else {
- OC_App::disable('files_trashbin');
+ \OC_App::disable('files_trashbin');
}
+
+ parent::tearDown();
}
public static function tearDownAfterClass() {
// cleanup test user
- \OC_User::deleteUser(\Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1);
-
- \OC_Hook::clear();
- \OC_FileProxy::clearProxies();
+ \OC_User::deleteUser(self::TEST_ENCRYPTION_WEBDAV_USER1);
- // Delete keys in /data/
- $view = new \OC\Files\View('/');
- $view->rmdir('public-keys');
- $view->rmdir('owncloud_private_key');
+ parent::tearDownAfterClass();
}
/**
@@ -117,7 +101,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
function testWebdavPUT() {
// generate filename
- $filename = '/tmp-' . uniqid() . '.txt';
+ $filename = '/tmp-' . $this->getUniqueID() . '.txt';
// set server vars
$_SERVER['REQUEST_METHOD'] = 'OPTIONS';
@@ -137,11 +121,11 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
// check if key-file was created
$this->assertTrue($this->view->file_exists(
- '/' . $this->userId . '/files_encryption/keyfiles/' . $filename . '.key'));
+ '/' . $this->userId . '/files_encryption/keys/' . $filename . '/fileKey'));
// check if shareKey-file was created
$this->assertTrue($this->view->file_exists(
- '/' . $this->userId . '/files_encryption/share-keys/' . $filename . '.' . $this->userId . '.shareKey'));
+ '/' . $this->userId . '/files_encryption/keys/' . $filename . '/' . $this->userId . '.shareKey'));
// disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
@@ -154,7 +138,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// check if encrypted content is valid
- $this->assertTrue(Encryption\Crypt::isCatfileContent($encryptedContent));
+ $this->assertTrue(\OCA\Files_Encryption\Crypt::isCatfileContent($encryptedContent));
// get decrypted file contents
$decrypt = file_get_contents('crypt:///' . $this->userId . '/files' . $filename);
@@ -211,11 +195,11 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
// check if key-file was removed
$this->assertFalse($this->view->file_exists(
- '/' . $this->userId . '/files_encryption/keyfiles' . $filename . '.key'));
+ '/' . $this->userId . '/files_encryption/keys/' . $filename . '/fileKey'));
// check if shareKey-file was removed
$this->assertFalse($this->view->file_exists(
- '/' . $this->userId . '/files_encryption/share-keys' . $filename . '.' . $this->userId . '.shareKey'));
+ '/' . $this->userId . '/files_encryption/keys/' . $filename . '/' . $this->userId . '.shareKey'));
}
/**
@@ -227,14 +211,14 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
*/
function handleWebdavRequest($body = false) {
// Backends
- $authBackend = new OC_Connector_Sabre_Auth();
- $lockBackend = new OC_Connector_Sabre_Locks();
- $requestBackend = new OC_Connector_Sabre_Request();
+ $authBackend = new \OC_Connector_Sabre_Auth();
+ $lockBackend = new \OC_Connector_Sabre_Locks();
+ $requestBackend = new \OC_Connector_Sabre_Request();
// Create ownCloud Dir
$root = '/' . $this->userId . '/files';
$view = new \OC\Files\View($root);
- $publicDir = new OC_Connector_Sabre_Directory($view, $view->getFileInfo(''));
+ $publicDir = new \OC_Connector_Sabre_Directory($view, $view->getFileInfo(''));
$objectTree = new \OC\Connector\Sabre\ObjectTree();
$mountManager = \OC\Files\Filesystem::getMountManager();
$objectTree->init($publicDir, $view, $mountManager);
@@ -248,8 +232,8 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
$server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, 'ownCloud'));
$server->addPlugin(new \Sabre\DAV\Locks\Plugin($lockBackend));
$server->addPlugin(new \Sabre\DAV\Browser\Plugin(false)); // Show something in the Browser, but no upload
- $server->addPlugin(new OC_Connector_Sabre_QuotaPlugin($view));
- $server->addPlugin(new OC_Connector_Sabre_MaintenancePlugin());
+ $server->addPlugin(new \OC_Connector_Sabre_QuotaPlugin($view));
+ $server->addPlugin(new \OC_Connector_Sabre_MaintenancePlugin());
$server->debugExceptions = true;
// And off we go!