mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 18:29:39 +02:00
Replace consumeAsBytes(XXX) with consumeRemainingAsBytes()
This commit is contained in:
parent
4f8c52d215
commit
9f8ce475eb
6 changed files with 7 additions and 6 deletions
|
@ -22,7 +22,7 @@ public class AsciiArmorFuzzTest {
|
|||
maxDuration = "60s"
|
||||
)
|
||||
public void armorAndDearmorData(FuzzedDataProvider data) throws IOException {
|
||||
byte[] bytes = data.consumeBytes(1024);
|
||||
byte[] bytes = data.consumeRemainingAsBytes();
|
||||
|
||||
byte[] armored = sop.armor().data(bytes).getBytes();
|
||||
if (Arrays.areEqual(bytes, armored)) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.bouncycastle.util.encoders.Hex;
|
|||
import org.bouncycastle.util.io.Streams;
|
||||
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 sop.SOP;
|
||||
|
@ -75,7 +76,7 @@ public class EncryptedMessageFuzzingTest {
|
|||
maxDuration = "60s"
|
||||
)
|
||||
public void decryptFuzzedMessage(FuzzedDataProvider provider) {
|
||||
byte[] ciphertext = provider.consumeBytes(8192);
|
||||
byte[] ciphertext = provider.consumeRemainingAsBytes();
|
||||
if (ciphertext.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class ParseCertFuzzTest {
|
|||
|
||||
@FuzzTest(maxDuration = "30s")
|
||||
public void parseOpenPGPCert(FuzzedDataProvider data) throws IOException {
|
||||
byte[] certEncoding = data.consumeBytes(8192);
|
||||
byte[] certEncoding = data.consumeRemainingAsBytes();
|
||||
if (certEncoding.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class PublicKeyPacketFuzzTest {
|
|||
@FuzzTest(maxDuration = "30m")
|
||||
public void parsePublicKeyPacket(FuzzedDataProvider provider)
|
||||
{
|
||||
byte[] encoding = provider.consumeBytes(8192);
|
||||
byte[] encoding = provider.consumeRemainingAsBytes();
|
||||
if (encoding.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class SecretKeyPacketFuzzTest {
|
|||
@FuzzTest(maxDuration = "30m")
|
||||
public void parseSecretKeyPacket(FuzzedDataProvider provider)
|
||||
{
|
||||
byte[] encoding = provider.consumeBytes(8192);
|
||||
byte[] encoding = provider.consumeRemainingAsBytes();
|
||||
if (encoding.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ public class SignatureFuzzTest {
|
|||
maxDuration = "60s"
|
||||
)
|
||||
public void verifyFuzzedSig(FuzzedDataProvider provider) throws IOException {
|
||||
byte[] sig = provider.consumeBytes(1024);
|
||||
byte[] sig = provider.consumeRemainingAsBytes();
|
||||
if (sig.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue