Mercurial > dropbear
diff fuzz-common.c @ 1610:96e4c9b2cc00 coverity
merge coverity
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 21 Mar 2018 00:52:02 +0800 |
parents | 35af85194268 |
children | d32bcb5c557d |
line wrap: on
line diff
--- a/fuzz-common.c Sun Mar 04 15:07:09 2018 +0800 +++ b/fuzz-common.c Wed Mar 21 00:52:02 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); +}