diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-04-22 09:28:07 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-04-22 09:28:07 +0200 |
commit | 7be1094ba5bdfedb15489b45ed4f561b2590fe6a (patch) | |
tree | 763f4ff8a29130e80980b9e3d7445ca9e588a10e /lib/private | |
parent | 788005fd0c6360a0de5292a9cc846ad6bd36968e (diff) | |
parent | 06a4da43ec9c17f47576e6376de7eb8797b343c6 (diff) | |
download | nextcloud-server-7be1094ba5bdfedb15489b45ed4f561b2590fe6a.tar.gz nextcloud-server-7be1094ba5bdfedb15489b45ed4f561b2590fe6a.zip |
Merge pull request #24173 from owncloud/master-certificate
[master] Ignore certificate file if it starts with file://
Diffstat (limited to 'lib/private')
-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.'); |