]> git.zerfleddert.de Git - proxmark3-svn/blob - armsrc/emvdataels.c
FIX: 'lf hitag2' forgot to add some of @marshmellow42 's changes. Lf search should...
[proxmark3-svn] / armsrc / emvdataels.c
1 //Data elements for EMV transactions.
2 #include <stdint.h>
3 #ifndef __EMVDATAELS_H
4 #define __EMVDATAELS_H
5 #include "emvdataels.h"
6 //Known AIDs
7
8 typedef struct{
9 uint8_t tag[2];
10 char description[255];
11 }tagdescription;
12
13 const uint8_t AID_VISA[] = {0xa0,0x00,0x00,0x00,0x03};
14 const uint8_t AID_VISA_DB[] = {0xa0,0x00,0x00,0x00,0x03,0x10,0x10};
15 const uint8_t AID_VISA_C[] = {0xa0,0x00,0x00,0x00,0x03,0x10,0x10,0x01};
16 const uint8_t AID_VISA_D[] = {0xa0,0x00,0x00,0x00,0x03,0x10,0x10,0x02};
17 const uint8_t AID_VISA_E[] = {0xa0,0x00,0x00,0x00,0x03,0x20,0x10};
18 const uint8_t AID_VISA_I[] = {0xa0,0x00,0x00,0x00,0x03,0x30,0x10};
19 const uint8_t AID_VISA_P[] = {0xa0,0x00,0x00,0x00,0x03,0x80,0x10};
20 const uint8_t AID_VISA_ATM[]= {0xa0,0x00,0x00,0x00,0x03,0x99,0x99,0x10};
21 const uint8_t AID_MASTERCARD[]= {0xa0,0x00,0x00,0x00,0x04,0x10,0x10};
22 const uint8_t AID_MAESTRO[] = {0xa0,0x00,0x00,0x00,0x04,0x30,0x60};
23 const uint8_t AID_MAESTRO_UK[]= {0xa0,0x00,0x00,0x00,0x05,0x00,0x01};
24 const uint8_t AID_MAESTRO_TEST[]={0xb0,0x12,0x34,0x56,0x78};
25 const uint8_t AID_SELF_SERVICE[]={0xa0,0x00,0x00,0x00,0x24,0x01};
26 const uint8_t AID_AMEX[] = {0xa0,0x00,0x00,0x00,0x25};
27 const uint8_t AID_EXPRESSPAY[]= {0xa0,0x00,0x00,0x00,0x25,0x01,0x07,0x01};
28 const uint8_t AID_LINK[] = {0xa0,0x00,0x00,0x00,0x29,0x10,0x10};
29 const uint8_t AID_ALIAS[] = {0xa0,0x00,0x00,0x00,0x29,0x10,0x10};
30
31 //Master data file for PSE
32 //const uint8_t DF_PSE[] = {0x32, 0x50, 0x41, 0x59, 0x2E, 0x53, 0x59, 0x53, 0x2E, 0x44, 0x44, 0x46, 0x30, 0x31};
33 const uint8_t DF_PSE[] = {0x32, 0x50, 0x41, 0x59, 0x2E, 0x53, 0x59, 0x53, 0x2E, 0x44, 0x44, 0x46, 0x30, 0x31};
34
35 //TAGS
36
37 //SW1 return values
38 const uint8_t SW1_RESPONSE_BYTES[] = {0x61};
39 const uint8_t SW1_WRONG_LENGTH[] = {0x6c};
40 const uint8_t SW12_OK[] = {0x90,0x00};
41 const uint8_t SW12_NOT_SUPPORTED[] = {0x6a,0x81};
42 const uint8_t SW12_NOT_FOUND[] = {0x6a,0x82};
43 const uint8_t SW12_COND_NOT_SAT[] = {0x69,0x83};
44 const uint8_t PIN_BLOCKED[] = {0x69,0x84};
45 const uint8_t PIN_BLOCKED2[] = {0x69,0x84};
46 const uint8_t PIN_WRONG[] = {0x63};
47
48 const tagdescription EMV_TAG_LIST[] = {
49 {"\x4f\x00","Application Identifier (AID)"},
50 {"\x50\x00","Application Label"},
51 {"\x57\x00","Track 2 Equivalent Data"},
52 {"\x5a\x00","Application Primary Account Number (PAN)"},
53 {"\x6f\x00","File Control Information (FCI) Template"},
54 {"\x70\x00","Record Template"},
55 {"\x77\x00","response message template format 2"},
56 {"\x80\x00","response message template format 1"},
57 {"\x82\x00","application interchange profile"},
58 {"\x83\x00","command template"},
59 {"\x84\x00","df name"},
60 {"\x86\x00","issuer script command"},
61 {"\x87\x00","application priority indicator"},
62 {"\x88\x00","short file identifier"},
63 {"\x8a\x00","authorisation response code"},
64 {"\x8c\x00","card risk management data object list 1 (cdol1)"},
65 {"\x8d\x00","card risk management data object list 2 (cdol2)"},
66 {"\x8e\x00","cardholder verification method (cvm) list"},
67 {"\x8f\x00","certification authority public key index"},
68 {"\x93\x00","signed static application data"},
69 {"\x94\x00","application file locator"},
70 {"\x95\x00","terminal verification results"},
71 {"\x97\x00","transaction certificate data object list (tdol)",},
72 {"\x9c\x00","transaction type"},
73 {"\x9d\x00","directory definition file"},
74 {"\xa5\x00","proprietary information"},
75 {"\x5f\x20","cardholder name"},
76 {"\x5f\x24","application expiration date yymmdd"},
77 {"\x5f\x25","application effective date yymmdd"},
78 {"\x5f\x28","issuer country code"},
79 {"\x5f\x2a","transaction currency code"},
80 {"\x5f\x2d","language preference"},
81 {"\x5f\x30","service code"},
82 {"\x5f\x34","application primary account number (pan) sequence number"},
83 {"\x5f\x50","issuer url"},
84 {"\x92\x00","issuer public key remainder"},
85 {"\x9a\x00","transaction date"},
86 {"\x9f\x02","amount, authorised (numeric)"},
87 {"\x9f\x03","amount, other (numeric)"},
88 {"\x9f\x04","amount, other (binary)"},
89 {"\x9f\x05","application discretionary data"},
90 {"\x9f\x07","application usage control"},
91 {"\x9f\x08","application version number"},
92 {"\x9f\x0d","issuer action code - default"},
93 {"\x9f\x0e","issuer action code - denial"},
94 {"\x9f\x0f","issuer action code - online"},
95 {"\x9f\x11","issuer code table index"},
96 {"\x9f\x12","application preferred name"},
97 {"\x9f\x1a","terminal country code"},
98 {"\x9f\x1f","track 1 discretionary data"},
99 {"\x9f\x20","track 2 discretionary data"},
100 {"\x9f\x26","application cryptogram"},
101 {"\x9f\x32","issuer public key exponent"},
102 {"\x9f\x36","application transaction counter"},
103 {"\x9f\x37","unpredictable number"},
104 {"\x9f\x38","processing options data object list (pdol)"},
105 {"\x9f\x42","application currency code"},
106 {"\x9f\x44","application currency exponent"},
107 {"\x9f\x4a","static data authentication tag list"},
108 {"\x9f\x4d","log entry"},
109 {"\x9f\x66","card production life cycle"},
110 {"\xbf\x0c","file control information (fci) issuer discretionary data"}
111 };
112
113 //AIP bitmasks details
114 #define AIP_CHIP_SUPPORTED 0x80
115 #define AIP_MSR_SUPPORTED 0x40
116
117 #define AIP_SDA_SUPPORTED 0x40
118 #define AIP_DDA_SUPPORTED 0x20
119 #define AIP_CARDHOLDER_VERIFICATION 0x10
120 #define AIP_TERMINAL_RISK 0x08
121 #define AIP_ISSUER_AUTH 0x04
122 #define AIP_CDA_SUPPORTED 0x01
123
124 //human readable error messages
125
126
127 #endif //__EMVDATAELS_H
Impressum, Datenschutz