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
- } else {\r
-\r
- // Get private key\r
- openssl_pkey_export($res, $privateKey);\r
+ } elseif (openssl_pkey_export($res, $privateKey)) {\r
\r
// Get public key\r
$publicKey = openssl_pkey_get_details($res);\r
-\r
$publicKey = $publicKey['key'];\r
\r
$result = array(\r
'publicKey' => $publicKey,\r
'privateKey' => $privateKey\r
);\r
+ } else {\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