summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/helper.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-08-01 11:50:56 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-08-08 08:38:37 +0200
commitcfbdad9cdb5c978225af796c128e4ad7bd011eee (patch)
treede220cd145ba5e1f0cf4f4da31358da368eff383 /apps/files_encryption/lib/helper.php
parent0deae7b86fbbcb8aaf4ada73950fd5a9b56f719f (diff)
downloadnextcloud-server-cfbdad9cdb5c978225af796c128e4ad7bd011eee.tar.gz
nextcloud-server-cfbdad9cdb5c978225af796c128e4ad7bd011eee.zip
catch broken server config and disable encryption app.
Diffstat (limited to 'apps/files_encryption/lib/helper.php')
-rwxr-xr-xapps/files_encryption/lib/helper.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index 6eee8fed6a6..d3d4afff912 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -232,6 +232,18 @@ class Helper {
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