From: Sam Tuke Date: Tue, 16 Apr 2013 12:50:20 +0000 (+0200) Subject: Fixed stream{} reading of encrypted files (stream_read()) X-Git-Tag: v6.0.0alpha2~743^2~185 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=770dcbf663c31c912b88b280121b21ec7ea4be8e;p=nextcloud-server.git Fixed stream{} reading of encrypted files (stream_read()) --- diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php index ebfd05041ba..f765d62201c 100644 --- a/apps/files_encryption/lib/stream.php +++ b/apps/files_encryption/lib/stream.php @@ -239,13 +239,15 @@ class Stream { // Fetch existing keyfile $this->encKeyfile = Keymanager::getFileKey( $this->rootView, $this->userId, $this->relPath ); - $this->getUser(); + $this->setUserProperty(); $session = new Session( $this->rootView ); $privateKey = $session->getPrivateKey( $this->userId ); - $this->keyfile = Crypt::keyDecrypt( $this->encKeyfile, $privateKey ); + $shareKey = Keymanager::getShareKey( $this->rootView, $this->userId, $this->relPath ); + + $this->keyfile = Crypt::multiKeyDecrypt( $this->encKeyfile, $shareKey, $privateKey ); return true; @@ -257,7 +259,7 @@ class Stream { } - public function getuser() { + public function setUserProperty() { // Only get the user again if it isn't already set if ( empty( $this->userId ) ) {