proxmark3/client/cmdhfmfdes.h

83 lines
3.5 KiB
C
Raw Normal View History

2014-09-12 05:23:46 +08:00
//-----------------------------------------------------------------------------
// Iceman, 2014
2014-09-12 05:23:46 +08:00
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// High frequency MIFARE Desfire commands
//-----------------------------------------------------------------------------
#ifndef __MFDESFIRE_H
#define __MFDESFIRE_H
2014-09-12 05:23:46 +08:00
#include "common.h"
2019-04-08 18:58:26 +08:00
2014-09-12 05:23:46 +08:00
int CmdHFMFDes(const char *Cmd);
char *getCardSizeStr(uint8_t fsize);
char *getProtocolStr(uint8_t id);
char *getVersionStr(uint8_t major, uint8_t minor);
void getKeySettings(uint8_t *aid);
2014-09-18 18:38:31 +08:00
// Ev1 card limits
2019-03-10 06:35:06 +08:00
#define MAX_NUM_KEYS 0x0F
#define MAX_APPLICATION_COUNT 28
#define MAX_FILE_COUNT 32
#define MAX_FRAME_SIZE 60
#define FRAME_PAYLOAD_SIZE (MAX_FRAME_SIZE - 5)
2016-08-14 23:38:54 +08:00
#define NOT_YET_AUTHENTICATED 0xFF
2016-08-14 23:38:54 +08:00
// status- and error codes |
2019-03-10 06:35:06 +08:00
#define OPERATION_OK 0x00 // Successful operation
#define NO_CHANGES 0x0C // No changes done to backup files
2019-03-10 07:00:59 +08:00
// ,CommitTransaction/
// AbortTransaction not necessary
2019-03-10 06:35:06 +08:00
#define OUT_OF_EEPROM_ERROR 0x0E // Insufficient NV-Memory to
2019-03-10 07:00:59 +08:00
// complete command
2019-03-10 06:35:06 +08:00
#define ILLEGAL_COMMAND_CODE 0x1C // Command code not supported
#define INTEGRITY_ERROR 0x1E // CRC or MAC does not match data
2019-03-10 07:00:59 +08:00
// Padding bytes not valid
2019-03-10 06:35:06 +08:00
#define NO_SUCH_KEY 0x40 // Invalid key number specified
#define LENGTH_ERROR 0x7E // Length of command string invalid
#define PERMISSION_DENIED 0x9D // Current configuration status
2019-03-10 07:00:59 +08:00
// does not allow the requested
// command
2019-03-10 06:35:06 +08:00
#define PARAMETER_ERROR 0x9E // Value of the parameter(s) inval.
#define APPLICATION_NOT_FOUND 0xA0 // Requested AID not present on PIC
#define APPL_INTEGRITY_ERROR 0xA1 // [1] // Unrecoverable error within app-
2019-03-10 07:00:59 +08:00
// lication, app will be disabled
2019-03-10 06:35:06 +08:00
#define AUTHENTICATION_ERROR 0xAE // Current authentication status
2019-03-10 07:00:59 +08:00
// does not allow the requested
// command
2019-03-10 06:35:06 +08:00
#define ADDITIONAL_FRAME 0xAF // Additional data frame is
2019-03-10 07:00:59 +08:00
// expected to be sent
2019-03-10 06:35:06 +08:00
#define BOUNDARY_ERROR 0xBE // Attempt to read/write data from/
2019-03-10 07:00:59 +08:00
// to beyond the file's/record's
// limits. Attempt to exceed the
// limits of a value file.
2019-03-10 06:35:06 +08:00
#define PICC_INTEGRITY_ERROR 0xC1 // [1] // Unrecoverable error within PICC
2019-03-10 07:00:59 +08:00
// ,PICC will be disabled
2019-03-10 06:35:06 +08:00
#define COMMAND_ABORTED 0xCA // Previous Command was not fully
2019-03-10 07:00:59 +08:00
// completed Not all Frames were
// requested or provided by PCD
2019-03-10 06:35:06 +08:00
#define PICC_DISABLED_ERROR 0xCD // [1] // PICC was disabled by an unrecoverable error
#define COUNT_ERROR 0xCE // Number of Applications limited
2019-03-10 07:00:59 +08:00
// to 28, no additional
// CreateApplication possible
2019-03-10 06:35:06 +08:00
#define DUPLICATE_ERROR 0xDE // Creation of file/application
2019-03-10 07:00:59 +08:00
// failed because file/application
// with same number already exists
2019-03-10 06:35:06 +08:00
#define EEPROM_ERROR 0xEE // [1] // Could not complete NV-write
2019-03-10 07:00:59 +08:00
// operation due to loss of power,
// internal backup/rollback
// mechanism activated
2019-03-10 06:35:06 +08:00
#define FILE_NOT_FOUND_ERROR 0xF0 // Specified file number does not
2019-03-10 07:00:59 +08:00
// exist
2019-03-10 06:35:06 +08:00
#define FILE_INTEGRITY_ERROR 0xF1 // [1] // Unrecoverable error within file,
2019-03-10 07:00:59 +08:00
// file will be disabled
2016-08-14 23:38:54 +08:00
//
// [1] These errors are not expected to appear during normal operation
2019-03-10 06:35:06 +08:00
#endif