comparison svr-auth.c @ 1449:ea150e3e95a6 fuzz

fix DROBPEAR_FUZZ auth delay
author Matt Johnston <matt@ucc.asn.au>
date Fri, 30 Jun 2017 21:10:57 +0800
parents 3fdd8c5a0195
children 4afde04f0607
comparison
equal deleted inserted replaced
1437:871b18fd7065 1449:ea150e3e95a6
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 #ifndef DROPBEAR_FUZZ 361 #ifdef DROPBEAR_FUZZ
362 if (!fuzz.fuzzing) { 362 if (!fuzz.fuzzing) {
363 usleep(delay); 363 usleep(delay);
364 } 364 }
365 #else
366 usleep(delay);
365 #endif 367 #endif
366 ses.authstate.failcount++; 368 ses.authstate.failcount++;
367 } 369 }
368 370
369 if (ses.authstate.failcount >= MAX_AUTH_TRIES) { 371 if (ses.authstate.failcount >= MAX_AUTH_TRIES) {