summaryrefslogtreecommitdiffhomepage
path: root/fuzzer-preauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'fuzzer-preauth.c')
-rw-r--r--fuzzer-preauth.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fuzzer-preauth.c b/fuzzer-preauth.c
index 6a40108..7564973 100644
--- a/fuzzer-preauth.c
+++ b/fuzzer-preauth.c
@@ -1,10 +1,10 @@
#include "fuzz.h"
#include "dbrandom.h"
#include "session.h"
+#include "fuzz-wrapfd.h"
-static int setup_fuzzer(void) {
+static void setup_fuzzer(void) {
svr_setup_fuzzer();
- return 0;
}
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
@@ -14,15 +14,15 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
once = 1;
}
- fuzz.input.data = (unsigned char*)Data;
- fuzz.input.size = Size;
- fuzz.input.len = Size;
- fuzz.input.pos = 0;
+ if (fuzzer_set_input(Data, Size) == DROPBEAR_FAILURE) {
+ return 0;
+ }
- seedrandom();
+ int fakesock = 1;
+ wrapfd_add(fakesock, fuzz.input, PLAIN);
if (setjmp(fuzz.jmp) == 0) {
- svr_session(-1, -1);
+ svr_session(fakesock, fakesock);
} else {
// dropbear_exit jumped here
}