X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/1511ea28a8cc647a6fc462e9c182622a43df1318..f98702bace48fde3ec1492d1c732e23cd2eb8613:/client/emv/emvcore.h?ds=sidebyside

diff --git a/client/emv/emvcore.h b/client/emv/emvcore.h
index 7d53e83b..19f26028 100644
--- a/client/emv/emvcore.h
+++ b/client/emv/emvcore.h
@@ -11,26 +11,15 @@
 #ifndef EMVCORE_H__
 #define EMVCORE_H__
 
-#include <stdio.h>
 #include <stdint.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include <string.h>
-#include <jansson.h>
-#include "util.h"
-#include "common.h"
-#include "ui.h"
-#include "cmdhf14a.h"
-#include "apduinfo.h"
+#include <stdbool.h>
 #include "tlv.h"
-#include "dol.h"
-#include "dump.h"
-#include "emv_tags.h"
-#include "emv_pk.h"
-#include "emv_pki.h"
+#include "jansson.h"
 
-#define APDU_RES_LEN 260
-#define APDU_AID_LEN 50
+// maximum APDU lengths. Long APDUs not yet supported/needed
+#define APDU_DATA_LEN      255
+#define APDU_COMMAND_LEN   (4 + 1 + APDU_DATA_LEN + 1)
+#define APDU_RESPONSE_LEN  (256 + 2)
 
 typedef enum {
 	ECC_CONTACTLESS,
@@ -45,15 +34,6 @@ enum TransactionType {
 };
 extern char *TransactionTypeStr[];
 
-typedef struct {
-	uint8_t CLA;
-	uint8_t INS;
-	uint8_t P1;
-	uint8_t P2;
-	uint8_t Lc;
-	uint8_t *data;
-} sAPDU;
-
 enum CardPSVendor {
 	CV_NA,
 	CV_VISA,
@@ -61,10 +41,14 @@ enum CardPSVendor {
 	CV_AMERICANEXPRESS,
 	CV_JCB,
 	CV_CB,
+	CV_SWITCH,
+	CV_DINERS,
 	CV_OTHER,
 };
 extern enum CardPSVendor GetCardPSVendor(uint8_t * AID, size_t AIDlen);
 
+extern void DropFieldEx(EMVCommandChannel channel);
+
 extern bool TLVPrintFromBuffer(uint8_t *data, int datalen);
 extern void TLVPrintFromTLV(struct tlvdb *tlv);
 extern void TLVPrintFromTLVLev(struct tlvdb *tlv, int level);
@@ -76,7 +60,7 @@ extern struct tlvdb *GetdCVVRawFromTrack2(const struct tlv *track2);
 extern void SetAPDULogging(bool logging);
 
 // exchange
-extern int EMVExchange(EMVCommandChannel channel, bool LeaveFieldON, sAPDU apdu, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
+extern int EMVExchangeEx(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON, uint8_t *apdu, int apdu_len, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
 
 // search application
 extern int EMVSearchPSE(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON, uint8_t PSENum, bool decodeTLV, struct tlvdb *tlv);