summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-06-19 16:55:31 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-06-20 11:14:54 +0200
commit8e5bc02e92340e8ee69ea40e79a7a0a16c7770b3 (patch)
treef7581944d6728081b755c122d588716e3ca053a4 /apps/files_encryption
parent433cb9f01dc5cb27dca3a4095531bd430487e5ae (diff)
downloadnextcloud-server-8e5bc02e92340e8ee69ea40e79a7a0a16c7770b3.tar.gz
nextcloud-server-8e5bc02e92340e8ee69ea40e79a7a0a16c7770b3.zip
always have a defined return value
Diffstat (limited to 'apps/files_encryption')
-rwxr-xr-xapps/files_encryption/lib/crypt.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 3e5a97464d2..927064012b6 100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -51,18 +51,18 @@ class Crypt {
*/
public static function createKeypair() {
+ $return = false;
+
$res = openssl_pkey_new(array('private_key_bits' => 4096));
if ($res === false) {
\OCP\Util::writeLog('Encryption library', 'couldn\'t generate users key-pair for ' . \OCP\User::getUser(), \OCP\Util::ERROR);
- $result = false;
} elseif (openssl_pkey_export($res, $privateKey)) {
-
// Get public key
$publicKey = openssl_pkey_get_details($res);
$publicKey = $publicKey['key'];
- $result = array(
+ $return = array(
'publicKey' => $publicKey,
'privateKey' => $privateKey
);
@@ -70,7 +70,7 @@ class Crypt {
\OCP\Util::writeLog('Encryption library', 'couldn\'t export users private key, please check your servers openSSL configuration.' . \OCP\User::getUser(), \OCP\Util::ERROR);
}
- return $result;
+ return $return;
}
/**