@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * @param string $plainContent |
186 | 186 | * @param string $iv |
187 | 187 | * @param string $passphrase |
188 | - * @param string $cypher used for encryption, currently we support AES-128-CFB and AES-256-CFB |
|
188 | + * @param string $cipher used for encryption, currently we support AES-128-CFB and AES-256-CFB |
|
189 | 189 | * @return string encrypted file content |
190 | 190 | * @throws \OCA\Files_Encryption\Exception\EncryptionException |
191 | 191 | */ |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | /** |
242 | 242 | * Split concatenated data and IV into respective parts |
243 | 243 | * @param string $catFile concatenated data to be split |
244 | - * @return array keys: encrypted, iv |
|
244 | + * @return string keys: encrypted, iv |
|
245 | 245 | */ |
246 | 246 | private static function splitIv($catFile) { |
247 | 247 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * Symmetrically encrypts a string and returns keyfile content |
268 | 268 | * @param string $plainContent content to be encrypted in keyfile |
269 | 269 | * @param string $passphrase |
270 | - * @param string $cypher used for encryption, currently we support AES-128-CFB and AES-256-CFB |
|
270 | + * @param string $cipher used for encryption, currently we support AES-128-CFB and AES-256-CFB |
|
271 | 271 | * @return false|string encrypted content combined with IV |
272 | 272 | * @note IV need not be specified, as it will be stored in the returned keyfile |
273 | 273 | * and remain accessible therein. |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | * Create asymmetrically encrypted keyfile content using a generated key |
376 | 376 | * @param string $plainContent content to be encrypted |
377 | 377 | * @param array $publicKeys array keys must be the userId of corresponding user |
378 | - * @return array keys: keys (array, key = userId), data |
|
378 | + * @return string keys: keys (array, key = userId), data |
|
379 | 379 | * @throws \OCA\Files_Encryption\Exception\MultiKeyEncryptException if encryption failed |
380 | 380 | * @note symmetricDecryptFileContent() can decrypt files created using this method |
381 | 381 | */ |
@@ -552,6 +552,7 @@ discard block |
||
552 | 552 | * |
553 | 553 | * @param array $header |
554 | 554 | * @throws \OCA\Files_Encryption\Exception\EncryptionException |
555 | + * @return string |
|
555 | 556 | */ |
556 | 557 | public static function getCipher($header) { |
557 | 558 | $cipher = isset($header['cipher']) ? $header['cipher'] : 'AES-128-CFB'; |
@@ -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 !== '') { |