mirror of
https://github.com/clearml/dropbear
synced 2025-02-12 07:25:30 +00:00
fix checkmac always failing pre-kex
--HG-- branch : fuzz
This commit is contained in:
parent
937e6cb91e
commit
723ec19eed
5
packet.c
5
packet.c
@ -372,9 +372,10 @@ static int checkmac() {
|
|||||||
|
|
||||||
#ifdef DROPBEAR_FUZZ
|
#ifdef DROPBEAR_FUZZ
|
||||||
if (fuzz.fuzzing) {
|
if (fuzz.fuzzing) {
|
||||||
// fail 1 in 1000 times to test error path
|
// 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);
|
unsigned int value = *((unsigned int*)&mac_bytes);
|
||||||
if (value % 1000 == 0) {
|
if (value % 2000 == 99) {
|
||||||
return DROPBEAR_FAILURE;
|
return DROPBEAR_FAILURE;
|
||||||
}
|
}
|
||||||
return DROPBEAR_SUCCESS;
|
return DROPBEAR_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user