aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-02-06 16:30:58 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-02-06 17:02:21 +0100
commit2a6a9a8cefcf68f48d95e124db0c1b7edc9fe356 (patch)
tree66d682a22c3d12d1838822fc52cdd48fa765f5df /apps/files_encryption/lib
parent0d94da7e9ef9550c8ae0244b203ca84e5ee007b0 (diff)
downloadnextcloud-server-2a6a9a8cefcf68f48d95e124db0c1b7edc9fe356.tar.gz
nextcloud-server-2a6a9a8cefcf68f48d95e124db0c1b7edc9fe356.zip
polish documentation based on scrutinizer patches
Diffstat (limited to 'apps/files_encryption/lib')
-rwxr-xr-xapps/files_encryption/lib/crypt.php18
-rwxr-xr-xapps/files_encryption/lib/helper.php8
-rwxr-xr-xapps/files_encryption/lib/keymanager.php6
-rw-r--r--apps/files_encryption/lib/session.php2
-rw-r--r--apps/files_encryption/lib/util.php5
5 files changed, 22 insertions, 17 deletions
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 bb06a57c714..0ab32020d69 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
@@ -209,7 +209,7 @@ class Helper {
/**
* @brief disable recovery
*
- * @param $recoveryPassword
+ * @param string $recoveryPassword
* @return bool
*/
public static function adminDisableRecovery($recoveryPassword) {
@@ -344,6 +344,7 @@ class Helper {
/**
* @brief redirect to a error page
+ * @param Session $session
*/
public static function redirectToErrorPage($session, $errorCode = null) {
@@ -423,6 +424,7 @@ class Helper {
/**
* @brief glob uses different pattern than regular expressions, escape glob pattern only
* @param unescaped path
+ * @param string $path
* @return escaped path
*/
public static function escapeGlobPattern($path) {
@@ -441,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 25f2198181f..ca36fa6e6d5 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -195,7 +195,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 ae3e2a2e15a..47f020ed29c 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -563,7 +563,7 @@ class Util {
/**
- * @param $path
+ * @param string $path
* @return bool
*/
public function isSharedPath($path) {
@@ -1031,7 +1031,7 @@ class Util {
* @brief Decrypt a keyfile
* @param string $filePath
* @param string $privateKey
- * @return bool|string
+ * @return false|string
*/
private function decryptKeyfile($filePath, $privateKey) {
@@ -1110,6 +1110,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) {