diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-06-19 16:55:31 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-06-19 16:55:31 +0200 |
commit | fe61230cc14b130bc553cf3270df8f3bd8b88d4d (patch) | |
tree | d96e8ef2de7638aa86da70dbed8e23353c37262b /apps/files_encryption | |
parent | e2e370f1993ebc4eeac64ce293a992be2205260f (diff) | |
download | nextcloud-server-fe61230cc14b130bc553cf3270df8f3bd8b88d4d.tar.gz nextcloud-server-fe61230cc14b130bc553cf3270df8f3bd8b88d4d.zip |
always have a defined return value
Diffstat (limited to 'apps/files_encryption')
-rwxr-xr-x | apps/files_encryption/lib/crypt.php | 8 |
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;
}
/**
|