]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed stream{} reading of encrypted files (stream_read())
authorSam Tuke <samtuke@owncloud.com>
Tue, 16 Apr 2013 12:50:20 +0000 (14:50 +0200)
committerSam Tuke <samtuke@owncloud.com>
Tue, 16 Apr 2013 12:53:54 +0000 (14:53 +0200)
apps/files_encryption/lib/stream.php

index ebfd05041ba2d2b6bafc8dfd8060cdc3c3d00e8b..f765d62201c88ff25f6c97e4a61b117cc68d2fc0 100644 (file)
@@ -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 ) ) {