mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-16 17:32:06 +01:00
Add felix.pub and test for anomaly (wip)
This commit is contained in:
parent
af8b065469
commit
68a548ac1d
4 changed files with 8945 additions and 0 deletions
|
@ -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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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
Loading…
Reference in a new issue