diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-04-22 09:36:17 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-04-22 09:36:17 +0200 |
commit | 05b95034003a87cfd7eb68161405871e7b935944 (patch) | |
tree | 29f3adffa16c6d7c2332552f8005b0ba4dddce90 /lib | |
parent | 1e017ea69f5963f10b69661f24d4150a427494f2 (diff) | |
parent | d3f585c329c0291b208dc54d75b4aecb7118ff8d (diff) | |
download | nextcloud-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.php | 7 |
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.'); |