diff 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
line wrap: on
line diff
--- a/dbrandom.c	Sun Nov 01 14:01:37 2020 +0800
+++ b/dbrandom.c	Sun Nov 01 23:44:58 2020 +0800
@@ -151,17 +151,11 @@
 
 #if DROPBEAR_FUZZ
 void fuzz_seed(const unsigned char* dat, unsigned int len) {
-	static unsigned char keep_pool[SHA1_HASH_SIZE];
-	static int once = 0;
-	if (!once) {
-		once = 1;
-		hash_state hs;
-		sha1_init(&hs);
-		sha1_process(&hs, "fuzzfuzzfuzz", strlen("fuzzfuzzfuzz"));
-		sha1_process(&hs, dat, len);
-		sha1_done(&hs, keep_pool);
-	}
-	memcpy(hashpool, keep_pool, sizeof(keep_pool));
+	hash_state hs;
+	sha1_init(&hs);
+	sha1_process(&hs, "fuzzfuzzfuzz", strlen("fuzzfuzzfuzz"));
+	sha1_process(&hs, dat, len);
+	sha1_done(&hs, hashpool);
 	counter = 0;
 	donerandinit = 1;
 }