- fuzzer-pubkey needs to free algoname, fix build

- improve dictionary with lengths
This commit is contained in:
Matt Johnston 2018-03-04 21:44:09 +08:00
parent 129c440362
commit f7dedab4a7
2 changed files with 8 additions and 7 deletions

View File

@ -25,9 +25,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
buffer *keyblob = buf_getstringbuf(fuzz.input); buffer *keyblob = buf_getstringbuf(fuzz.input);
unsigned int algolen; 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"); dropbear_exit("fuzzer imagined a bogus algorithm");
} }
fuzz_checkpubkey_line(line, 5, "/home/me/authorized_keys", fuzz_checkpubkey_line(line, 5, "/home/me/authorized_keys",
@ -36,6 +36,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
buf_free(line); buf_free(line);
buf_free(keyblob); buf_free(keyblob);
m_free(algoname);
m_malloc_free_epoch(1, 0); m_malloc_free_epoch(1, 0);
} else { } else {
m_malloc_free_epoch(1, 1); m_malloc_free_epoch(1, 1);

View File

@ -1,8 +1,8 @@
"ssh-rsa" "\x00\x00\x00\x07ssh-rsa"
"ssh-dss" "\x00\x00\x00\x07ssh-dss"
"ecdsa-sha2-nistp256" "\x00\x00\x00\x13ecdsa-sha2-nistp256"
"ecdsa-sha2-nistp384" "\x00\x00\x00\x13ecdsa-sha2-nistp384"
"ecdsa-sha2-nistp521" "\x00\x00\x00\x13ecdsa-sha2-nistp521"
"no-port-forwarding" "no-port-forwarding"
"no-port-forwarding" "no-port-forwarding"
"no-agent-forwarding" "no-agent-forwarding"