diff options
Diffstat (limited to 'apps/files_encryption')
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 4 | ||||
-rwxr-xr-x | apps/files_encryption/lib/crypt.php | 18 | ||||
-rwxr-xr-x | apps/files_encryption/lib/helper.php | 9 | ||||
-rwxr-xr-x | apps/files_encryption/lib/keymanager.php | 6 | ||||
-rw-r--r-- | apps/files_encryption/lib/session.php | 2 | ||||
-rw-r--r-- | apps/files_encryption/lib/util.php | 5 | ||||
-rwxr-xr-x | apps/files_encryption/tests/crypt.php | 2 | ||||
-rw-r--r-- | apps/files_encryption/tests/keymanager.php | 4 | ||||
-rwxr-xr-x | apps/files_encryption/tests/util.php | 2 |
9 files changed, 30 insertions, 22 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 50f322ddef4..3af43f10264 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -647,7 +647,7 @@ class Hooks { /**
* @brief if the file was really deleted we remove the encryption keys
* @param array $params
- * @return boolean
+ * @return boolean|null
*/
public static function postDelete($params) {
@@ -687,7 +687,7 @@ class Hooks { /**
* @brief remember the file which should be deleted and it's owner
* @param array $params
- * @return boolean
+ * @return boolean|null
*/
public static function preDelete($params) {
$path = $params[\OC\Files\Filesystem::signal_param_path];
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index 9155d238c77..caca13acece 100755 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -182,6 +182,7 @@ class Crypt { * @param $data
* @param string $relPath The path of the file, relative to user/data;
* e.g. filename or /Docs/filename, NOT admin/files/filename
+ * @param boolean $isCatFileContent
* @return boolean
*/
public static function isLegacyEncryptedContent($isCatFileContent, $relPath) {
@@ -209,8 +210,8 @@ class Crypt { /**
* @brief Symmetrically encrypt a string
- * @param $plainContent
- * @param $iv
+ * @param string $plainContent
+ * @param string $iv
* @param string $passphrase
* @return string encrypted file content
*/
@@ -229,9 +230,9 @@ class Crypt { /**
* @brief Symmetrically decrypt a string
- * @param $encryptedContent
- * @param $iv
- * @param $passphrase
+ * @param string $encryptedContent
+ * @param string $iv
+ * @param string $passphrase
* @throws \Exception
* @return string decrypted file content
*/
@@ -292,8 +293,7 @@ class Crypt { * @brief Symmetrically encrypts a string and returns keyfile content
* @param string $plainContent content to be encrypted in keyfile
* @param string $passphrase
- * @return bool|string
- * @return string encrypted content combined with IV
+ * @return false|string encrypted content combined with IV
* @note IV need not be specified, as it will be stored in the returned keyfile
* and remain accessible therein.
*/
@@ -326,7 +326,7 @@ class Crypt { * @param $keyfileContent
* @param string $passphrase
* @throws \Exception
- * @return bool|string
+ * @return string|false
* @internal param string $source
* @internal param string $target
* @internal param string $key the decryption key
@@ -438,7 +438,7 @@ class Crypt { * @param $encryptedContent
* @param $shareKey
* @param $privateKey
- * @return bool
+ * @return false|string
* @internal param string $plainContent content to be encrypted
* @returns string $plainContent decrypted string
* @note symmetricDecryptFileContent() can be used to decrypt files created using this method
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 74a3b96a944..5ec09629d62 100755 --- a/apps/files_encryption/lib/helper.php +++ b/apps/files_encryption/lib/helper.php @@ -103,7 +103,7 @@ class Helper { * @brief enable recovery * * @param $recoveryKeyId - * @param $recoveryPassword + * @param string $recoveryPassword * @internal param \OCA\Encryption\Util $util * @internal param string $password * @return bool @@ -210,7 +210,7 @@ class Helper { /** * @brief disable recovery * - * @param $recoveryPassword + * @param string $recoveryPassword * @return bool */ public static function adminDisableRecovery($recoveryPassword) { @@ -345,6 +345,7 @@ class Helper { /** * @brief redirect to a error page + * @param Session $session */ public static function redirectToErrorPage($session, $errorCode = null) { @@ -423,7 +424,7 @@ class Helper { /** * @brief glob uses different pattern than regular expressions, escape glob pattern only - * @param unescaped path + * @param string $path unescaped path * @return escaped path */ public static function escapeGlobPattern($path) { @@ -442,7 +443,7 @@ class Helper { /** * @brief get the path of the original file * @param string $tmpFile path of the tmp file - * @return mixed path of the original file or false + * @return string|false path of the original file or false */ public static function getPathFromTmpFile($tmpFile) { if (isset(self::$tmpFileMapping[$tmpFile])) { diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php index 7abc565f609..cb9f5e64af3 100755 --- a/apps/files_encryption/lib/keymanager.php +++ b/apps/files_encryption/lib/keymanager.php @@ -170,7 +170,7 @@ class Keymanager { * @brief retrieve keyfile for an encrypted file * @param \OC_FilesystemView $view * @param \OCA\Encryption\Util $util - * @param $filePath + * @param string|false $filePath * @internal param \OCA\Encryption\file $string name * @return string file key or false * @note The keyfile returned is asymmetrically encrypted. Decryption @@ -513,6 +513,8 @@ class Keymanager { /** * @brief Make preparations to vars and filesystem for saving a keyfile + * @param string|boolean $path + * @param string $basePath */ public static function keySetPreparation(\OC_FilesystemView $view, $path, $basePath, $userId) { @@ -542,7 +544,7 @@ class Keymanager { /** * @brief extract filename from share key name * @param string $shareKey (filename.userid.sharekey) - * @return mixed filename or false + * @return string|false filename or false */ protected static function getFilenameFromShareKey($shareKey) { $parts = explode('.', $shareKey); diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php index 324081beabb..aa58e33e9d2 100644 --- a/apps/files_encryption/lib/session.php +++ b/apps/files_encryption/lib/session.php @@ -197,7 +197,7 @@ class Session { /** * @brief Sets user legacy key to session - * @param $legacyKey + * @param string $legacyKey * @return bool */ public function setLegacyKey($legacyKey) { diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index a338f90c8be..ec06bd52f5e 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -571,7 +571,7 @@ class Util { /** - * @param $path + * @param string $path * @return bool */ public function isSharedPath($path) { @@ -1045,7 +1045,7 @@ class Util { * @brief Decrypt a keyfile * @param string $filePath * @param string $privateKey - * @return bool|string + * @return false|string */ private function decryptKeyfile($filePath, $privateKey) { @@ -1124,6 +1124,7 @@ class Util { /** * @brief Find, sanitise and format users sharing a file * @note This wraps other methods into a portable bundle + * @param boolean $sharingEnabled */ public function getSharingUsersArray($sharingEnabled, $filePath, $currentUserId = false) { diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php index 388980ad4fd..123943ea26a 100755 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@ -661,7 +661,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** * @brief encryption using legacy blowfish method - * @param $data string data to encrypt + * @param string $data data to encrypt * @param $passwd string password * @return string */ diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php index 6f32c50743c..0caf12e91a3 100644 --- a/apps/files_encryption/tests/keymanager.php +++ b/apps/files_encryption/tests/keymanager.php @@ -250,6 +250,10 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase { * dummy class to access protected methods of \OCA\Encryption\Keymanager for testing */ class TestProtectedKeymanagerMethods extends \OCA\Encryption\Keymanager { + + /** + * @param string $sharekey + */ public static function testGetFilenameFromShareKey($sharekey) { return self::getFilenameFromShareKey($sharekey); } diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php index 321bdc76f8b..f70e30c4d73 100755 --- a/apps/files_encryption/tests/util.php +++ b/apps/files_encryption/tests/util.php @@ -538,7 +538,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { * helper function to set migration status to the right value * to be able to test the migration path * - * @param $status needed migration status for test + * @param integer $status needed migration status for test * @param $user for which user the status should be set * @return boolean */ |