comparison fuzz-common.c @ 1742:6e71440b1e47 fuzz

Add fuzzer-client_nomaths, fix client fuzzer
author Matt Johnston <matt@ucc.asn.au>
date Sun, 18 Oct 2020 15:08:54 +0800
parents d1b279aa5ed1
children 3b9b427925a0
comparison
equal deleted inserted replaced
1741:d1b279aa5ed1 1742:6e71440b1e47
35 fuzz.input->len = Size; 35 fuzz.input->len = Size;
36 fuzz.input->pos = 0; 36 fuzz.input->pos = 0;
37 37
38 memset(&ses, 0x0, sizeof(ses)); 38 memset(&ses, 0x0, sizeof(ses));
39 memset(&svr_ses, 0x0, sizeof(svr_ses)); 39 memset(&svr_ses, 0x0, sizeof(svr_ses));
40 memset(&cli_ses, 0x0, sizeof(cli_ses));
40 wrapfd_setup(fuzz.input); 41 wrapfd_setup(fuzz.input);
41 42
42 fuzz_seed(); 43 fuzz_seed();
43 44
44 return DROPBEAR_SUCCESS; 45 return DROPBEAR_SUCCESS;
62 fuzz_common_setup(); 63 fuzz_common_setup();
63 64
64 _dropbear_exit = svr_dropbear_exit; 65 _dropbear_exit = svr_dropbear_exit;
65 66
66 char *argv[] = { 67 char *argv[] = {
68 "dropbear",
67 "-E", 69 "-E",
68 }; 70 };
69 71
70 int argc = sizeof(argv) / sizeof(*argv); 72 int argc = sizeof(argv) / sizeof(*argv);
71 svr_getopts(argc, argv); 73 svr_getopts(argc, argv);
78 80
79 _dropbear_exit = cli_dropbear_exit; 81 _dropbear_exit = cli_dropbear_exit;
80 _dropbear_log = cli_dropbear_log; 82 _dropbear_log = cli_dropbear_log;
81 83
82 char *argv[] = { 84 char *argv[] = {
85 "dbclient",
83 "-y", 86 "-y",
84 "localhost", 87 "localhost",
85 }; 88 };
86 89
87 int argc = sizeof(argv) / sizeof(*argv); 90 int argc = sizeof(argv) / sizeof(*argv);
166 *ret_writefd = wrapfd_new(); 169 *ret_writefd = wrapfd_new();
167 *ret_readfd = wrapfd_new(); 170 *ret_readfd = wrapfd_new();
168 if (ret_errfd) { 171 if (ret_errfd) {
169 *ret_errfd = wrapfd_new(); 172 *ret_errfd = wrapfd_new();
170 } 173 }
171 ret_pid = 999; 174 *ret_pid = 999;
172 return DROPBEAR_SUCCESS; 175 return DROPBEAR_SUCCESS;
173 } 176 }
174 177
175 int fuzz_run_preauth(const uint8_t *Data, size_t Size, int skip_kexmaths) { 178 int fuzz_run_preauth(const uint8_t *Data, size_t Size, int skip_kexmaths) {
176 static int once = 0; 179 static int once = 0;