summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2013-07-02 07:58:22 -0700
committerBjörn Schießle <bjoern@schiessle.org>2013-07-02 07:58:22 -0700
commit4c1820a2a1198cd856c0e5a315599b8b9f274121 (patch)
treea90f90e3cee7f020184d3990558683044e62c9b9
parent4d4484fac13dee4afbbab6c8fc4cca533800acdf (diff)
parent5a20c8b66fdf7e33de5874920e82b5caef449bea (diff)
downloadnextcloud-server-4c1820a2a1198cd856c0e5a315599b8b9f274121.tar.gz
nextcloud-server-4c1820a2a1198cd856c0e5a315599b8b9f274121.zip
Merge pull request #3858 from owncloud/more_ssl_error_messages
add openssl_error_string() output to the owncloud.log
-rwxr-xr-xapps/files_encryption/lib/crypt.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 927064012b6..6543a0de5f3 100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -57,10 +57,11 @@ class Crypt {
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', openssl_error_string(), \OCP\Util::ERROR);
} elseif (openssl_pkey_export($res, $privateKey)) {
// Get public key
- $publicKey = openssl_pkey_get_details($res);
- $publicKey = $publicKey['key'];
+ $keyDetails = openssl_pkey_get_details($res);
+ $publicKey = $keyDetails['key'];
$return = array(
'publicKey' => $publicKey,
@@ -68,6 +69,7 @@ class Crypt {
);
} 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', openssl_error_string(), \OCP\Util::ERROR);
}
return $return;
@@ -206,13 +208,10 @@ class Crypt {
public static function encrypt($plainContent, $iv, $passphrase = '') {
if ($encryptedContent = openssl_encrypt($plainContent, 'AES-128-CFB', $passphrase, false, $iv)) {
-
return $encryptedContent;
-
} else {
-
\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;
}