fix one too small
[RRG-proxmark3.git] / client / src / cmdhfemrtd.h
blob962501331374e02bcef6ac9201764758591f80b1
1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
16 // High frequency Electronic Machine Readable Travel Document commands
17 //-----------------------------------------------------------------------------
19 #ifndef CMDHFEMRTD_H__
20 #define CMDHFEMRTD_H__
22 #include "common.h"
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 typedef struct emrtd_dg_s {
29 uint8_t tag;
30 uint8_t dgnum;
31 uint16_t fileid;
32 const char *filename;
33 const char *desc;
34 bool pace;
35 bool eac; // EAC only (we can't dump these)
36 bool required; // some are required only if PACE
37 bool fastdump; // fast to dump
38 int (*parser)(uint8_t *data, size_t datalen);
39 int (*dumper)(uint8_t *data, size_t datalen, const char *path);
40 } emrtd_dg_t;
42 typedef struct emrtd_hashalg_s {
43 const char *name;
44 int (*hasher)(uint8_t *datain, int datainlen, uint8_t *dataout);
45 size_t hashlen;
46 size_t descriptorlen;
47 const uint8_t descriptor[15];
48 } emrtd_hashalg_t;
50 typedef struct emrtd_pacealg_s {
51 const char *name;
52 int (*keygenerator)(uint8_t *datain, int datainlen, uint8_t *dataout);
53 const uint8_t descriptor[10];
54 } emrtd_pacealg_t;
56 // Standardized Domain Parameters
57 typedef struct emrtd_pacesdp_s {
58 uint8_t id;
59 const char *name;
60 size_t size;
61 } emrtd_pacesdp_t;
63 int CmdHFeMRTD(const char *Cmd);
65 int dumpHF_EMRTD(char *documentnumber, char *dob, char *expiry, bool BAC_available, const char *path);
66 int infoHF_EMRTD(char *documentnumber, char *dob, char *expiry, bool BAC_available, bool only_fast);
67 int infoHF_EMRTD_offline(const char *path);
69 #ifdef __cplusplus
71 #endif
72 #endif