Merge pull request #11151 from owncloud/removeOverflowingFunction

Remove unused and overflowing function
This commit is contained in:
Lukas Reschke 2014-09-18 15:42:36 +02:00
commit a543807d85
3 changed files with 0 additions and 29 deletions

View File

@ -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;
@ -49,17 +48,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
*/
@ -81,13 +69,6 @@ class Certificate implements ICertificate {
return $this->organization;
}
/**
* @return string
*/
public function getSerial() {
return $this->serial;
}
/**
* @return \DateTime
*/

View File

@ -24,11 +24,6 @@ interface ICertificate {
*/
public function getOrganization();
/**
* @return string
*/
public function getSerial();
/**
* @return \DateTime
*/

View File

@ -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());