changeset 1586:e6a5e51a29c9

- fuzzer-pubkey needs to free algoname, fix build - improve dictionary with lengths
author Matt Johnston <matt@ucc.asn.au>
date Sun, 04 Mar 2018 21:44:09 +0800
parents 4192f8831858
children b579ec254988
files fuzzer-pubkey.c fuzzer-pubkey.dict
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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"