Skip to content

Commit

Permalink
Fix for early key reuse in dictionary attack state machine
Browse files Browse the repository at this point in the history
  • Loading branch information
noproto committed Jan 4, 2025
1 parent acdc5c9 commit 56fe7b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/nfc/protocols/mf_classic/mf_classic_poller.c
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,8 @@ NfcCommand mf_classic_poller_handler_nested_controller(MfClassicPoller* instance
sizeof(MfClassicKey)) :
NULL;
}
if((is_weak || is_last_iter_for_hard_key) && dict_attack_ctx->nested_nonce.count > 0) {
if((is_weak && (dict_attack_ctx->nested_nonce.count == 1)) ||
(is_last_iter_for_hard_key && (dict_attack_ctx->nested_nonce.count == 8))) {
// Key verify and reuse
dict_attack_ctx->nested_phase = MfClassicNestedPhaseDictAttackVerify;
dict_attack_ctx->auth_passed = false;
Expand Down

0 comments on commit 56fe7b0

Please sign in to comment.