public static function login($params) {\r
$l = new \OC_L10N('files_encryption');\r
//check if all requirements are met\r
- if(!Helper::checkRequirements() ) {\r
+ if(!Helper::checkRequirements() || !Helper::checkConfiguration() ) {\r
$error_msg = $l->t("Missing requirements.");\r
$hint = $l->t('Please make sure that PHP 5.3.3 or newer is installed and that the OpenSSL PHP extension is enabled and configured properly. For now, the encryption app has been disabled.');\r
\OC_App::disable('files_encryption');\r
return (bool) $result;
}
+
+ /**
+ * check some common errors if the server isn't configured properly for encryption
+ * @return bool true if configuration seems to be OK
+ */
+ public static function checkConfiguration() {
+ if(openssl_pkey_new(array('private_key_bits' => 4096))) {
+ return true;
+ } else {
+ return false;
+ }
+ }
/**
* @brief glob uses different pattern than regular expressions, escape glob pattern only