comparison svr-auth.c @ 1347:b28624698130 fuzz

copy over some fuzzing code from AFL branch
author Matt Johnston <matt@ucc.asn.au>
date Fri, 12 May 2017 23:14:54 +0800
parents 9169e4e7cbee
children 5c2899e35b63
comparison
equal deleted inserted replaced
1346:78b7e0634117 1347:b28624698130
356 if (incrfail) { 356 if (incrfail) {
357 unsigned int delay; 357 unsigned int delay;
358 genrandom((unsigned char*)&delay, sizeof(delay)); 358 genrandom((unsigned char*)&delay, sizeof(delay));
359 /* We delay for 300ms +- 50ms */ 359 /* We delay for 300ms +- 50ms */
360 delay = 250000 + (delay % 100000); 360 delay = 250000 + (delay % 100000);
361 usleep(delay); 361 #ifndef DROPBEAR_FUZZ
362 if (!opts.fuzz.fuzzing) {
363 usleep(delay);
364 }
365 #endif
362 ses.authstate.failcount++; 366 ses.authstate.failcount++;
363 } 367 }
364 368
365 if (ses.authstate.failcount >= MAX_AUTH_TRIES) { 369 if (ses.authstate.failcount >= MAX_AUTH_TRIES) {
366 char * userstr; 370 char * userstr;