Mercurial > dropbear
diff 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 |
line wrap: on
line diff
--- a/fuzz-common.c Mon Mar 05 00:59:17 2018 +0800 +++ b/fuzz-common.c Mon Mar 05 11:50:31 2018 +0800 @@ -22,6 +22,7 @@ fuzz.input = m_malloc(sizeof(buffer)); _dropbear_log = fuzz_dropbear_log; crypto_init(); + fuzz_seed(); /* let any messages get flushed */ setlinebuf(stdout); } @@ -188,3 +189,13 @@ return 0; } + +const void* fuzz_get_algo(const algo_type *algos, const char* name) { + const algo_type *t; + for (t = algos; t->name; t++) { + if (strcmp(t->name, name) == 0) { + return t->data; + } + } + assert(0); +}