diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-04-21 18:55:33 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-04-21 19:02:31 +0200 |
commit | 06a4da43ec9c17f47576e6376de7eb8797b343c6 (patch) | |
tree | 64c521323e1235b0d4c42ded90f614171a0dc613 /lib/private/Security | |
parent | 37f6b9eaf71bdfcae26a224b282908a128ef1803 (diff) | |
download | nextcloud-server-06a4da43ec9c17f47576e6376de7eb8797b343c6.tar.gz nextcloud-server-06a4da43ec9c17f47576e6376de7eb8797b343c6.zip |
[master] Ignore certificate file if it starts with file://
Diffstat (limited to 'lib/private/Security')
-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 54486ff51fe..9aca278174e 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.'); |