From bd3024242f95a0761c0ce2295b39b4e350a6795d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Thu, 18 Apr 2013 15:42:28 +0200 Subject: [PATCH] always save key file, the key doesn't change but the encrypted keyfile change always the same way like the share-keys change --- apps/files_encryption/lib/proxy.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 1e7ac609a4b..4f02c60e103 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -113,8 +113,6 @@ class Proxy extends \OC_FileProxy { // Check if there is an existing key we can reuse if ( $encKeyfile = Keymanager::getFileKey( $rootView, $fileOwner, $filePath ) ) { - - $keyPreExists = true; // Fetch shareKey $shareKey = Keymanager::getShareKey( $rootView, $userId, $filePath ); @@ -127,8 +125,6 @@ class Proxy extends \OC_FileProxy { } else { - $keyPreExists = false; - // Make a new key $plainKey = Crypt::generateKey(); @@ -157,14 +153,9 @@ class Proxy extends \OC_FileProxy { // Set encrypted keyfile as common varname $encKey = $multiEncrypted['data']; - // Save the key if its new - if ( ! $keyPreExists ) { - - // Save keyfile for newly encrypted file in parallel directory tree - Keymanager::setFileKey( $rootView, $filePath, $fileOwner, $encKey ); - - } - + // Save keyfile for newly encrypted file in parallel directory tree + Keymanager::setFileKey( $rootView, $filePath, $fileOwner, $encKey ); + // Replace plain content with encrypted content by reference $data = $encData; -- 2.39.5