Mercurial > dropbear
comparison fuzz.h @ 1741:d1b279aa5ed1 fuzz
Get client fuzzer building and starting (fails straight away)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 18 Oct 2020 12:17:39 +0800 |
parents | dfbe947bdf0d |
children | 28ab2cdb84bf |
comparison
equal
deleted
inserted
replaced
1740:dfbe947bdf0d | 1741:d1b279aa5ed1 |
---|---|
11 #include "fuzz-wrapfd.h" | 11 #include "fuzz-wrapfd.h" |
12 | 12 |
13 // once per process | 13 // once per process |
14 void fuzz_common_setup(void); | 14 void fuzz_common_setup(void); |
15 void fuzz_svr_setup(void); | 15 void fuzz_svr_setup(void); |
16 void fuzz_cli_setup(void); | |
16 | 17 |
17 // must be called once per fuzz iteration. | 18 // must be called once per fuzz iteration. |
18 // returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE | 19 // returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE |
19 int fuzz_set_input(const uint8_t *Data, size_t Size); | 20 int fuzz_set_input(const uint8_t *Data, size_t Size); |
20 | 21 |
26 int fuzz_checkpubkey_line(buffer* line, int line_num, char* filename, | 27 int fuzz_checkpubkey_line(buffer* line, int line_num, char* filename, |
27 const char* algo, unsigned int algolen, | 28 const char* algo, unsigned int algolen, |
28 const unsigned char* keyblob, unsigned int keybloblen); | 29 const unsigned char* keyblob, unsigned int keybloblen); |
29 extern const char * const * fuzz_signkey_names; | 30 extern const char * const * fuzz_signkey_names; |
30 void fuzz_seed(void); | 31 void fuzz_seed(void); |
32 | |
33 // helpers | |
31 void fuzz_get_socket_address(int fd, char **local_host, char **local_port, | 34 void fuzz_get_socket_address(int fd, char **local_host, char **local_port, |
32 char **remote_host, char **remote_port, int host_lookup); | 35 char **remote_host, char **remote_port, int host_lookup); |
33 void fuzz_fake_send_kexdh_reply(void); | 36 void fuzz_fake_send_kexdh_reply(void); |
34 int fuzz_spawn_command(int *ret_writefd, int *ret_readfd, int *ret_errfd, pid_t *ret_pid); | 37 int fuzz_spawn_command(int *ret_writefd, int *ret_readfd, int *ret_errfd, pid_t *ret_pid); |
35 | 38 |
55 int skip_kexmaths; | 58 int skip_kexmaths; |
56 | 59 |
57 // dropbear_exit() jumps back | 60 // dropbear_exit() jumps back |
58 int do_jmp; | 61 int do_jmp; |
59 sigjmp_buf jmp; | 62 sigjmp_buf jmp; |
60 | |
61 uid_t pw_uid; | |
62 gid_t pw_gid; | |
63 char* pw_name; | |
64 char* pw_dir; | |
65 char* pw_shell; | |
66 char* pw_passwd; | |
67 }; | 63 }; |
68 | 64 |
69 extern struct dropbear_fuzz_options fuzz; | 65 extern struct dropbear_fuzz_options fuzz; |
70 | 66 |
71 #endif // DROPBEAR_FUZZ | 67 #endif // DROPBEAR_FUZZ |