aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/crypt.php
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-05-15 14:02:13 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-05-15 14:02:13 +0200
commit5b160edebba2a10de83b09a8010a811321dd6370 (patch)
treec67d05101ce159f6cc4f8a5fb17e0014f745cc48 /apps/files_encryption/lib/crypt.php
parent335f2ca32190e866ab1d222b693a273cb6778ac1 (diff)
downloadnextcloud-server-5b160edebba2a10de83b09a8010a811321dd6370.tar.gz
nextcloud-server-5b160edebba2a10de83b09a8010a811321dd6370.zip
check if the user knows the correct recovery password before changing the recovery key settings
Diffstat (limited to 'apps/files_encryption/lib/crypt.php')
-rwxr-xr-xapps/files_encryption/lib/crypt.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index f92930c2cbd..5267ba81f57 100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -217,7 +217,7 @@ class Crypt {
* @returns decrypted file
*/
public static function decrypt( $encryptedContent, $iv, $passphrase ) {
-
+
if ( $plainContent = openssl_decrypt( $encryptedContent, 'AES-128-CFB', $passphrase, false, $iv ) ) {
return $plainContent;
@@ -463,9 +463,13 @@ class Crypt {
*/
public static function keyDecrypt( $encryptedContent, $privatekey ) {
- openssl_private_decrypt( $encryptedContent, $plainContent, $privatekey );
+ $result = @openssl_private_decrypt( $encryptedContent, $plainContent, $privatekey );
- return $plainContent;
+ if ( $result ) {
+ return $plainContent;
+ }
+
+ return $result;
}