comparison fuzz-common.c @ 1377:d4cc85e6c569 fuzz

rearrange, all fuzzers now call fuzzer_set_input()
author Matt Johnston <matt@ucc.asn.au>
date Thu, 25 May 2017 22:21:49 +0800
parents 9891bc31a1b3
children f03cfe9c76ac
comparison
equal deleted inserted replaced
1376:9e9c8d37fd56 1377:d4cc85e6c569
29 fuzz.input->len = Size; 29 fuzz.input->len = Size;
30 fuzz.input->pos = 0; 30 fuzz.input->pos = 0;
31 31
32 memset(&ses, 0x0, sizeof(ses)); 32 memset(&ses, 0x0, sizeof(ses));
33 memset(&svr_ses, 0x0, sizeof(svr_ses)); 33 memset(&svr_ses, 0x0, sizeof(svr_ses));
34 34 wrapfd_setup();
35 // get prefix. input format is
36 // string prefix
37 // uint32 wrapfd seed
38 // ... to be extended later
39 // [bytes] ssh input stream
40
41 // be careful to avoid triggering buffer.c assertions
42 if (fuzz.input->len < 8) {
43 return DROPBEAR_FAILURE;
44 }
45 size_t prefix_size = buf_getint(fuzz.input);
46 if (prefix_size != 4) {
47 return DROPBEAR_FAILURE;
48 }
49 uint32_t wrapseed = buf_getint(fuzz.input);
50 wrapfd_setup(wrapseed);
51 35
52 fuzz_seed(); 36 fuzz_seed();
53 37
54 return DROPBEAR_SUCCESS; 38 return DROPBEAR_SUCCESS;
55 } 39 }