1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-14 00:12:06 +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.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;
}
public static PGPCertificateDirectory anomalyGraph()
throws BadDataException, IOException, InterruptedException {
PGPCertificateDirectory wotStore = createInMemoryCertificateDirectory();
wotStore.insert(getTestVector("anomalies/felix.pub"), merger);
return wotStore;
}
private static PGPCertificateDirectory createInMemoryCertificateDirectory() {
SubkeyLookup subkeyLookup = new InMemorySubkeyLookup();
KeyMaterialReaderBackend readerBackend = new KeyMaterialReader();

View file

@ -282,4 +282,9 @@ public class WotTestVectors {
}
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