comparison fuzz-common.c @ 1589:35af85194268

Add kexdh and kexecdh fuzzers
author Matt Johnston <matt@ucc.asn.au>
date Mon, 05 Mar 2018 11:50:31 +0800
parents 92c93b4a3646
children d32bcb5c557d
comparison
equal deleted inserted replaced
1588:149a5329d83a 1589:35af85194268
20 fuzz.wrapfds = 1; 20 fuzz.wrapfds = 1;
21 fuzz.do_jmp = 1; 21 fuzz.do_jmp = 1;
22 fuzz.input = m_malloc(sizeof(buffer)); 22 fuzz.input = m_malloc(sizeof(buffer));
23 _dropbear_log = fuzz_dropbear_log; 23 _dropbear_log = fuzz_dropbear_log;
24 crypto_init(); 24 crypto_init();
25 fuzz_seed();
25 /* let any messages get flushed */ 26 /* let any messages get flushed */
26 setlinebuf(stdout); 27 setlinebuf(stdout);
27 } 28 }
28 29
29 int fuzz_set_input(const uint8_t *Data, size_t Size) { 30 int fuzz_set_input(const uint8_t *Data, size_t Size) {
186 /* dropbear_exit jumped here */ 187 /* dropbear_exit jumped here */
187 } 188 }
188 189
189 return 0; 190 return 0;
190 } 191 }
192
193 const void* fuzz_get_algo(const algo_type *algos, const char* name) {
194 const algo_type *t;
195 for (t = algos; t->name; t++) {
196 if (strcmp(t->name, name) == 0) {
197 return t->data;
198 }
199 }
200 assert(0);
201 }