Skip to content
Snippets Groups Projects
Commit 5a20c8b6 authored by Björn Schießle's avatar Björn Schießle
Browse files

add openssl_error_string() output to the owncloud.log

parent 6fcee1ee
No related branches found
No related tags found
No related merge requests found
...@@ -57,10 +57,11 @@ class Crypt { ...@@ -57,10 +57,11 @@ class Crypt {
if ($res === false) { if ($res === false) {
\OCP\Util::writeLog('Encryption library', 'couldn\'t generate users key-pair for ' . \OCP\User::getUser(), \OCP\Util::ERROR); \OCP\Util::writeLog('Encryption library', 'couldn\'t generate users key-pair for ' . \OCP\User::getUser(), \OCP\Util::ERROR);
\OCP\Util::writeLog('Encryption library', openssl_error_string(), \OCP\Util::ERROR);
} elseif (openssl_pkey_export($res, $privateKey)) { } elseif (openssl_pkey_export($res, $privateKey)) {
// Get public key // Get public key
$publicKey = openssl_pkey_get_details($res); $keyDetails = openssl_pkey_get_details($res);
$publicKey = $publicKey['key']; $publicKey = $keyDetails['key'];
$return = array( $return = array(
'publicKey' => $publicKey, 'publicKey' => $publicKey,
...@@ -68,6 +69,7 @@ class Crypt { ...@@ -68,6 +69,7 @@ class Crypt {
); );
} else { } else {
\OCP\Util::writeLog('Encryption library', 'couldn\'t export users private key, please check your servers openSSL configuration.' . \OCP\User::getUser(), \OCP\Util::ERROR); \OCP\Util::writeLog('Encryption library', 'couldn\'t export users private key, please check your servers openSSL configuration.' . \OCP\User::getUser(), \OCP\Util::ERROR);
\OCP\Util::writeLog('Encryption library', openssl_error_string(), \OCP\Util::ERROR);
} }
return $return; return $return;
...@@ -206,13 +208,10 @@ class Crypt { ...@@ -206,13 +208,10 @@ class Crypt {
public static function encrypt($plainContent, $iv, $passphrase = '') { public static function encrypt($plainContent, $iv, $passphrase = '') {
if ($encryptedContent = openssl_encrypt($plainContent, 'AES-128-CFB', $passphrase, false, $iv)) { if ($encryptedContent = openssl_encrypt($plainContent, 'AES-128-CFB', $passphrase, false, $iv)) {
return $encryptedContent; return $encryptedContent;
} else { } else {
\OCP\Util::writeLog('Encryption library', 'Encryption (symmetric) of content failed', \OCP\Util::ERROR); \OCP\Util::writeLog('Encryption library', 'Encryption (symmetric) of content failed', \OCP\Util::ERROR);
\OCP\Util::writeLog('Encryption library', openssl_error_string(), \OCP\Util::ERROR);
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment