mirror of
https://github.com/clearml/dropbear
synced 2025-02-26 05:38:53 +00:00
clean some fuzzing conditionals
--HG-- branch : fuzz
This commit is contained in:
parent
5f2447edbb
commit
5ebc48b3f2
@ -146,7 +146,7 @@ void addrandom(const unsigned char * buf, unsigned int len)
|
|||||||
hash_state hs;
|
hash_state hs;
|
||||||
|
|
||||||
#if DROPBEAR_FUZZ
|
#if DROPBEAR_FUZZ
|
||||||
if (fuzz.fuzzing || fuzz.recordf) {
|
if (fuzz.fuzzing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -164,7 +164,7 @@ void addrandom(const unsigned char * buf, unsigned int len)
|
|||||||
static void write_urandom()
|
static void write_urandom()
|
||||||
{
|
{
|
||||||
#if DROPBEAR_FUZZ
|
#if DROPBEAR_FUZZ
|
||||||
if (fuzz.fuzzing || fuzz.recordf) {
|
if (fuzz.fuzzing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -204,7 +204,7 @@ void seedrandom() {
|
|||||||
clock_t clockval;
|
clock_t clockval;
|
||||||
|
|
||||||
#if DROPBEAR_FUZZ
|
#if DROPBEAR_FUZZ
|
||||||
if (fuzz.fuzzing || fuzz.recordf) {
|
if (fuzz.fuzzing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
3
fuzz.h
3
fuzz.h
@ -43,9 +43,6 @@ void fuzz_fake_send_kexdh_reply(void);
|
|||||||
struct dropbear_fuzz_options {
|
struct dropbear_fuzz_options {
|
||||||
int fuzzing;
|
int fuzzing;
|
||||||
|
|
||||||
// to record an unencrypted stream
|
|
||||||
FILE* recordf;
|
|
||||||
|
|
||||||
// fuzzing input
|
// fuzzing input
|
||||||
buffer *input;
|
buffer *input;
|
||||||
struct dropbear_cipher recv_cipher;
|
struct dropbear_cipher recv_cipher;
|
||||||
|
@ -396,12 +396,11 @@ void send_msg_userauth_failure(int partial, int incrfail) {
|
|||||||
/* We delay for 300ms +- 50ms */
|
/* We delay for 300ms +- 50ms */
|
||||||
delay = 250000 + (delay % 100000);
|
delay = 250000 + (delay % 100000);
|
||||||
#if DROPBEAR_FUZZ
|
#if DROPBEAR_FUZZ
|
||||||
if (!fuzz.fuzzing) {
|
if (!fuzz.fuzzing)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
usleep(delay);
|
usleep(delay);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
usleep(delay);
|
|
||||||
#endif
|
|
||||||
ses.authstate.failcount++;
|
ses.authstate.failcount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user