diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-05-15 14:02:13 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-05-15 14:02:13 +0200 |
commit | 5b160edebba2a10de83b09a8010a811321dd6370 (patch) | |
tree | c67d05101ce159f6cc4f8a5fb17e0014f745cc48 /apps/files_encryption/lib/crypt.php | |
parent | 335f2ca32190e866ab1d222b693a273cb6778ac1 (diff) | |
download | nextcloud-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-x | apps/files_encryption/lib/crypt.php | 10 |
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;
}
|