Skip to content
Snippets Groups Projects
Verified Commit 199898e5 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Reorganize modules to add a fuzz target

parent 503b1945
No related branches found
No related tags found
No related merge requests found
Showing
with 64 additions and 1 deletion
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
plugins {
id("com.github.johnrengelman.shadow") version "7.0.0"
}
dependencies {
api(project(":protocol"))
implementation("com.code-intelligence", "jazzer-api", "0.9.1")
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.fuzz
import com.code_intelligence.jazzer.api.FuzzedDataProvider
import de.justjanne.libquassel.protocol.features.FeatureSet
import de.justjanne.libquassel.protocol.serializers.HandshakeMessageSerializer
import java.nio.ByteBuffer
object HandshakeFuzzTarget {
@JvmStatic
fun fuzzerTestOneInput(data: FuzzedDataProvider) {
val featureSet = if (data.consumeBoolean()) FeatureSet.all() else FeatureSet.none()
HandshakeMessageSerializer.deserialize(ByteBuffer.wrap(data.consumeRemainingAsBytes()), featureSet)
}
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.fuzz
import com.code_intelligence.jazzer.api.FuzzedDataProvider
import de.justjanne.libquassel.protocol.features.FeatureSet
import de.justjanne.libquassel.protocol.serializers.HandshakeMessageSerializer
import de.justjanne.libquassel.protocol.serializers.SignalProxyMessageSerializer
import java.nio.BufferUnderflowException
import java.nio.ByteBuffer
object SignalProxyFuzzTarget {
@JvmStatic
fun fuzzerTestOneInput(data: FuzzedDataProvider) {
val featureSet = if (data.consumeBoolean()) FeatureSet.all() else FeatureSet.none()
SignalProxyMessageSerializer.deserialize(ByteBuffer.wrap(data.consumeRemainingAsBytes()), featureSet)
}
}
...@@ -14,7 +14,7 @@ repositories { ...@@ -14,7 +14,7 @@ repositories {
dependencies { dependencies {
val kspVersion: String by project val kspVersion: String by project
implementation("com.google.devtools.ksp", "symbol-processing-api", kspVersion) implementation("com.google.devtools.ksp", "symbol-processing-api", kspVersion)
implementation(project(":libquassel-annotations")) implementation(project(":annotations"))
val kotlinPoetVersion: String by project val kotlinPoetVersion: String by project
implementation("com.squareup", "kotlinpoet", kotlinPoetVersion) implementation("com.squareup", "kotlinpoet", kotlinPoetVersion)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment