mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
Fix to be able to compile normal(ish) binaries with --enable-fuzz
--HG-- branch : fuzz
This commit is contained in:
8
packet.c
8
packet.c
@@ -79,8 +79,8 @@ void write_packet() {
|
||||
it's likely to be necessary */
|
||||
#if DROPBEAR_FUZZ
|
||||
if (fuzz.fuzzing) {
|
||||
// pretend to write one packet at a time
|
||||
// TODO(fuzz): randomise amount written based on the fuzz input
|
||||
/* pretend to write one packet at a time */
|
||||
/* TODO(fuzz): randomise amount written based on the fuzz input */
|
||||
written = iov[0].iov_len;
|
||||
}
|
||||
else
|
||||
@@ -368,8 +368,8 @@ static int checkmac() {
|
||||
|
||||
#if DROPBEAR_FUZZ
|
||||
if (fuzz.fuzzing) {
|
||||
// fail 1 in 2000 times to test error path.
|
||||
// note that mac_bytes is all zero prior to kex, so don't test ==0 !
|
||||
/* fail 1 in 2000 times to test error path.
|
||||
note that mac_bytes is all zero prior to kex, so don't test ==0 ! */
|
||||
unsigned int value = *((unsigned int*)&mac_bytes);
|
||||
if (value % 2000 == 99) {
|
||||
return DROPBEAR_FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user