* e.g. filename or /Docs/filename, NOT admin/files/filename\r
* @return boolean\r
*/\r
- public static function isLegacyEncryptedContent($data, $relPath) {\r
+ public static function isLegacyEncryptedContent($isCatFileContent, $relPath) {\r
\r
// Fetch all file metadata from DB\r
$metadata = \OC\Files\Filesystem::getFileInfo($relPath, '');\r
// legacy encryption system\r
if (isset($metadata['encrypted'])\r
&& $metadata['encrypted'] === true\r
- && !self::isCatfileContent($data)\r
+ && $isCatFileContent === false\r
) {\r
\r
return true;\r
\r
} else {\r
\r
- \OCP\Util::writeLog('Encryption library', 'Decryption (asymmetric) of sealed content failed', \OCP\Util::ERROR);\r
+ \OCP\Util::writeLog('Encryption library', 'Decryption (asymmetric) of sealed content with share-key "'.$shareKey.'" failed', \OCP\Util::ERROR);\r
\r
return false;\r
\r
// where they got re-enabled :/
\OC_FileProxy::$enabled = false;
- $data = $this->view->file_get_contents($filePath);
-
+ $isEncryptedPath = $this->isEncryptedPath($filePath);
// If the file is encrypted
// NOTE: If the userId is
// empty or not set, file will
// will eat server resources :(
if (
Keymanager::getFileKey($this->view, $this->userId, $relPath)
- && Crypt::isCatfileContent($data)
+ && $isEncryptedPath
) {
$found['encrypted'][] = array(
// If the file uses old
// encryption system
- } elseif (Crypt::isLegacyEncryptedContent($data, $relPath)) {
+ } elseif (Crypt::isLegacyEncryptedContent($isEncryptedPath, $relPath)) {
$found['legacy'][] = array(
'name' => $file,