summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-04-09 14:06:55 +0200
committerLukas Reschke <lukas@owncloud.com>2015-04-09 14:09:09 +0200
commitec69f2838c5d06bd827c3ad79e3561b78a0d43a2 (patch)
treedce14fa6a7890584b7f9374be8d3b489f7739542 /apps/encryption/lib
parent4f97cb9d1bace32c0ebda1f946e147631309a01f (diff)
downloadnextcloud-server-ec69f2838c5d06bd827c3ad79e3561b78a0d43a2.tar.gz
nextcloud-server-ec69f2838c5d06bd827c3ad79e3561b78a0d43a2.zip
Fix typos and some other adjustments
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r--apps/encryption/lib/crypto/crypt.php11
-rw-r--r--apps/encryption/lib/crypto/encryption.php4
2 files changed, 9 insertions, 6 deletions
diff --git a/apps/encryption/lib/crypto/crypt.php b/apps/encryption/lib/crypto/crypt.php
index f2ae8e6db26..974e0038afc 100644
--- a/apps/encryption/lib/crypto/crypt.php
+++ b/apps/encryption/lib/crypto/crypt.php
@@ -75,7 +75,7 @@ class Crypt {
$res = $this->getOpenSSLPKey();
if (!$res) {
- $log->error("Encryption Library could'nt generate users key-pair for {$this->user->getUID()}",
+ $log->error("Encryption Library couldn't generate users key-pair for {$this->user->getUID()}",
['app' => 'encryption']);
if (openssl_error_string()) {
@@ -94,7 +94,7 @@ class Crypt {
'privateKey' => $privateKey
];
}
- $log->error('Encryption library couldn\'t export users private key, please check your servers openSSL configuration.' . $this->user->getUID(),
+ $log->error('Encryption library couldn\'t export users private key, please check your servers OpenSSL configuration.' . $this->user->getUID(),
['app' => 'encryption']);
if (openssl_error_string()) {
$log->error('Encryption Library:' . openssl_error_string(),
@@ -379,8 +379,11 @@ class Crypt {
}
/**
- * Generate a pseudo random 256-bit ASCII key, used as file key
+ * Generate a cryptographically secure pseudo-random base64 encoded 256-bit
+ * ASCII key, used as file key
+ *
* @return string
+ * @throws \Exception
*/
public static function generateFileKey() {
// Generate key
@@ -438,7 +441,7 @@ class Crypt {
}
/**
- * @param $plainContent
+ * @param string $plainContent
* @param array $keyFiles
* @return array
* @throws MultiKeyEncryptException
diff --git a/apps/encryption/lib/crypto/encryption.php b/apps/encryption/lib/crypto/encryption.php
index adf57d35e80..13beda196ce 100644
--- a/apps/encryption/lib/crypto/encryption.php
+++ b/apps/encryption/lib/crypto/encryption.php
@@ -107,7 +107,7 @@ class Encryption implements IEncryptionModule {
* written to the header, in case of a write operation
* or if no additional data is needed return a empty array
*/
- public function begin($path, $user, $header, $accessList) {
+ public function begin($path, $user, array $header, array $accessList) {
if (isset($header['cipher'])) {
$this->cipher = $header['cipher'];
@@ -246,7 +246,7 @@ class Encryption implements IEncryptionModule {
* @param array $accessList who has access to the file contains the key 'users' and 'public'
* @return boolean
*/
- public function update($path, $uid, $accessList) {
+ public function update($path, $uid, array $accessList) {
$fileKey = $this->keyManager->getFileKey($path, $uid);
$publicKeys = array();
foreach ($accessList['users'] as $user) {