]> source.dussan.org Git - nextcloud-server.git/commitdiff
some more error messages
authorBjörn Schießle <schiessle@owncloud.com>
Wed, 19 Jun 2013 13:58:34 +0000 (15:58 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Wed, 19 Jun 2013 13:58:34 +0000 (15:58 +0200)
apps/files_encryption/lib/crypt.php

index 4322bbf1af237a03c02813def4910f6806f1248f..3e5a97464d2a5d1d24a081e9029a3af50c112185 100755 (executable)
@@ -56,20 +56,18 @@ class Crypt {
                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