aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r--apps/encryption/lib/crypto/crypt.php27
-rw-r--r--apps/encryption/lib/crypto/encryption.php4
-rw-r--r--apps/encryption/lib/keymanager.php15
-rw-r--r--apps/encryption/lib/migration.php2
-rw-r--r--apps/encryption/lib/recovery.php6
5 files changed, 29 insertions, 25 deletions
diff --git a/apps/encryption/lib/crypto/crypt.php b/apps/encryption/lib/crypto/crypt.php
index c0dcc936bdf..dbc0364a157 100644
--- a/apps/encryption/lib/crypto/crypt.php
+++ b/apps/encryption/lib/crypto/crypt.php
@@ -34,7 +34,6 @@ use OCA\Encryption\Vendor\PBKDF2Fallback;
use OCP\Encryption\Exceptions\GenericEncryptionException;
use OCP\IConfig;
use OCP\ILogger;
-use OCP\IUser;
use OCP\IUserSession;
class Crypt {
@@ -146,7 +145,7 @@ class Crypt {
/**
* @param string $plainContent
* @param string $passPhrase
- * @return bool|string
+ * @return false|string
* @throws GenericEncryptionException
*/
public function symmetricEncryptFileContent($plainContent, $passPhrase) {
@@ -273,7 +272,7 @@ class Crypt {
}
/**
- * @param $data
+ * @param string $data
* @return string
*/
private function addPadding($data) {
@@ -326,7 +325,7 @@ class Crypt {
* @param string $privateKey
* @param string $password
* @param string $uid for regular users, empty for system keys
- * @return bool|string
+ * @return false|string
*/
public function encryptPrivateKey($privateKey, $password, $uid = '') {
$cipher = $this->getCipher();
@@ -343,7 +342,7 @@ class Crypt {
* @param string $privateKey
* @param string $password
* @param string $uid for regular users, empty for system keys
- * @return bool|string
+ * @return false|string
*/
public function decryptPrivateKey($privateKey, $password = '', $uid = '') {
@@ -386,7 +385,7 @@ class Crypt {
/**
* check if it is a valid private key
*
- * @param $plainKey
+ * @param string $plainKey
* @return bool
*/
protected function isValidPrivateKey($plainKey) {
@@ -402,7 +401,7 @@ class Crypt {
}
/**
- * @param $keyFileContents
+ * @param string $keyFileContents
* @param string $passPhrase
* @param string $cipher
* @return string
@@ -424,7 +423,7 @@ class Crypt {
* remove padding
*
* @param $padded
- * @return bool|string
+ * @return string|false
*/
private function removePadding($padded) {
if (substr($padded, -2) === 'xx') {
@@ -436,8 +435,8 @@ class Crypt {
/**
* split iv from encrypted content
*
- * @param $catFile
- * @return array
+ * @param string|false $catFile
+ * @return string
*/
private function splitIv($catFile) {
// Fetch encryption metadata from end of file
@@ -457,8 +456,8 @@ class Crypt {
}
/**
- * @param $encryptedContent
- * @param $iv
+ * @param string $encryptedContent
+ * @param string $iv
* @param string $passPhrase
* @param string $cipher
* @return string
@@ -479,7 +478,7 @@ class Crypt {
}
/**
- * @param $data
+ * @param string $data
* @return array
*/
protected function parseHeader($data) {
@@ -551,7 +550,7 @@ class Crypt {
* @param $encKeyFile
* @param $shareKey
* @param $privateKey
- * @return mixed
+ * @return string
* @throws MultiKeyDecryptException
*/
public function multiKeyDecrypt($encKeyFile, $shareKey, $privateKey) {
diff --git a/apps/encryption/lib/crypto/encryption.php b/apps/encryption/lib/crypto/encryption.php
index d1140ce7cde..ea6c05c338f 100644
--- a/apps/encryption/lib/crypto/encryption.php
+++ b/apps/encryption/lib/crypto/encryption.php
@@ -247,7 +247,7 @@ class Encryption implements IEncryptionModule {
* encrypt data
*
* @param string $data you want to encrypt
- * @return mixed encrypted data
+ * @return string encrypted data
*/
public function encrypt($data) {
@@ -312,7 +312,7 @@ class Encryption implements IEncryptionModule {
* decrypt data
*
* @param string $data you want to decrypt
- * @return mixed decrypted data
+ * @return string decrypted data
* @throws DecryptionFailedException
*/
public function decrypt($data) {
diff --git a/apps/encryption/lib/keymanager.php b/apps/encryption/lib/keymanager.php
index c4507228878..0c8418c67a8 100644
--- a/apps/encryption/lib/keymanager.php
+++ b/apps/encryption/lib/keymanager.php
@@ -280,7 +280,7 @@ class KeyManager {
/**
* @param $userId
- * @param $key
+ * @param string $key
* @return bool
*/
public function setPrivateKey($userId, $key) {
@@ -365,7 +365,7 @@ class KeyManager {
/**
* @param $userId
- * @return mixed
+ * @return string
* @throws PrivateKeyMissingException
*/
public function getPrivateKey($userId) {
@@ -379,7 +379,7 @@ class KeyManager {
}
/**
- * @param $path
+ * @param string $path
* @param $uid
* @return string
*/
@@ -412,7 +412,7 @@ class KeyManager {
/**
* get the encrypted file key
*
- * @param $path
+ * @param string $path
* @return string
*/
public function getEncryptedFileKey($path) {
@@ -508,7 +508,7 @@ class KeyManager {
}
/**
- * @param $purpose
+ * @param string $purpose
* @param bool $timestamp
* @param bool $includeUserKeys
*/
@@ -534,13 +534,16 @@ class KeyManager {
}
/**
- * @param $uid
+ * @param string $uid
* @return bool
*/
private function deletePrivateKey($uid) {
return $this->keyStorage->deleteUserKey($uid, $this->privateKeyId, Encryption::ID);
}
+ /**
+ * @param string $path
+ */
public function deleteAllFileKeys($path) {
return $this->keyStorage->deleteAllFileKeys($path);
}
diff --git a/apps/encryption/lib/migration.php b/apps/encryption/lib/migration.php
index 0b691624a00..7bc399ddcbe 100644
--- a/apps/encryption/lib/migration.php
+++ b/apps/encryption/lib/migration.php
@@ -237,7 +237,7 @@ class Migration {
/**
* rename system wide public key
*
- * @param $privateKey private key for which we want to rename the corresponding public key
+ * @param string $privateKey private key for which we want to rename the corresponding public key
*/
private function renameSystemPublicKey($privateKey) {
$publicKey = substr($privateKey,0 , strrpos($privateKey, '.privateKey')) . '.publicKey';
diff --git a/apps/encryption/lib/recovery.php b/apps/encryption/lib/recovery.php
index e7b20e2c4af..cffa641f517 100644
--- a/apps/encryption/lib/recovery.php
+++ b/apps/encryption/lib/recovery.php
@@ -103,7 +103,7 @@ class Recovery {
/**
* @param $recoveryKeyId
- * @param $password
+ * @param string $password
* @return bool
*/
public function enableAdminRecovery($password) {
@@ -144,7 +144,7 @@ class Recovery {
}
/**
- * @param $recoveryPassword
+ * @param string $recoveryPassword
* @return bool
*/
public function disableAdminRecovery($recoveryPassword) {
@@ -212,6 +212,7 @@ class Recovery {
/**
* add recovery key to all encrypted files
+ * @param string $path
*/
private function addRecoveryKeys($path) {
$dirContent = $this->view->getDirectoryContent($path);
@@ -239,6 +240,7 @@ class Recovery {
/**
* remove recovery key to all encrypted files
+ * @param string $path
*/
private function removeRecoveryKeys($path) {
$dirContent = $this->view->getDirectoryContent($path);