diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-09-18 10:21:28 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-09-18 10:21:28 +0200 |
commit | d07d5915c903eb09321985c4199ac370b2a81227 (patch) | |
tree | a410840b3a5e09958543d5f4e0f7a7994f3de590 | |
parent | c89c6ed21de96be58793c0e63c39aa0897253450 (diff) | |
download | nextcloud-server-d07d5915c903eb09321985c4199ac370b2a81227.tar.gz nextcloud-server-d07d5915c903eb09321985c4199ac370b2a81227.zip |
Remove unused and overflowing function
Resolves https://github.com/owncloud/core/issues/10991 failure 4
-rw-r--r-- | lib/private/security/certificate.php | 19 | ||||
-rw-r--r-- | lib/public/icertificate.php | 5 | ||||
-rw-r--r-- | tests/lib/security/certificate.php | 5 |
3 files changed, 0 insertions, 29 deletions
diff --git a/lib/private/security/certificate.php b/lib/private/security/certificate.php index 778524507e0..58563550f81 100644 --- a/lib/private/security/certificate.php +++ b/lib/private/security/certificate.php @@ -39,7 +39,6 @@ class Certificate implements ICertificate { $info = openssl_x509_parse($data); $this->commonName = isset($info['subject']['CN']) ? $info['subject']['CN'] : null; $this->organization = isset($info['subject']['O']) ? $info['subject']['O'] : null; - $this->serial = $this->formatSerial($info['serialNumber']); $this->issueDate = new \DateTime('@' . $info['validFrom_time_t'], $gmt); $this->expireDate = new \DateTime('@' . $info['validTo_time_t'], $gmt); $this->issuerName = isset($info['issuer']['CN']) ? $info['issuer']['CN'] : null; @@ -50,17 +49,6 @@ class Certificate implements ICertificate { } /** - * Format the numeric serial into AA:BB:CC hex format - * - * @param int $serial - * @return string - */ - protected function formatSerial($serial) { - $hex = strtoupper(dechex($serial)); - return trim(chunk_split($hex, 2, ':'), ':'); - } - - /** * @return string */ public function getName() { @@ -82,13 +70,6 @@ class Certificate implements ICertificate { } /** - * @return string - */ - public function getSerial() { - return $this->serial; - } - - /** * @return \DateTime */ public function getIssueDate() { diff --git a/lib/public/icertificate.php b/lib/public/icertificate.php index 013496cb373..be0b9529c42 100644 --- a/lib/public/icertificate.php +++ b/lib/public/icertificate.php @@ -25,11 +25,6 @@ interface ICertificate { public function getOrganization(); /** - * @return string - */ - public function getSerial(); - - /** * @return \DateTime */ public function getIssueDate(); diff --git a/tests/lib/security/certificate.php b/tests/lib/security/certificate.php index db33dd00d99..898f583a43c 100644 --- a/tests/lib/security/certificate.php +++ b/tests/lib/security/certificate.php @@ -49,11 +49,6 @@ class CertificateTest extends \PHPUnit_Framework_TestCase { $this->assertSame('Internet Widgits Pty Ltd', $this->invalidCertificate->getOrganization()); } - function testGetSerial() { - $this->assertSame('7F:FF:FF:FF:FF:FF:FF:FF', $this->goodCertificate->getSerial()); - $this->assertSame('7F:FF:FF:FF:FF:FF:FF:FF', $this->invalidCertificate->getSerial()); - } - function testGetIssueDate() { $expected = new DateTime('2014-08-27 08:45:52 GMT'); $this->assertEquals($expected->getTimestamp(), $this->goodCertificate->getIssueDate()->getTimestamp()); |