mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-10 02:39:39 +02:00
Rename FuzzTests
This commit is contained in:
parent
c8d6a3dc85
commit
fed6cbcd6e
53 changed files with 5 additions and 17 deletions
|
@ -14,7 +14,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||||
|
|
||||||
public class AsciiArmorFuzzTest {
|
public class ArmorFuzzTest {
|
||||||
|
|
||||||
private final SOP sop = new SOPImpl();
|
private final SOP sop = new SOPImpl();
|
||||||
|
|
|
@ -6,12 +6,8 @@ package org.pgpainless.sop.fuzzing;
|
||||||
|
|
||||||
import com.code_intelligence.jazzer.api.FuzzedDataProvider;
|
import com.code_intelligence.jazzer.api.FuzzedDataProvider;
|
||||||
import com.code_intelligence.jazzer.junit.FuzzTest;
|
import com.code_intelligence.jazzer.junit.FuzzTest;
|
||||||
import org.bouncycastle.util.encoders.Hex;
|
|
||||||
import org.bouncycastle.util.io.Streams;
|
import org.bouncycastle.util.io.Streams;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.pgpainless.exception.MissingDecryptionMethodException;
|
|
||||||
import org.pgpainless.exception.ModificationDetectionException;
|
|
||||||
import org.pgpainless.sop.SOPImpl;
|
import org.pgpainless.sop.SOPImpl;
|
||||||
import sop.SOP;
|
import sop.SOP;
|
||||||
import sop.exception.SOPGPException;
|
import sop.exception.SOPGPException;
|
||||||
|
@ -21,22 +17,14 @@ import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.URI;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.NoSuchElementException;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
|
||||||
public class EncryptedMessageFuzzingTest {
|
public class EncryptFuzzTest {
|
||||||
|
|
||||||
private final SOP sop = new SOPImpl();
|
private final SOP sop = new SOPImpl();
|
||||||
private final String password = "sw0rdf1sh";
|
private final String password = "sw0rdf1sh";
|
||||||
|
@ -53,7 +41,7 @@ public class EncryptedMessageFuzzingTest {
|
||||||
List<byte[]> keys = new ArrayList<>();
|
List<byte[]> keys = new ArrayList<>();
|
||||||
|
|
||||||
String dir = "/org/pgpainless/sop/fuzzing/testKeys";
|
String dir = "/org/pgpainless/sop/fuzzing/testKeys";
|
||||||
InputStream in = EncryptedMessageFuzzingTest.class.getResourceAsStream(dir);
|
InputStream in = EncryptFuzzTest.class.getResourceAsStream(dir);
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
||||||
|
|
||||||
String file;
|
String file;
|
||||||
|
@ -62,7 +50,7 @@ public class EncryptedMessageFuzzingTest {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try(InputStream fIn = EncryptedMessageFuzzingTest.class.getResourceAsStream(dir + "/" + file)) {
|
try(InputStream fIn = EncryptFuzzTest.class.getResourceAsStream(dir + "/" + file)) {
|
||||||
byte[] b = Streams.readAll(fIn);
|
byte[] b = Streams.readAll(fIn);
|
||||||
keys.add(b);
|
keys.add(b);
|
||||||
}
|
}
|
|
@ -15,7 +15,7 @@ import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class SignatureFuzzTest {
|
public class VerifyFuzzTest {
|
||||||
|
|
||||||
private final SOP sop = new SOPImpl();
|
private final SOP sop = new SOPImpl();
|
||||||
private final byte[] data = "Hello, World!\n".getBytes(StandardCharsets.UTF_8);
|
private final byte[] data = "Hello, World!\n".getBytes(StandardCharsets.UTF_8);
|
Loading…
Add table
Add a link
Reference in a new issue