From d3f585c329c0291b208dc54d75b4aecb7118ff8d Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Thu, 21 Apr 2016 18:55:33 +0200 Subject: [stable8.2] Ignore certificate file if it starts with file:// --- lib/private/security/certificate.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') 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.'); -- cgit v1.2.3