]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix typos and some other adjustments
authorLukas Reschke <lukas@owncloud.com>
Thu, 9 Apr 2015 12:06:55 +0000 (14:06 +0200)
committerLukas Reschke <lukas@owncloud.com>
Thu, 9 Apr 2015 12:09:09 +0000 (14:09 +0200)
apps/encryption/lib/crypto/crypt.php
apps/encryption/lib/crypto/encryption.php
apps/encryption_dummy/lib/dummymodule.php
lib/public/encryption/exceptions/genericencryptionexception.php
lib/public/encryption/iencryptionmodule.php
lib/public/encryption/imanager.php

index f2ae8e6db2625405e00a1b0c23b1c87ab3323cae..974e0038afc3ce4253c5f5564fd2fe2ab06f131f 100644 (file)
@@ -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
index adf57d35e80b53cd1acd576432f1ffd9fcec81a3..13beda196ce8b8ea7dd7b79ddde09f78125cd581 100644 (file)
@@ -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) {
index 8cec9dfaf4c97e822119a981072e24e23da3bfda..b4dfe34a9bfdf1d88ed8e4389aee257c83e1bd0a 100644 (file)
@@ -56,11 +56,11 @@ class DummyModule implements IEncryptionModule {
         * @param array $header contains the header data read from the file
         * @param array $accessList who has access to the file contains the key 'users' and 'public'
         *
-        * $return array $header contain data as key-value pairs which should be
+        * @return array $header contain data as key-value pairs which should be
         *                       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) {
                return array();
        }
 
@@ -141,7 +141,7 @@ class DummyModule 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) {
                return true;
        }
 }
index 59ab25fd61dce27e767cd7159cfa9b01843ff615..c488d4df162c26e7db4661e408256c9f43f5fd8a 100644 (file)
@@ -25,7 +25,12 @@ namespace OCP\Encryption\Exceptions;
 
 class GenericEncryptionException extends \Exception {
 
-       public function __construct($message = "", $code = 0, \Exception $previous = null) {
+       /**
+        * @param string $message
+        * @param int $code
+        * @param \Exception $previous
+        */
+       public function __construct($message = '', $code = 0, \Exception $previous = null) {
                if (empty($message)) {
                        $message = 'Unspecified encryption exception';
                }
index 2f5f5e8a8076845ac72ae895be42233ecf8106b2..c1ce7d99d782ba93e866d5212739f817d9fb9db3 100644 (file)
@@ -49,7 +49,7 @@ interface 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);
 
        /**
         * last chunk received. This is the place where you can perform some final
@@ -86,7 +86,7 @@ interface 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);
 
        /**
         * should the file be encrypted or not
index ec91e3580e50846fa1134ab2b5ce72c8ce25d923..3dcdbf5d03a3eb47d3cd6e88af0064ef1d8e8a78 100644 (file)
@@ -73,7 +73,7 @@ interface IManager {
         * get default encryption module
         *
         * @return \OCP\Encryption\IEncryptionModule
-        * @throws Exceptions\ModuleDoesNotExistsException
+        * @throws ModuleDoesNotExistsException
         */
        public function getDefaultEncryptionModule();