summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-06-04 08:21:28 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-06-04 08:21:28 +0200
commit917f389747dc3b8b3d5b9ff326a2cee21579f58a (patch)
treeff3b2356d91740c12ff1058c6da900311dd5abc9 /apps/files_encryption/hooks
parent2c8288d8f90b2cc583c0a5d1e98113549b6d1374 (diff)
downloadnextcloud-server-917f389747dc3b8b3d5b9ff326a2cee21579f58a.tar.gz
nextcloud-server-917f389747dc3b8b3d5b9ff326a2cee21579f58a.zip
workaround to get the unit test going
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r--apps/files_encryption/hooks/hooks.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 8fae901fe63..d1ee4a97d15 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -99,12 +99,14 @@ class Hooks {
// Set legacy encryption key if it exists, to support
// depreciated encryption system
- $encLegacyKey = $userView->file_get_contents('encryption.key');
- if ($encLegacyKey) {
+ if ($userView->file_exists('encryption.key')) {
+ $encLegacyKey = $userView->file_get_contents('encryption.key');
+ if ($encLegacyKey) {
- $plainLegacyKey = Crypt::legacyDecrypt($encLegacyKey, $params['password']);
+ $plainLegacyKey = Crypt::legacyDecrypt($encLegacyKey, $params['password']);
- $session->setLegacyKey($plainLegacyKey);
+ $session->setLegacyKey($plainLegacyKey);
+ }
}
// Encrypt existing user files