diff options
author | Stefan Weiberg <sweiberg@suse.com> | 2018-08-21 14:14:59 +0200 |
---|---|---|
committer | Stefan Weiberg <sweiberg@suse.com> | 2018-08-21 15:21:26 +0200 |
commit | 375f167c67ca60daf9d04b7dbbfdbb12937328a4 (patch) | |
tree | 0af3844fcead00f353435a74e5b7da1215f37323 | |
parent | eba447987c7b531a6626d0639b9730de1d28b809 (diff) | |
download | nextcloud-server-375f167c67ca60daf9d04b7dbbfdbb12937328a4.tar.gz nextcloud-server-375f167c67ca60daf9d04b7dbbfdbb12937328a4.zip |
Adding a check to see if keyFileContents is empty:
* this fixes a download error and an exception if the data content
for encryption is empty
* #3958: for recovering encrypted files with a damaged signature
this is necessary in addition to turning the signature check off
Signed-off-by: Stefan Weiberg <sweiberg@suse.com>
-rw-r--r-- | apps/encryption/lib/Crypto/Crypt.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php index 49b1bcb41aa..70c99f808ba 100644 --- a/apps/encryption/lib/Crypto/Crypt.php +++ b/apps/encryption/lib/Crypto/Crypt.php @@ -457,6 +457,10 @@ class Crypt { * @throws DecryptionFailedException */ public function symmetricDecryptFileContent($keyFileContents, $passPhrase, $cipher = self::DEFAULT_CIPHER, $version = 0, $position = 0) { + if ($keyFileContents == '') { + return ''; + } + $catFile = $this->splitMetaData($keyFileContents, $cipher); if ($catFile['signature'] !== false) { |