summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-22 09:36:17 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-22 09:36:17 +0200
commit05b95034003a87cfd7eb68161405871e7b935944 (patch)
tree29f3adffa16c6d7c2332552f8005b0ba4dddce90 /lib
parent1e017ea69f5963f10b69661f24d4150a427494f2 (diff)
parentd3f585c329c0291b208dc54d75b4aecb7118ff8d (diff)
downloadnextcloud-server-05b95034003a87cfd7eb68161405871e7b935944.tar.gz
nextcloud-server-05b95034003a87cfd7eb68161405871e7b935944.zip
Merge pull request #24171 from owncloud/stable8.2-certificate
[stable8.2] Ignore certificate file if it starts with file://
Diffstat (limited to 'lib')
-rw-r--r--lib/private/security/certificate.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/security/certificate.php b/lib/private/security/certificate.php
index 0d7fcc4148d..d28dc24232f 100644
--- a/lib/private/security/certificate.php
+++ b/lib/private/security/certificate.php
@@ -50,6 +50,13 @@ class Certificate implements ICertificate {
public function __construct($data, $name) {
$this->name = $name;
$gmt = new \DateTimeZone('GMT');
+
+ // If string starts with "file://" ignore the certificate
+ $query = 'file://';
+ if(strtolower(substr($data, 0, strlen($query))) === $query) {
+ throw new \Exception('Certificate could not get parsed.');
+ }
+
$info = openssl_x509_parse($data);
if(!is_array($info)) {
throw new \Exception('Certificate could not get parsed.');