# HG changeset patch # User Matt Johnston # Date 1520171049 -28800 # Node ID e6a5e51a29c93afe7a586bc854ee65e85e7b8974 # Parent 4192f883185810679d6a3e81266ecfbeee3c375b - fuzzer-pubkey needs to free algoname, fix build - improve dictionary with lengths diff -r 4192f8831858 -r e6a5e51a29c9 fuzzer-pubkey.c --- a/fuzzer-pubkey.c Sun Mar 04 19:38:34 2018 +0800 +++ b/fuzzer-pubkey.c Sun Mar 04 21:44:09 2018 +0800 @@ -25,9 +25,9 @@ buffer *keyblob = buf_getstringbuf(fuzz.input); unsigned int algolen; - const char* algoname = buf_getstring(keyblob, &algolen); + char* algoname = buf_getstring(keyblob, &algolen); - if (have_algo(algo, algolen, sshhostkey) == DROPBEAR_FAILURE) { + if (have_algo(algoname, algolen, sshhostkey) == DROPBEAR_FAILURE) { dropbear_exit("fuzzer imagined a bogus algorithm"); } fuzz_checkpubkey_line(line, 5, "/home/me/authorized_keys", @@ -36,6 +36,7 @@ buf_free(line); buf_free(keyblob); + m_free(algoname); m_malloc_free_epoch(1, 0); } else { m_malloc_free_epoch(1, 1); diff -r 4192f8831858 -r e6a5e51a29c9 fuzzer-pubkey.dict --- a/fuzzer-pubkey.dict Sun Mar 04 19:38:34 2018 +0800 +++ b/fuzzer-pubkey.dict Sun Mar 04 21:44:09 2018 +0800 @@ -1,8 +1,8 @@ -"ssh-rsa" -"ssh-dss" -"ecdsa-sha2-nistp256" -"ecdsa-sha2-nistp384" -"ecdsa-sha2-nistp521" +"\x00\x00\x00\x07ssh-rsa" +"\x00\x00\x00\x07ssh-dss" +"\x00\x00\x00\x13ecdsa-sha2-nistp256" +"\x00\x00\x00\x13ecdsa-sha2-nistp384" +"\x00\x00\x00\x13ecdsa-sha2-nistp521" "no-port-forwarding" "no-port-forwarding" "no-agent-forwarding"