diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index cf157017e..db20bcb8b 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -519,14 +519,14 @@ if (LZ4_FOUND) endif (LZ4_FOUND) if (NOT SKIPGD EQUAL 1 AND GD_FOUND) - set(ADDITIONAL_DIRS ${GD_INCLUDE_DIRS} ${ADDITIONAL_DIRS}) - set(ADDITIONAL_LNK ${GD_LIBRARIES} ${ADDITIONAL_LNK}) - set(ADDITIONAL_LNKDIRS ${GD_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS}) - set(TARGET_SOURCES - ${PM3_ROOT}/client/src/imgutils.c - ${PM3_ROOT}/client/src/cmdhfwaveshare.c - ${TARGET_SOURCES}) - add_definitions("-DHAVE_GD") + set(ADDITIONAL_DIRS ${GD_INCLUDE_DIRS} ${ADDITIONAL_DIRS}) + set(ADDITIONAL_LNK ${GD_LIBRARIES} ${ADDITIONAL_LNK}) + set(ADDITIONAL_LNKDIRS ${GD_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS}) + set(TARGET_SOURCES + ${PM3_ROOT}/client/src/imgutils.c + ${PM3_ROOT}/client/src/cmdhfwaveshare.c + ${TARGET_SOURCES}) + add_definitions("-DHAVE_GD") endif (NOT SKIPGD EQUAL 1 AND GD_FOUND) if (WHEREAMI_FOUND) diff --git a/client/experimental_lib/CMakeLists.txt b/client/experimental_lib/CMakeLists.txt index efa334216..9ea2aeb2c 100644 --- a/client/experimental_lib/CMakeLists.txt +++ b/client/experimental_lib/CMakeLists.txt @@ -518,14 +518,14 @@ if (LZ4_FOUND) endif (LZ4_FOUND) if (NOT SKIPGD EQUAL 1 AND GD_FOUND) - set(ADDITIONAL_DIRS ${GD_INCLUDE_DIRS} ${ADDITIONAL_DIRS}) - set(ADDITIONAL_LNK ${GD_LIBRARIES} ${ADDITIONAL_LNK}) - set(ADDITIONAL_LNKDIRS ${GD_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS}) - set(TARGET_SOURCES - ${PM3_ROOT}/client/src/imgutils.c - ${PM3_ROOT}/client/src/cmdhfwaveshare.c - ${TARGET_SOURCES}) - add_definitions("-DHAVE_GD") + set(ADDITIONAL_DIRS ${GD_INCLUDE_DIRS} ${ADDITIONAL_DIRS}) + set(ADDITIONAL_LNK ${GD_LIBRARIES} ${ADDITIONAL_LNK}) + set(ADDITIONAL_LNKDIRS ${GD_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS}) + set(TARGET_SOURCES + ${PM3_ROOT}/client/src/imgutils.c + ${PM3_ROOT}/client/src/cmdhfwaveshare.c + ${TARGET_SOURCES}) + add_definitions("-DHAVE_GD") endif (NOT SKIPGD EQUAL 1 AND GD_FOUND) if (WHEREAMI_FOUND) diff --git a/client/src/cmddata.c b/client/src/cmddata.c index 77e2d81ec..b52b9ca86 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -3737,23 +3737,23 @@ static int CmdCryptography(const char *Cmd) { if (type & 0x4) { // AES or DES? if (type & 0x02) { // If we will calculate a MAC /*PrintAndLogEx(INFO, "Called FeliCa MAC"); - // For DES all I know useful is the felica and fudan MAC algorithm.This is just des-cbc, but felica needs it in its way. - for (int i = 0; i < datilen; i+=8){ // For all 8 byte sequences - reverser(dati, &dati[i], 8, i); - if (i){ // If IV is processed - for (int n = 0; n < 8; ++n){ - dato[n] ^= dati[i+n]; // XOR with Dx - } - des_encrypt_ecb(dato, dato, 8, key); // Cipher itself - } else { // If we didn't start with IV - for (int n = 0; n < 8; ++n){ - dato[n] = iv[n]; // Feed data into output - dato[n] ^= dati[i+n]; // XOR with D1 - } - des_encrypt_ecb(dato, dato, 8, key); // Cipher itself - } - } - PrintAndLogEx(SUCCESS, "MAC: %s", sprint_hex_inrow(dato, 8));*/ + // For DES all I know useful is the felica and fudan MAC algorithm.This is just des-cbc, but felica needs it in its way. + for (int i = 0; i < datilen; i+=8){ // For all 8 byte sequences + reverser(dati, &dati[i], 8, i); + if (i){ // If IV is processed + for (int n = 0; n < 8; ++n){ + dato[n] ^= dati[i+n]; // XOR with Dx + } + des_encrypt_ecb(dato, dato, 8, key); // Cipher itself + } else { // If we didn't start with IV + for (int n = 0; n < 8; ++n){ + dato[n] = iv[n]; // Feed data into output + dato[n] ^= dati[i+n]; // XOR with D1 + } + des_encrypt_ecb(dato, dato, 8, key); // Cipher itself + } + } + PrintAndLogEx(SUCCESS, "MAC: %s", sprint_hex_inrow(dato, 8));*/ PrintAndLogEx(INFO, "Not implemented yet - feel free to contribute!"); return PM3_SUCCESS; } else { diff --git a/client/src/cmdsmartcard.c b/client/src/cmdsmartcard.c index cbf28b298..217cb7d86 100644 --- a/client/src/cmdsmartcard.c +++ b/client/src/cmdsmartcard.c @@ -1364,7 +1364,7 @@ static int CmdPCSC(const char *Cmd) { } if (cl_proto == ISODEP_NFCB) { - if (exchange_14b_apdu(cmdbuf + 2, apduLen, !field_activated, true, apduRes, sizeof(apduRes), &apduResLen, 0)) { + if (exchange_14b_apdu(cmdbuf + 2, apduLen, !field_activated, true, apduRes, sizeof(apduRes), &apduResLen, 0)) { have_card = false; mbedtls_net_close(&netCtx); continue;