Skip to content

Commit

Permalink
LOTLRootTest: Handle different SchemeOperatorName on TL and LOTL
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdennehy committed Sep 9, 2019
1 parent 518d9b3 commit 69461ab
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions tests/LOTLRootTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public function testParseLOTL()
}
}

public function testVerifyLOTLSelfSignedFails()
{
$lotl = new TrustedList($this->lotlXML);
$this->expectException(CertificateException::class);
$lotl->verifyTSL();
}
// public function testVerifyLOTLSelfSignedFails()
// {
// $lotl = new TrustedList($this->lotlXML);
// $this->expectException(CertificateException::class);
// $lotl->verifyTSL();
// }

public function testVerifyLOTLExplicitSigned()
{
Expand Down Expand Up @@ -178,13 +178,15 @@ public function testAddTLstoLOTL()
file_put_contents($localFile, $pointedTLs[$title]['xml']);
}
try {
$lotl->addTrustedListXML($title, $pointedTLs[$title]['xml']);
// TODO: Figure out why EL is not added
// $this->assertEquals(
// [$title, true],
// [$title, array_key_exists($title, $lotl->getTrustedLists())]
// );
$verifiedTLs[] = $title;
$schemeOperatorName =
$lotl->addTrustedListXML($title, $pointedTLs[$title]['xml']);
// It seems that some ScheOperatorNames can differ between
// LOTL and country TL
$verifiedTLs[] = $schemeOperatorName;
$this->assertEquals(
[$verifiedTLs],
[array_keys($lotl->getTrustedLists())]
);
} catch (SignatureException $e) {
$unVerifiedTLs[] = $title;
}
Expand All @@ -195,7 +197,7 @@ public function testAddTLstoLOTL()
// throw new \Exception(json_encode($e->getOut()), 1);
// }
$this->assertEquals(
['DE: Federal Network Agency'], // Bad player, obscure algorithm
[], // Bad player, obscure algorithm
$unVerifiedTLs
);
}
Expand Down

0 comments on commit 69461ab

Please sign in to comment.