peilaus alkaen
https://github.com/nextcloud/server.git
synced 2024-08-12 14:11:31 +02:00
Remove unused and overflowing function
Resolves https://github.com/owncloud/core/issues/10991 failure 4
This commit is contained in:
vanhempi
c89c6ed21d
commit
d07d5915c9
@ -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
|
||||
*/
|
||||
|
@ -24,11 +24,6 @@ interface ICertificate {
|
||||
*/
|
||||
public function getOrganization();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSerial();
|
||||
|
||||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
|
@ -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());
|
||||
|
Ladataan…
Viittaa uudesa ongelmassa
Block a user