Mercurial > dropbear
annotate fuzz.h @ 1357:08f4fa4dc6a0 fuzz
closer to working
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 20 May 2017 13:23:16 +0800 |
parents | 3677a510f545 |
children | 6b89eb92f872 |
rev | line source |
---|---|
1348 | 1 #ifndef DROPBEAR_FUZZ_H |
2 #define DROPBEAR_FUZZ_H | |
3 | |
1357 | 4 #include "config.h" |
5 #ifdef DROPBEAR_FUZZ | |
6 | |
1348 | 7 #include "includes.h" |
8 #include "buffer.h" | |
1357 | 9 #include "algo.h" |
10 #include "fuzz-wrapfd.h" | |
1348 | 11 |
1356
3677a510f545
add wrapfd. improve fuzzer in makefile
Matt Johnston <matt@ucc.asn.au>
parents:
1348
diff
changeset
|
12 // once per process |
1348 | 13 void svr_setup_fuzzer(void); |
14 | |
1356
3677a510f545
add wrapfd. improve fuzzer in makefile
Matt Johnston <matt@ucc.asn.au>
parents:
1348
diff
changeset
|
15 // once per input. returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE |
3677a510f545
add wrapfd. improve fuzzer in makefile
Matt Johnston <matt@ucc.asn.au>
parents:
1348
diff
changeset
|
16 int fuzzer_set_input(const uint8_t *Data, size_t Size); |
3677a510f545
add wrapfd. improve fuzzer in makefile
Matt Johnston <matt@ucc.asn.au>
parents:
1348
diff
changeset
|
17 |
1357 | 18 void fuzz_kex_fakealgos(void); |
19 | |
20 // fake IO wrappers | |
21 #ifndef FUZZ_SKIP_WRAP | |
22 #define select(nfds, readfds, writefds, exceptfds, timeout) \ | |
23 wrapfd_select(nfds, readfds, writefds, exceptfds, timeout) | |
24 #define write(fd, buf, count) wrapfd_write(fd, buf, count) | |
25 #define read(fd, buf, count) wrapfd_read(fd, buf, count) | |
26 #endif // FUZZ_SKIP_WRAP | |
27 | |
1348 | 28 struct dropbear_fuzz_options { |
29 int fuzzing; | |
30 | |
31 // to record an unencrypted stream | |
32 FILE* recordf; | |
33 | |
34 // fuzzing input | |
1356
3677a510f545
add wrapfd. improve fuzzer in makefile
Matt Johnston <matt@ucc.asn.au>
parents:
1348
diff
changeset
|
35 buffer *input; |
1357 | 36 struct dropbear_cipher recv_cipher; |
37 struct dropbear_hash recv_mac; | |
38 int wrapfds; | |
1348 | 39 |
40 // dropbear_exit() jumps back | |
41 sigjmp_buf jmp; | |
42 | |
43 uid_t pw_uid; | |
44 gid_t pw_gid; | |
45 char* pw_name; | |
46 char* pw_dir; | |
47 char* pw_shell; | |
48 char* pw_passwd; | |
49 }; | |
50 | |
51 extern struct dropbear_fuzz_options fuzz; | |
52 | |
1357 | 53 #endif // DROPBEAR_FUZZ |
1348 | 54 |
55 #endif /* DROPBEAR_FUZZ_H */ |