*/\r
public static function createKeypair() {\r
\r
+ $return = false;\r
+\r
$res = openssl_pkey_new(array('private_key_bits' => 4096));\r
\r
if ($res === false) {\r
\OCP\Util::writeLog('Encryption library', 'couldn\'t generate users key-pair for ' . \OCP\User::getUser(), \OCP\Util::ERROR);\r
- $result = false;\r
} elseif (openssl_pkey_export($res, $privateKey)) {\r
-\r
// Get public key\r
$publicKey = openssl_pkey_get_details($res);\r
$publicKey = $publicKey['key'];\r
\r
- $result = array(\r
+ $return = array(\r
'publicKey' => $publicKey,\r
'privateKey' => $privateKey\r
);\r
\OCP\Util::writeLog('Encryption library', 'couldn\'t export users private key, please check your servers openSSL configuration.' . \OCP\User::getUser(), \OCP\Util::ERROR);\r
}\r
\r
- return $result;\r
+ return $return;\r
}\r
\r
/**\r