72 lines
2.3 KiB
C
72 lines
2.3 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.
|
|
//-----------------------------------------------------------------------------
|
|
// High frequency Electronic Machine Readable Travel Document commands
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef CMDHFEMRTD_H__
|
|
#define CMDHFEMRTD_H__
|
|
|
|
#include "common.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct emrtd_dg_s {
|
|
uint8_t tag;
|
|
uint8_t dgnum;
|
|
uint16_t fileid;
|
|
const char *filename;
|
|
const char *desc;
|
|
bool pace;
|
|
bool eac; // EAC only (we can't dump these)
|
|
bool required; // some are required only if PACE
|
|
bool fastdump; // fast to dump
|
|
int (*parser)(uint8_t *data, size_t datalen);
|
|
int (*dumper)(uint8_t *data, size_t datalen, const char *path);
|
|
} emrtd_dg_t;
|
|
|
|
typedef struct emrtd_hashalg_s {
|
|
const char *name;
|
|
int (*hasher)(uint8_t *datain, int datainlen, uint8_t *dataout);
|
|
size_t hashlen;
|
|
size_t descriptorlen;
|
|
const uint8_t descriptor[15];
|
|
} emrtd_hashalg_t;
|
|
|
|
// Everything needed to authenticate to a document, either with BAC or with PACE
|
|
typedef struct emrtd_auth_s {
|
|
char documentnumber[10];
|
|
char dob[7];
|
|
char expiry[7];
|
|
char can[15];
|
|
bool mrz_available;
|
|
bool can_available;
|
|
bool force_pace; // fail rather than falling back to BAC
|
|
bool force_bac; // skip PACE even when EF_CardAccess is present
|
|
} emrtd_auth_t;
|
|
|
|
int CmdHFeMRTD(const char *Cmd);
|
|
|
|
int dumpHF_EMRTD(const emrtd_auth_t *auth, const char *path);
|
|
int infoHF_EMRTD(const emrtd_auth_t *auth, bool only_fast);
|
|
int infoHF_EMRTD_offline(const char *path);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|