comparison dbrandom.c @ 1774:833bf9947603

Fuzzing - get rid of "prefix" for streams Improved packet generation with sshpacketmutator
author Matt Johnston <matt@ucc.asn.au>
date Sun, 01 Nov 2020 23:44:58 +0800
parents c3ca130d193a
children 3f4cdf839a1a
comparison
equal deleted inserted replaced
1773:c3ca130d193a 1774:833bf9947603
149 #endif 149 #endif
150 } 150 }
151 151
152 #if DROPBEAR_FUZZ 152 #if DROPBEAR_FUZZ
153 void fuzz_seed(const unsigned char* dat, unsigned int len) { 153 void fuzz_seed(const unsigned char* dat, unsigned int len) {
154 static unsigned char keep_pool[SHA1_HASH_SIZE]; 154 hash_state hs;
155 static int once = 0; 155 sha1_init(&hs);
156 if (!once) { 156 sha1_process(&hs, "fuzzfuzzfuzz", strlen("fuzzfuzzfuzz"));
157 once = 1; 157 sha1_process(&hs, dat, len);
158 hash_state hs; 158 sha1_done(&hs, hashpool);
159 sha1_init(&hs);
160 sha1_process(&hs, "fuzzfuzzfuzz", strlen("fuzzfuzzfuzz"));
161 sha1_process(&hs, dat, len);
162 sha1_done(&hs, keep_pool);
163 }
164 memcpy(hashpool, keep_pool, sizeof(keep_pool));
165 counter = 0; 159 counter = 0;
166 donerandinit = 1; 160 donerandinit = 1;
167 } 161 }
168 #endif 162 #endif
169 163