@@ -110,7 +110,7 @@ |
||
| 110 | 110 | /** |
| 111 | 111 | * get recovery key id |
| 112 | 112 | * |
| 113 | - * @return string|bool recovery key ID or false |
|
| 113 | + * @return string recovery key ID or false |
|
| 114 | 114 | */ |
| 115 | 115 | public static function getRecoveryKeyId() { |
| 116 | 116 | $appConfig = \OC::$server->getAppConfig(); |
@@ -421,6 +421,9 @@ |
||
| 421 | 421 | self::preRenameOrCopy($params, 'copy'); |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | + /** |
|
| 425 | + * @param string $operation |
|
| 426 | + */ |
|
| 424 | 427 | private static function preRenameOrCopy($params, $operation) { |
| 425 | 428 | $user = \OCP\User::getUser(); |
| 426 | 429 | $view = new \OC\Files\View('/'); |
@@ -323,6 +323,9 @@ discard block |
||
| 323 | 323 | return $result; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | + /** |
|
| 327 | + * @param \OC\Files\View $view |
|
| 328 | + */ |
|
| 326 | 329 | public static function publicShareKeyExists($view) { |
| 327 | 330 | $result = false; |
| 328 | 331 | |
@@ -424,7 +427,7 @@ discard block |
||
| 424 | 427 | * |
| 425 | 428 | * @param \OC\Files\View $view relative to data/ |
| 426 | 429 | * @param array $userIds list of users we want to remove |
| 427 | - * @param string $keyPath |
|
| 430 | + * @param string $keysPath |
|
| 428 | 431 | * @param string $owner the owner of the file |
| 429 | 432 | * @param string $ownerPath the owners name of the file for which we want to remove the users relative to data/user/files |
| 430 | 433 | */ |
@@ -474,7 +477,6 @@ discard block |
||
| 474 | 477 | * |
| 475 | 478 | * @param \OC\Files\View $view |
| 476 | 479 | * @param string $path relatvie to the views root |
| 477 | - * @param string $basePath |
|
| 478 | 480 | */ |
| 479 | 481 | protected static function keySetPreparation($view, $path) { |
| 480 | 482 | // If the file resides within a subdirectory, create it |
@@ -188,7 +188,7 @@ |
||
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | 190 | * Gets public share private key from session |
| 191 | - * @return string $privateKey |
|
| 191 | + * @return boolean $privateKey |
|
| 192 | 192 | * |
| 193 | 193 | */ |
| 194 | 194 | private static function getPublicSharePrivateKey() { |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | /** |
| 444 | 444 | * get the file size of the unencrypted file |
| 445 | 445 | * @param string $path absolute path |
| 446 | - * @return bool |
|
| 446 | + * @return string |
|
| 447 | 447 | */ |
| 448 | 448 | public function getFileSize($path) { |
| 449 | 449 | |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | * Decrypt a keyfile |
| 1001 | 1001 | * @param string $filePath |
| 1002 | 1002 | * @param string $privateKey |
| 1003 | - * @return false|string |
|
| 1003 | + * @return string |
|
| 1004 | 1004 | */ |
| 1005 | 1005 | private function decryptKeyfile($filePath, $privateKey) { |
| 1006 | 1006 | |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | |
| 1223 | 1223 | /** |
| 1224 | 1224 | * check if files are already migrated to the encryption system |
| 1225 | - * @return int|false migration status, false = in case of no record |
|
| 1225 | + * @return integer migration status, false = in case of no record |
|
| 1226 | 1226 | * @note If records are not being returned, check for a hidden space |
| 1227 | 1227 | * at the start of the uid in db |
| 1228 | 1228 | */ |
@@ -295,6 +295,7 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | /** |
| 297 | 297 | * test rename operation |
| 298 | + * @param string $filename |
|
| 298 | 299 | */ |
| 299 | 300 | function doTestRenameHook($filename) { |
| 300 | 301 | // check if keys exists |
@@ -357,6 +358,7 @@ discard block |
||
| 357 | 358 | |
| 358 | 359 | /** |
| 359 | 360 | * test rename operation |
| 361 | + * @param string $filename |
|
| 360 | 362 | */ |
| 361 | 363 | function doTestCopyHook($filename) { |
| 362 | 364 | // check if keys exists |
@@ -382,7 +382,6 @@ |
||
| 382 | 382 | /** |
| 383 | 383 | * @param \OC\Files\View $view relative to data/ |
| 384 | 384 | * @param string $path |
| 385 | - * @param string $basePath |
|
| 386 | 385 | */ |
| 387 | 386 | public static function testKeySetPreperation($view, $path) { |
| 388 | 387 | self::keySetPreparation($view, $path); |
@@ -118,6 +118,9 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | + /** |
|
| 122 | + * @param string $uid |
|
| 123 | + */ |
|
| 121 | 124 | protected function createDummyShareKeys($uid) { |
| 122 | 125 | $this->view->mkdir($uid . '/files_encryption/share-keys/folder1/folder2/folder3'); |
| 123 | 126 | $this->view->mkdir($uid . '/files_encryption/share-keys/folder2/'); |
@@ -141,6 +144,9 @@ discard block |
||
| 141 | 144 | } |
| 142 | 145 | } |
| 143 | 146 | |
| 147 | + /** |
|
| 148 | + * @param string $uid |
|
| 149 | + */ |
|
| 144 | 150 | protected function createDummyFileKeys($uid) { |
| 145 | 151 | $this->view->mkdir($uid . '/files_encryption/keyfiles/folder1/folder2/folder3'); |
| 146 | 152 | $this->view->mkdir($uid . '/files_encryption/keyfiles/folder2/'); |
@@ -150,6 +156,9 @@ discard block |
||
| 150 | 156 | $this->view->file_put_contents($uid . '/files_encryption/keyfiles/folder2/file.2.1.key' , 'data'); |
| 151 | 157 | } |
| 152 | 158 | |
| 159 | + /** |
|
| 160 | + * @param string $uid |
|
| 161 | + */ |
|
| 153 | 162 | protected function createDummyFilesInTrash($uid) { |
| 154 | 163 | $this->view->mkdir($uid . '/files_trashbin/share-keys'); |
| 155 | 164 | $this->view->mkdir($uid . '/files_trashbin/share-keys/folder1.d7437648723'); |
@@ -219,6 +228,9 @@ discard block |
||
| 219 | 228 | |
| 220 | 229 | } |
| 221 | 230 | |
| 231 | + /** |
|
| 232 | + * @param string $uid |
|
| 233 | + */ |
|
| 222 | 234 | protected function verifyFilesInTrash($uid) { |
| 223 | 235 | // share keys |
| 224 | 236 | $this->view->file_exists($uid . '/files_trashbin/keys/file1.d5457864/' . self::TEST_ENCRYPTION_MIGRATION_USER1 . '.shareKey.d5457864' , 'data'); |
@@ -231,6 +243,9 @@ discard block |
||
| 231 | 243 | $this->view->file_exists($uid . '/files_trashbin/keyfiles/folder1.d7437648723/file2/fileKey' , 'data'); |
| 232 | 244 | } |
| 233 | 245 | |
| 246 | + /** |
|
| 247 | + * @param string $uid |
|
| 248 | + */ |
|
| 234 | 249 | protected function verifyNewKeyPath($uid) { |
| 235 | 250 | // private key |
| 236 | 251 | if ($uid !== '') { |
@@ -567,6 +567,9 @@ discard block |
||
| 567 | 567 | |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | + /** |
|
| 571 | + * @param string $extension |
|
| 572 | + */ |
|
| 570 | 573 | function getBackupPath($extension) { |
| 571 | 574 | $encPath = '/' . self::TEST_ENCRYPTION_UTIL_USER1 . '/files_encryption'; |
| 572 | 575 | $encFolderContent = $this->view->getDirectoryContent($encPath); |
@@ -662,6 +665,10 @@ discard block |
||
| 662 | 665 | * dummy class extends \OCA\Files_Encryption\Util to access protected methods for testing |
| 663 | 666 | */ |
| 664 | 667 | class DummyUtilClass extends \OCA\Files_Encryption\Util { |
| 668 | + |
|
| 669 | + /** |
|
| 670 | + * @param string $uid |
|
| 671 | + */ |
|
| 665 | 672 | public function testIsMountPointApplicableToUser($mount, $uid) { |
| 666 | 673 | return $this->isMountPointApplicableToUser($mount, $uid); |
| 667 | 674 | } |