Files
Daniel UnderhayandOpenAI Codex 90525502f1 Add DESFire reader candidate-key probe
Add an opt-in simulator probe that checks a reader's AES authentication continuation against a supplied candidate and stops before the final card response. Expose the result through the firmware protocol and etest bench command, and document the evidence and handshake scope.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
2026-10-18 16:03:57 +11:00

46 lines
2.0 KiB
C

//-----------------------------------------------------------------------------
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// See LICENSE.txt for the text of the license.
//-----------------------------------------------------------------------------
// MIFARE DESFire tag simulation.
//
// Self contained: everything DESFire lives in desfiresim.c, including its own
// ISO 14443-A loop. It borrows the library helpers from iso14443a.c -- the
// precompiled activation answers, the receive call, the send calls -- but not
// SimulateIso14443aTag() itself, which is complicated enough without a DESFire
// state machine threaded through it.
//-----------------------------------------------------------------------------
#ifndef __DESFIRESIM_H
#define __DESFIRESIM_H
#include "common.h"
#include "pm3_cmd.h"
// Simulate the DESFire card image sitting in emulator memory, as put there by
// `hf mfdes eload`. Self contained: this owns its own ISO 14443-A loop rather
// than hooking into SimulateIso14443aTag(), which is busy enough already.
// Runs until the button is pressed or the client breaks the loop, and answers
// on CMD_HF_DESFIRE_SIMULATE.
void SimulateDesfireTag(PacketCommandNG *packet);
// Drive the same simulation from the host, one operation per packet and no
// RF: the command bytes arrive over USB and the answer goes back the same way.
// Answers on CMD_HF_DESFIRE_SIM_TEST, see desfire_sim_test_op_t.
#ifdef ENABLE_HFMFDESETEST
void DesfireSimTest(PacketCommandNG *packet);
#endif
#endif // __DESFIRESIM_H