Commit 1ec97676 by developer4

beta 0.2

Fixed ATC parsing (Transaction Log counter element).
parent 24b5925e
......@@ -5,7 +5,7 @@
#ifndef INI_H_
#define INI_H_
#define APP_VERSION "0.1"
#define APP_VERSION "0.2"
#define EXIT_ON_WRONG_FW_DEPENDENCY
#define MIN_DEPEND_FW_VER_MAJOR 3
......
......@@ -469,22 +469,6 @@ void tryEmvPseCardRead(const char *df_name, const char *szTitlePse) {
tail = tail->next;
}
// Ovde se mora, ako postoji PDOL, sračunati dužinu bajtova i to poslati u narednoj komandi.
// Ako PDOL sadrži Terminal Capabilities Tag '9F33' onda se po mnogima mogu poslati sve nule.
// Ako PDOL sadrži Terminal Transaction Qualifiers (TTQ) Tag '9F66' onda tu treba postaviti bar "28 00 00 00"
// da ne bi kartica vratila grešku "69 85" = "Conditions of use not satisfied". Radi i sa
// "20 00 00 00".
// Posle ovoga pronaći Application File Locator (AFL) Tag '94' za dalje parsiranje - "sfi" & "record range".
// Ako ne postoji PDOL, Onda se šalje GPO komanda u formi: "80 A8 00 00 02 83 00 00" nakon koje se očekuje
// da kartica vrati Response Message Template Format 1 Tag '80' {Contains the data objects (without tags and lengths)
// returned by the ICC in response to a command}. U tom slučaju prva dva bajta u okviru vraćene binarne vrednosti
// Taga '80' predstavljaju AIP a ostatak AFL u grupama po 4 bajta koje treba parsirati isto kao Tag '94':
// - prvi bajt je SFI šiftovan 3 bita levo (za read record cmd samo treba još orovati sa 4)
// - drugi bajt je prvi record tog SFI-a
// - treći bajt je poslednji record tog SFI-a
// - broj zapisa koji učestvuju u "offline data authentication" tog SFI-a počevši od prvog record-a.
// Ako kartica ne vrati Tag '80' onda treba očekivati da vrati tagove '82' za AIP i '94' za AFL.
printf("\n %d. Formating \"Get Processing Options\" instruction (checking PDOL).\n", cnt++);
emv_status = formatGetProcessingOptionsDataField(temp, &gpo_data_field, &gpo_data_field_size);
if (emv_status) {
......@@ -821,6 +805,7 @@ void tryEmvPseLog(const char *df_name, const char *szTitlePse)
{
uint32_t tmp_uint32;
uint16_t ATCounter = 0;
uint16_t ATCounter_pos;
uint16_t TransactionDate_pos;
uint16_t TransactionTime_pos;
......@@ -855,7 +840,9 @@ void tryEmvPseLog(const char *df_name, const char *szTitlePse)
printf(" | ");
if (ATCounter_exist) {
printf("%5d |", bin_bcd_to_i(&log_list_ptr[ATCounter_pos], ATCounter_len));
if (ATCounter_len == 2)
ATCounter = ((uint16_t)(log_list_ptr[ATCounter_pos]) << 8) + log_list_ptr[ATCounter_pos + 1];
printf("%5d |", ATCounter);
} else {
printf(" |");
}
......@@ -923,28 +910,3 @@ void tryEmvPse2Log(void)
tryEmvPseLog("2PAY.SYS.DDF01", "PSE2");
}
//------------------------------------------------------------------------------
// char *sz_hex_r_apdu;
/* status = ApduCommand("80 A8 00 00 15 83 13 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", &sz_hex_r_apdu, sw);
if (status != UFR_OK) {
printf(" Error while executing APDU command, uFR status is: 0x%08X\n", status);
break;
} else {
Ne = strlen(sz_hex_r_apdu) / 2;
if (Ne) {
printf(" APDU command executed: response data length = %d bytes\n", (int) Ne);
printf(" [R] %s\n", sz_hex_r_apdu);
}
printf(" [SW] ");
print_hex_ln(sw, 2, " ");
if (*sw16_ptr != 0x90) {
printf(" Could not continue execution due to an APDU error.\n");
} else {
hex2bin(r_apdu, sz_hex_r_apdu);
emv_status = newEmvTag(&temp, r_apdu, Ne, false);
...CHECK status...
tail->next = temp;
tail = tail->next;
}
}
*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment