summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-05-27 18:09:35 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-05-27 18:09:35 +0200
commit2c3c60c1af1d789856760b79def8439f9fac6e96 (patch)
treef820dd2dbe6d23b265eca1c07c3c9f0604cf42ce /apps/files_encryption/lib
parentc81e34ef899617d4c0280bd3b19d5ef7da31d158 (diff)
parent4c05259ccfbb7e2f0083794172eaa7c06f4b2592 (diff)
downloadnextcloud-server-2c3c60c1af1d789856760b79def8439f9fac6e96.tar.gz
nextcloud-server-2c3c60c1af1d789856760b79def8439f9fac6e96.zip
Merge branch 'master' into remove_unused_vars
Conflicts: apps/files_encryption/hooks/hooks.php apps/files_encryption/lib/crypt.php apps/files_encryption/lib/proxy.php
Diffstat (limited to 'apps/files_encryption/lib')
-rwxr-xr-xapps/files_encryption/lib/crypt.php8
-rw-r--r--apps/files_encryption/lib/proxy.php2
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 11b9298b447..ef50dc0cd7a 100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -610,14 +610,13 @@ class Crypt {
*
* This function decrypts an content
*/
- public static function legacyDecrypt($content, $passphrase = '') {
+ private static function legacyDecrypt($content, $passphrase = '') {
$bf = self::getBlowfish($passphrase);
$decrypted = $bf->decrypt($content);
- return rtrim($decrypted, "\0");;
-
+ return $decrypted;
}
/**
@@ -626,7 +625,8 @@ class Crypt {
* @param int $maxLength
* @return string
*/
- private static function legacyBlockDecrypt($data, $key = '', $maxLength = 0) {
+ public static function legacyBlockDecrypt($data, $key = '', $maxLength = 0) {
+
$result = '';
while (strlen($data)) {
$result .= self::legacyDecrypt(substr($data, 0, 8192), $key);
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 0efe0a79118..ae64e852aef 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -226,7 +226,7 @@ class Proxy extends \OC_FileProxy {
&& isset($_SESSION['legacyenckey'])
&& Crypt::isEncryptedMeta($path)
) {
- $plainData = Crypt::legacyDecrypt($data, $session->getLegacyKey());
+ $plainData = Crypt::legacyBlockDecrypt($data, $session->getLegacyKey());
}
\OC_FileProxy::$enabled = $proxyStatus;