aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks
diff options
context:
space:
mode:
authorSam Tuke <samtuke@owncloud.com>2012-11-28 18:39:19 +0000
committerSam Tuke <samtuke@owncloud.com>2012-11-28 18:39:19 +0000
commitbfd47cd2dfad9c613d51fa9b4e5391f25ab57a87 (patch)
tree39358d14be70de879da94d39bf82ec54f27e3352 /apps/files_encryption/hooks
parenta465b3cb639e00b4f1bdcaa8ee44383a67e01112 (diff)
downloadnextcloud-server-bfd47cd2dfad9c613d51fa9b4e5391f25ab57a87.tar.gz
nextcloud-server-bfd47cd2dfad9c613d51fa9b4e5391f25ab57a87.zip
Development snapshot
Moved legacy crypto methods from Util into Crypt Added preliminary support for reading legacy encrypted files Added some unit tests
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r--apps/files_encryption/hooks/hooks.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index d2b546e8d1f..2c8921ef351 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -69,6 +69,19 @@ class Hooks {
// trigger_error( "\$_SESSION['enckey'] = {$_SESSION['enckey']}" );
+ $view1 = new \OC_FilesystemView( '/' . $params['uid'] );
+
+ // Set legacy encryption key if it exists, to support
+ // depreciated encryption system
+ if (
+ $view1->file_exists( 'encryption.key' )
+ && $legacyKey = $view1->file_get_contents( 'encryption.key' )
+ ) {
+
+ $_SESSION['legacyenckey'] = Crypt::legacyDecrypt( $legacyKey, $params['password'] );
+ trigger_error('leg enc key = '.$_SESSION['legacyenckey']);
+
+ }
// }
return true;