comparison fuzzer-pubkey.c @ 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 cdfab509c392
children 252b406d0e9a
comparison
equal deleted inserted replaced
1585:4192f8831858 1586:e6a5e51a29c9
23 if (setjmp(fuzz.jmp) == 0) { 23 if (setjmp(fuzz.jmp) == 0) {
24 buffer *line = buf_getstringbuf(fuzz.input); 24 buffer *line = buf_getstringbuf(fuzz.input);
25 buffer *keyblob = buf_getstringbuf(fuzz.input); 25 buffer *keyblob = buf_getstringbuf(fuzz.input);
26 26
27 unsigned int algolen; 27 unsigned int algolen;
28 const char* algoname = buf_getstring(keyblob, &algolen); 28 char* algoname = buf_getstring(keyblob, &algolen);
29 29
30 if (have_algo(algo, algolen, sshhostkey) == DROPBEAR_FAILURE) { 30 if (have_algo(algoname, algolen, sshhostkey) == DROPBEAR_FAILURE) {
31 dropbear_exit("fuzzer imagined a bogus algorithm"); 31 dropbear_exit("fuzzer imagined a bogus algorithm");
32 } 32 }
33 fuzz_checkpubkey_line(line, 5, "/home/me/authorized_keys", 33 fuzz_checkpubkey_line(line, 5, "/home/me/authorized_keys",
34 algoname, algolen, 34 algoname, algolen,
35 keyblob->data, keyblob->len); 35 keyblob->data, keyblob->len);
36 36
37 buf_free(line); 37 buf_free(line);
38 buf_free(keyblob); 38 buf_free(keyblob);
39 m_free(algoname);
39 m_malloc_free_epoch(1, 0); 40 m_malloc_free_epoch(1, 0);
40 } else { 41 } else {
41 m_malloc_free_epoch(1, 1); 42 m_malloc_free_epoch(1, 1);
42 TRACE(("dropbear_exit longjmped")) 43 TRACE(("dropbear_exit longjmped"))
43 /* dropbear_exit jumped here */ 44 /* dropbear_exit jumped here */