summaryrefslogtreecommitdiffhomepage
path: root/dbrandom.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2020-11-01 23:44:58 +0800
committerMatt Johnston <matt@ucc.asn.au>2020-11-01 23:44:58 +0800
commit121e6e620269ff3eef7ef46d6ab7057e56317588 (patch)
tree029784932a0b530cc753da437528d69f6027fdb1 /dbrandom.c
parent1b6e16ae7c9105e35dd14464b8ce785c613ab6e2 (diff)
Fuzzing - get rid of "prefix" for streams
Improved packet generation with sshpacketmutator
Diffstat (limited to 'dbrandom.c')
-rw-r--r--dbrandom.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/dbrandom.c b/dbrandom.c
index 7aaa42b..3f21593 100644
--- a/dbrandom.c
+++ b/dbrandom.c
@@ -151,17 +151,11 @@ static void write_urandom()
#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;
}