Skip to content
Snippets Groups Projects
Commit aa43cf32 authored by Guy Halse's avatar Guy Halse
Browse files

Test signatures with a certificate file too

Use of fingerprints is deprecated elsewhere in the code, so we should
assume that to be the case here. Improves coverage in any event.
parent e35474ce
No related branches found
No related tags found
No related merge requests found
......@@ -83,23 +83,30 @@ class MetaLoaderTest extends TestCase
);
}
public function testSignatureVerificationPass()
public function testSignatureVerificationFingerprintPass()
{
$this->metaloader->loadSource(array_merge($this->source, [ 'validateFingerprint' => '85:11:00:FF:34:55:BC:20:C0:20:5D:46:9B:2F:23:8F:41:09:68:F2' ]));
$this->metaloader->dumpMetadataStdOut();
$this->expectOutputRegex('/UTEbMBkGA1UECgwSRXhhbXBsZSBVbml2ZXJzaXR5MRgwFgYDVQQDDA9pZHAuZXhh/');
}
public function testSignatureVerificationFailure()
public function testSignatureVerificationFingerprintFailure()
{
$this->metaloader->loadSource(array_merge($this->source, [ 'validateFingerprint' => 'DE:AD:BE:EF:DE:AD:BE:EF:DE:AD:BE:EF:DE:AD:BE:EF:DE:AD:BE:EF' ]));
$this->metaloader->dumpMetadataStdOut();
$this->expectOutputString('');
}
public function testSignatureVerificationCertificatePass()
{
$this->metaloader->loadSource(array_merge($this->source, [ 'certificates' => [ dirname(dirname(__FILE__)) . '/mdx.pem' ] ]));
$this->metaloader->dumpMetadataStdOut();
$this->expectOutputRegex('/UTEbMBkGA1UECgwSRXhhbXBsZSBVbml2ZXJzaXR5MRgwFgYDVQQDDA9pZHAuZXhh/');
}
public function testWriteMetadataFiles()
{
$this->tmpdir = tempnam(sys_get_temp_dir(), 'SSP:tests:metarefresh');
$this->tmpdir = tempnam(sys_get_temp_dir(), 'SSP:tests:metarefresh:');
@unlink($this->tmpdir); /* work around post 4.0.3 behaviour */
$this->metaloader->loadSource($this->source);
$this->metaloader->writeMetadataFiles($this->tmpdir);
......
-----BEGIN CERTIFICATE-----
MIIBrTCCARYCCQCS5gsoFmLx7DANBgkqhkiG9w0BAQsFADAbMQswCQYDVQQGEwJB
UTEMMAoGA1UEAwwDTURYMB4XDTE5MDEwNzA2NDMwMFoXDTM3MDMyNTA2NDMwMFow
GzELMAkGA1UEBhMCQVExDDAKBgNVBAMMA01EWDCBnzANBgkqhkiG9w0BAQEFAAOB
jQAwgYkCgYEAwXXyCkAJOkpece1pe36O9sURMO8RA7guGxdGVmvOfPP/9KYQ3FCA
vjcZQVvkYP006Cgfzy8eSSrXppbINI/TkxtExIfCRReGwAJQQjesOWVvKECRg+zk
s0VZomIHVzxOoZYDofan1H2q+Pbght5W/GsfRSgBI7RnpgAYATXg/W0CAwEAATAN
BgkqhkiG9w0BAQsFAAOBgQBmNI2M5QTEKpbrhGqozelCFK3pZfMOa1EjkeZY4NjI
D3yjdbWi9+9LDOuehuB1LGNvTqxpwikxS9di2h4cnzHGX9adh/DUOVWmCI3FiLF+
po/upTEJzuRUzkn1YHLdeDuWmX/29ayZ2rPxucw8voVVDLOMetTKFMSWGxBeQ8cu
Gw==
-----END CERTIFICATE-----
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment