mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 02:09:38 +02:00
More fuzzing tests and vectors
This commit is contained in:
parent
1560980c7e
commit
42e6bb483f
70 changed files with 113 additions and 3 deletions
|
@ -18,7 +18,9 @@ public class AsciiArmorFuzzTest {
|
|||
|
||||
private final SOP sop = new SOPImpl();
|
||||
|
||||
@FuzzTest()
|
||||
@FuzzTest(
|
||||
maxDuration = "60s"
|
||||
)
|
||||
public void armorAndDearmorData(FuzzedDataProvider data) throws IOException {
|
||||
byte[] bytes = data.consumeBytes(1024);
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2025 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.sop.fuzzing;
|
||||
|
||||
import com.code_intelligence.jazzer.api.FuzzedDataProvider;
|
||||
|
@ -67,7 +71,9 @@ public class EncryptedMessageFuzzingTest {
|
|||
return keys;
|
||||
}
|
||||
|
||||
@FuzzTest
|
||||
@FuzzTest(
|
||||
maxDuration = "60s"
|
||||
)
|
||||
public void decryptFuzzedMessage(FuzzedDataProvider provider) {
|
||||
byte[] ciphertext = provider.consumeBytes(8192);
|
||||
if (ciphertext.length == 0) {
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
// SPDX-FileCopyrightText: 2025 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.sop.fuzzing;
|
||||
|
||||
import com.code_intelligence.jazzer.api.FuzzedDataProvider;
|
||||
import com.code_intelligence.jazzer.junit.FuzzTest;
|
||||
import org.bouncycastle.bcpg.BCPGInputStream;
|
||||
import org.bouncycastle.bcpg.UnsupportedPacketVersionException;
|
||||
import org.bouncycastle.openpgp.PGPObjectFactory;
|
||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||
import org.bouncycastle.openpgp.bc.BcPGPObjectFactory;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PublicKeyPacketFuzzTest {
|
||||
|
||||
@FuzzTest(maxDuration = "30m")
|
||||
public void parsePublicKeyPacket(FuzzedDataProvider provider)
|
||||
{
|
||||
byte[] encoding = provider.consumeBytes(8192);
|
||||
if (encoding.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
ByteArrayInputStream bIn = new ByteArrayInputStream(encoding);
|
||||
BCPGInputStream pIn = new BCPGInputStream(bIn);
|
||||
PGPObjectFactory objFac = new BcPGPObjectFactory(pIn);
|
||||
try {
|
||||
Object next = objFac.nextObject();
|
||||
if (next == null) return;
|
||||
|
||||
PGPPublicKeyRing pubKey = (PGPPublicKeyRing) next;
|
||||
} catch (IOException e) {
|
||||
// ignore
|
||||
} catch (UnsupportedPacketVersionException e) {
|
||||
// ignore
|
||||
} catch (ClassCastException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
// SPDX-FileCopyrightText: 2025 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.sop.fuzzing;
|
||||
|
||||
import com.code_intelligence.jazzer.api.FuzzedDataProvider;
|
||||
import com.code_intelligence.jazzer.junit.FuzzTest;
|
||||
import org.bouncycastle.bcpg.BCPGInputStream;
|
||||
import org.bouncycastle.bcpg.UnsupportedPacketVersionException;
|
||||
import org.bouncycastle.openpgp.PGPObjectFactory;
|
||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||
import org.bouncycastle.openpgp.bc.BcPGPObjectFactory;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class SecretKeyPacketFuzzTest {
|
||||
|
||||
@FuzzTest(maxDuration = "30m")
|
||||
public void parseSecretKeyPacket(FuzzedDataProvider provider)
|
||||
{
|
||||
byte[] encoding = provider.consumeBytes(8192);
|
||||
if (encoding.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
ByteArrayInputStream bIn = new ByteArrayInputStream(encoding);
|
||||
BCPGInputStream pIn = new BCPGInputStream(bIn);
|
||||
PGPObjectFactory objFac = new BcPGPObjectFactory(pIn);
|
||||
try {
|
||||
Object next = objFac.nextObject();
|
||||
if (next == null) return;
|
||||
|
||||
PGPSecretKeyRing secKey = (PGPSecretKeyRing) next;
|
||||
} catch (IOException e) {
|
||||
// ignore
|
||||
} catch (UnsupportedPacketVersionException e) {
|
||||
// ignore
|
||||
} catch (ClassCastException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
|
@ -270,7 +270,7 @@ public class SignatureFuzzTest {
|
|||
"-----END PGP PUBLIC KEY BLOCK-----\n";
|
||||
|
||||
@FuzzTest(
|
||||
//maxDuration = "60s"
|
||||
maxDuration = "60s"
|
||||
)
|
||||
public void verifyFuzzedSig(FuzzedDataProvider provider) throws IOException {
|
||||
byte[] sig = provider.consumeBytes(1024);
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ÃÑóæqP\Ù±!J]÷µ,Ê¥‡tÓ¶Ò@:¨0‘.sd³±Ÿ¢å$X“<58>úÝ,·bc«v7îG‡
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Ζ&hp‡xπΥ‰ ΗΊ›Σπ"µϋ^<5E><11>Έhκεeh„(ΐύ
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
фVhp┤*├Hн=$И■;а*вnх╣(У╧²cчЩy▐╨╝НЭ4,▒sU;хТь эй#!┘прA╩gДjL< ▐B▌7?≥
|
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
ÆRhp‡*†HÎ=™-ä $öí5?»<0C>¡¥xÄH4—ÅÌt?“Ïè’%<25>[sTpXiý›ý
|
||||
8ãG:I‚)I/a¥¦"‡ÌyA9
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
<EFBFBD><03>vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
<EFBFBD>+
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
Æ8hp‡
|
||||
+—U@Vë‡Iü¹Ðˆæ¨£1]ŠýÀ›êø‹Ù<E280B9>a¦¸_l‰4J
|
|
@ -0,0 +1 @@
|
|||
Æ&hp‡ó^ñö‹oƒÈëuGɤo"C8|±¸šC‡Ë<Qö£H
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Æ>hp‡EN¸¤âú.-<2D>†?þFÏBMÚ_-'ň[k® ùq<C3B9>nù³Q»ÐêԪ࣊³&[Òm¦YËÓ
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
「ョ
|
|
@ -0,0 +1 @@
|
|||
<EFBFBD>
|
|
@ -0,0 +1 @@
|
|||
:<3A>:
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue