Skip to content

Commit

Permalink
mfkey64: abort if key recovery failed
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Sep 14, 2024
1 parent febaa64 commit 17bfed9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/mfc/card_reader/mfkey64.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ int main(int argc, char *argv[]) {
printf(" ks3: %08x\n", ks3);

revstate = lfsr_recovery64(ks2, ks3);
if ((revstate->odd == 0) && (revstate->even == 0)) {
printf("\nKey not found :(\n\n");
crypto1_destroy(revstate);
return -1;
}

// Decrypting communication using keystream if presented
if (argc > 6) {
Expand Down

0 comments on commit 17bfed9

Please sign in to comment.