Skip to content

Commit

Permalink
simplify logic and continue to check use_elite even in default mode key
Browse files Browse the repository at this point in the history
  • Loading branch information
iceman1001 committed Oct 1, 2024
1 parent 01a191f commit f4d2d2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/src/cmdhficlass.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke

if (got_krki) {
HFiClassCalcDivKey(configcard.csn, card_key, configcard.key_d, use_elite);
} else if (!got_krki) {
} else {
// defaulting to AA1 ki 0
HFiClassCalcDivKey(configcard.csn, iClass_Key_Table[0], configcard.key_d, use_elite);
}
Expand All @@ -313,9 +313,9 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke
// calc diversified key for selected card
if (got_krki) {
HFiClassCalcDivKey(cc->csn, card_key, cc->key_d, use_elite);
} else if (!got_krki) {
} else {
// defaulting to AA1 ki 0
HFiClassCalcDivKey(cc->csn, iClass_Key_Table[0], cc->key_d, false);
HFiClassCalcDivKey(cc->csn, iClass_Key_Table[0], cc->key_d, use_elite);
}
} else {
PrintAndLogEx(FAILED, "failed to read a card");
Expand Down

0 comments on commit f4d2d2e

Please sign in to comment.