// Decrypt the keyfile
$plainKey = Crypt::multiKeyDecrypt( $encKeyfile, $shareKey, $privateKey );
-
-// trigger_error("\$shareKey = $shareKey");
-// trigger_error("\$plainKey = $plainKey");
} else {
$plainKeyfile = Crypt::multiKeyDecrypt( $encKeyfile, $shareKey, $privateKey );
$plainData = Crypt::symmetricDecryptFileContent( $data, $plainKeyfile );
-
-// trigger_error("PLAINDATA = ". var_export($plainData, 1));
} elseif (
Crypt::mode() == 'server'
// rawPath is relative to the data directory
$this->rawPath = $this->userId . '/files/' . $this->relPath;
+ // Fix .part filenames
+ $this->rawPath = Keymanager::fixPartialFilePath( $this->rawPath );
+
if (
dirname( $this->rawPath ) == 'streams'
and isset( self::$sourceStreams[basename( $this->rawPath )] )
$this->plainKey = Crypt::multiKeyDecrypt( $this->encKeyfile, $shareKey, $privateKey );
-// trigger_error( '$this->relPath = '.$this->relPath );
-// trigger_error( '$this->userId = '.$this->userId);
-// trigger_error( '$this->encKeyfile = '.$this->encKeyfile );
-// trigger_error( '$this->plainKey1 = '.var_export($this->plainKey, 1));
-
return true;
} else {
// Save the sharekeys
Keymanager::setShareKeys( $view, $this->relPath, $this->encKeyfiles['keys'] );
-// trigger_error( "\$this->encKeyfiles['data'] = ".$this->encKeyfiles['data'] );
-// trigger_error( '$this->relPath = '.$this->relPath );
-// trigger_error( '$this->userId = '.$this->userId);
-// trigger_error( '$this->encKeyfile = '.var_export($this->encKeyfiles, 1) );
-// trigger_error( '$this->plainKey2 = '.var_export($this->plainKey, 1));
-
// If extra data is left over from the last round, make sure it
// is integrated into the next 6126 / 8192 block
if ( $this->writeCache ) {
// Clear $data ready for next round
$data = '';
-//
+
} else {
// Read the chunk from the start of $data
$encrypted = $this->preWriteEncrypt( $chunk, $this->plainKey );
- //trigger_error("\$encrypted = $encrypted");
-
// Write the data chunk to disk. This will be
// attended to the last data chunk if the file
// being handled totals more than 6126 bytes
\OC\Files\Filesystem::putFileInfo( $this->relPath, array( 'encrypted' => true, 'size' => $this->size ), '' );
}
-
- return fclose( $this->handle );
+ return fclose( $this->handle );
+
}
}