1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 04:17:59 +01:00

Add felix.pub and test for anomaly (wip)

This commit is contained in:
Paul Schaub 2023-06-30 14:10:22 +02:00
parent af8b065469
commit 68a548ac1d
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
4 changed files with 8945 additions and 0 deletions

View file

@ -155,4 +155,14 @@ public class WebOfTrustTest {
assertTrue(network.getEdges().isEmpty()); assertTrue(network.getEdges().isEmpty());
assertTrue(network.getReverseEdges().isEmpty()); assertTrue(network.getReverseEdges().isEmpty());
} }
@Test
public void testWotWithAnomaly() throws BadDataException, IOException, InterruptedException {
PGPCertificateDirectory store = TestCertificateStores.anomalyGraph();
WebOfTrust wot = new WebOfTrust(store);
wot.initialize();
Network network = wot.getNetwork();
assertEquals(1, network.getNodes().size());
}
} }

View file

@ -54,6 +54,13 @@ public class TestCertificateStores {
return certD; return certD;
} }
public static PGPCertificateDirectory anomalyGraph()
throws BadDataException, IOException, InterruptedException {
PGPCertificateDirectory wotStore = createInMemoryCertificateDirectory();
wotStore.insert(getTestVector("anomalies/felix.pub"), merger);
return wotStore;
}
private static PGPCertificateDirectory createInMemoryCertificateDirectory() { private static PGPCertificateDirectory createInMemoryCertificateDirectory() {
SubkeyLookup subkeyLookup = new InMemorySubkeyLookup(); SubkeyLookup subkeyLookup = new InMemorySubkeyLookup();
KeyMaterialReaderBackend readerBackend = new KeyMaterialReader(); KeyMaterialReaderBackend readerBackend = new KeyMaterialReader();

View file

@ -282,4 +282,9 @@ public class WotTestVectors {
} }
return inputStream; return inputStream;
} }
public PGPPublicKeyRing getFelixKey()
throws IOException {
return PGPainless.readKeyRing().publicKeyRing(getTestResourceInputStream("test_vectors/anomalies/felix.pub"));
}
} }

File diff suppressed because it is too large Load diff