From 632b6db5f91018c5a503d028906141dc9b229836 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Tue, 30 Nov 2021 13:05:53 +0100 Subject: [PATCH] Allow user to override nonce_error_corrections regardless of information from message_pair --- src/modules/module_22000.c | 24 ++++++++++++------------ src/modules/module_22001.c | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/modules/module_22000.c b/src/modules/module_22000.c index 382ace959..ffa523ecb 100644 --- a/src/modules/module_22000.c +++ b/src/modules/module_22000.c @@ -1305,23 +1305,23 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, else { wpa->nonce_error_corrections = NONCE_ERROR_CORRECTIONS; - } - if (wpa->message_pair & (1 << 4)) - { - // ap-less attack detected, nc not needed - - wpa->nonce_error_corrections = 0; - } - else - { - if (wpa->message_pair & (1 << 7)) + if (wpa->message_pair & (1 << 4)) { - // replaycount not checked, nc needed + // ap-less attack detected, nc not needed + + wpa->nonce_error_corrections = 0; } else { - wpa->nonce_error_corrections = 0; + if (wpa->message_pair & (1 << 7)) + { + // replaycount not checked, nc needed + } + else + { + wpa->nonce_error_corrections = 0; + } } } diff --git a/src/modules/module_22001.c b/src/modules/module_22001.c index f9aed27e2..f8f1bf2e2 100644 --- a/src/modules/module_22001.c +++ b/src/modules/module_22001.c @@ -1305,23 +1305,23 @@ int module_hash_decode_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, else { wpa->nonce_error_corrections = NONCE_ERROR_CORRECTIONS; - } - if (wpa->message_pair & (1 << 4)) - { - // ap-less attack detected, nc not needed - - wpa->nonce_error_corrections = 0; - } - else - { - if (wpa->message_pair & (1 << 7)) + if (wpa->message_pair & (1 << 4)) { - // replaycount not checked, nc needed + // ap-less attack detected, nc not needed + + wpa->nonce_error_corrections = 0; } else { - wpa->nonce_error_corrections = 0; + if (wpa->message_pair & (1 << 7)) + { + // replaycount not checked, nc needed + } + else + { + wpa->nonce_error_corrections = 0; + } } }