mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
Fix v1/v2 backdoor nonce collection
This commit is contained in:
@@ -1272,7 +1272,7 @@ NfcCommand mf_classic_poller_handler_nested_collect_nt_enc(MfClassicPoller* inst
|
|||||||
MfClassicAuthContext auth_ctx = {};
|
MfClassicAuthContext auth_ctx = {};
|
||||||
MfClassicError error;
|
MfClassicError error;
|
||||||
|
|
||||||
bool use_backdoor_for_initial_auth = (dict_attack_ctx->backdoor != MfClassicBackdoorNone);
|
bool use_backdoor = (dict_attack_ctx->backdoor != MfClassicBackdoorNone);
|
||||||
bool is_weak = dict_attack_ctx->prng_type == MfClassicPrngTypeWeak;
|
bool is_weak = dict_attack_ctx->prng_type == MfClassicPrngTypeWeak;
|
||||||
uint8_t nonce_pair_index = is_weak ? (dict_attack_ctx->nested_target_key % 2) : 0;
|
uint8_t nonce_pair_index = is_weak ? (dict_attack_ctx->nested_target_key % 2) : 0;
|
||||||
uint8_t nt_enc_per_collection =
|
uint8_t nt_enc_per_collection =
|
||||||
@@ -1295,7 +1295,7 @@ NfcCommand mf_classic_poller_handler_nested_collect_nt_enc(MfClassicPoller* inst
|
|||||||
&dict_attack_ctx->nested_known_key,
|
&dict_attack_ctx->nested_known_key,
|
||||||
dict_attack_ctx->nested_known_key_type,
|
dict_attack_ctx->nested_known_key_type,
|
||||||
&auth_ctx,
|
&auth_ctx,
|
||||||
use_backdoor_for_initial_auth);
|
use_backdoor);
|
||||||
|
|
||||||
if(error != MfClassicErrorNone) {
|
if(error != MfClassicErrorNone) {
|
||||||
FURI_LOG_E(TAG, "Failed to perform full authentication");
|
FURI_LOG_E(TAG, "Failed to perform full authentication");
|
||||||
@@ -1317,7 +1317,7 @@ NfcCommand mf_classic_poller_handler_nested_collect_nt_enc(MfClassicPoller* inst
|
|||||||
&dict_attack_ctx->nested_known_key,
|
&dict_attack_ctx->nested_known_key,
|
||||||
dict_attack_ctx->nested_known_key_type,
|
dict_attack_ctx->nested_known_key_type,
|
||||||
&auth_ctx,
|
&auth_ctx,
|
||||||
false,
|
use_backdoor,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
if(error != MfClassicErrorNone) {
|
if(error != MfClassicErrorNone) {
|
||||||
|
|||||||
Reference in New Issue
Block a user