make style

This commit is contained in:
Philippe Teuwen 2019-04-06 00:52:55 +02:00
commit 98d9408746
30 changed files with 257 additions and 257 deletions

View file

@ -28,7 +28,7 @@ typedef struct {
const char *Description;
} APDUCode;
extern const APDUCode *const GetAPDUCode(uint8_t sw1, uint8_t sw2);
extern const char *GetAPDUCodeDescription(uint8_t sw1, uint8_t sw2);
const APDUCode *const GetAPDUCode(uint8_t sw1, uint8_t sw2);
const char *GetAPDUCodeDescription(uint8_t sw1, uint8_t sw2);
#endif

View file

@ -29,12 +29,12 @@
int CmdEMV(const char *Cmd);
extern int CmdEMVSelect(const char *cmd);
extern int CmdEMVSearch(const char *cmd);
extern int CmdEMVPPSE(const char *cmd);
extern int CmdEMVExec(const char *cmd);
extern int CmdEMVGetrng(const char *Cmd);
extern int CmdEMVList(const char *Cmd);
extern int CmdEMVRoca(const char *Cmd);
int CmdEMVSelect(const char *cmd);
int CmdEMVSearch(const char *cmd);
int CmdEMVPPSE(const char *cmd);
int CmdEMVExec(const char *cmd);
int CmdEMVGetrng(const char *Cmd);
int CmdEMVList(const char *Cmd);
int CmdEMVRoca(const char *Cmd);
#endif

View file

@ -21,7 +21,7 @@
#include <stddef.h>
extern void PKISetStrictExecution(bool se);
void PKISetStrictExecution(bool se);
unsigned char *emv_pki_sdatl_fill(const struct tlvdb *db, size_t *sdatl_len);
struct emv_pk *emv_pki_recover_issuer_cert(const struct emv_pk *pk, struct tlvdb *db);

View file

@ -31,8 +31,8 @@
#define ROCA_PRINTS_LENGTH 17
extern bool emv_rocacheck(const unsigned char *buf, size_t buflen, bool verbose);
extern int roca_self_test(void);
bool emv_rocacheck(const unsigned char *buf, size_t buflen, bool verbose);
int roca_self_test(void);
#endif

View file

@ -63,46 +63,46 @@ enum CardPSVendor {
CV_CB,
CV_OTHER,
};
extern enum CardPSVendor GetCardPSVendor(uint8_t *AID, size_t AIDlen);
enum CardPSVendor GetCardPSVendor(uint8_t *AID, size_t AIDlen);
extern bool TLVPrintFromBuffer(uint8_t *data, int datalen);
extern void TLVPrintFromTLV(struct tlvdb *tlv);
extern void TLVPrintFromTLVLev(struct tlvdb *tlv, int level);
extern void TLVPrintAIDlistFromSelectTLV(struct tlvdb *tlv);
bool TLVPrintFromBuffer(uint8_t *data, int datalen);
void TLVPrintFromTLV(struct tlvdb *tlv);
void TLVPrintFromTLVLev(struct tlvdb *tlv, int level);
void TLVPrintAIDlistFromSelectTLV(struct tlvdb *tlv);
extern struct tlvdb *GetPANFromTrack2(const struct tlv *track2);
extern struct tlvdb *GetdCVVRawFromTrack2(const struct tlv *track2);
struct tlvdb *GetPANFromTrack2(const struct tlv *track2);
struct tlvdb *GetdCVVRawFromTrack2(const struct tlv *track2);
extern void SetAPDULogging(bool logging);
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);
int EMVExchange(EMVCommandChannel channel, bool LeaveFieldON, sAPDU apdu, 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);
extern int EMVSearch(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON, bool decodeTLV, struct tlvdb *tlv);
extern int EMVSelectPSE(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON, uint8_t PSENum, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
extern int EMVSelect(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON, uint8_t *AID, size_t AIDLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
int EMVSearchPSE(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON, uint8_t PSENum, bool decodeTLV, struct tlvdb *tlv);
int EMVSearch(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON, bool decodeTLV, struct tlvdb *tlv);
int EMVSelectPSE(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON, uint8_t PSENum, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
int EMVSelect(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON, uint8_t *AID, size_t AIDLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
// select application
extern int EMVSelectApplication(struct tlvdb *tlv, uint8_t *AID, size_t *AIDlen);
int EMVSelectApplication(struct tlvdb *tlv, uint8_t *AID, size_t *AIDlen);
// Get Processing Options
extern int EMVGPO(EMVCommandChannel channel, bool LeaveFieldON, uint8_t *PDOL, size_t PDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
extern int EMVReadRecord(EMVCommandChannel channel, bool LeaveFieldON, uint8_t SFI, uint8_t SFIrec, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
int EMVGPO(EMVCommandChannel channel, bool LeaveFieldON, uint8_t *PDOL, size_t PDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
int EMVReadRecord(EMVCommandChannel channel, bool LeaveFieldON, uint8_t SFI, uint8_t SFIrec, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
// AC
extern int EMVGenerateChallenge(EMVCommandChannel channel, bool LeaveFieldON, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
extern int EMVAC(EMVCommandChannel channel, bool LeaveFieldON, uint8_t RefControl, uint8_t *CDOL, size_t CDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
int EMVGenerateChallenge(EMVCommandChannel channel, bool LeaveFieldON, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
int EMVAC(EMVCommandChannel channel, bool LeaveFieldON, uint8_t RefControl, uint8_t *CDOL, size_t CDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
// DDA
extern int EMVInternalAuthenticate(EMVCommandChannel channel, bool LeaveFieldON, uint8_t *DDOL, size_t DDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
int EMVInternalAuthenticate(EMVCommandChannel channel, bool LeaveFieldON, uint8_t *DDOL, size_t DDOLLen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
// Mastercard
int MSCComputeCryptoChecksum(EMVCommandChannel channel, bool LeaveFieldON, uint8_t *UDOL, uint8_t UDOLlen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv);
// Auth
extern int trSDA(struct tlvdb *tlv);
extern int trDDA(EMVCommandChannel channel, bool decodeTLV, struct tlvdb *tlv);
extern int trCDA(struct tlvdb *tlv, struct tlvdb *ac_tlv, struct tlv *pdol_data_tlv, struct tlv *ac_data_tlv);
int trSDA(struct tlvdb *tlv);
int trDDA(EMVCommandChannel channel, bool decodeTLV, struct tlvdb *tlv);
int trCDA(struct tlvdb *tlv, struct tlvdb *ac_tlv, struct tlv *pdol_data_tlv, struct tlv *ac_data_tlv);
extern int RecoveryCertificates(struct tlvdb *tlvRoot, json_t *root);
int RecoveryCertificates(struct tlvdb *tlvRoot, json_t *root);
extern struct emv_pk *get_ca_pk(struct tlvdb *db);
struct emv_pk *get_ca_pk(struct tlvdb *db);
#endif

View file

@ -18,24 +18,24 @@ typedef struct {
char *Name;
} ApplicationDataElm;
extern char *GetApplicationDataName(tlv_tag_t tag);
char *GetApplicationDataName(tlv_tag_t tag);
extern int JsonSaveJsonObject(json_t *root, char *path, json_t *value);
extern int JsonSaveStr(json_t *root, char *path, char *value);
extern int JsonSaveInt(json_t *root, char *path, int value);
extern int JsonSaveBufAsHexCompact(json_t *elm, char *path, uint8_t *data, size_t datalen);
extern int JsonSaveBufAsHex(json_t *elm, char *path, uint8_t *data, size_t datalen);
extern int JsonSaveHex(json_t *elm, char *path, uint64_t data, int datalen);
int JsonSaveJsonObject(json_t *root, char *path, json_t *value);
int JsonSaveStr(json_t *root, char *path, char *value);
int JsonSaveInt(json_t *root, char *path, int value);
int JsonSaveBufAsHexCompact(json_t *elm, char *path, uint8_t *data, size_t datalen);
int JsonSaveBufAsHex(json_t *elm, char *path, uint8_t *data, size_t datalen);
int JsonSaveHex(json_t *elm, char *path, uint64_t data, int datalen);
extern int JsonSaveTLVValue(json_t *root, char *path, struct tlvdb *tlvdbelm);
extern int JsonSaveTLVElm(json_t *elm, char *path, struct tlv *tlvelm, bool saveName, bool saveValue, bool saveAppDataLink);
extern int JsonSaveTLVTreeElm(json_t *elm, char *path, struct tlvdb *tlvdbelm, bool saveName, bool saveValue, bool saveAppDataLink);
int JsonSaveTLVValue(json_t *root, char *path, struct tlvdb *tlvdbelm);
int JsonSaveTLVElm(json_t *elm, char *path, struct tlv *tlvelm, bool saveName, bool saveValue, bool saveAppDataLink);
int JsonSaveTLVTreeElm(json_t *elm, char *path, struct tlvdb *tlvdbelm, bool saveName, bool saveValue, bool saveAppDataLink);
extern int JsonSaveTLVTree(json_t *root, json_t *elm, char *path, struct tlvdb *tlvdbelm);
int JsonSaveTLVTree(json_t *root, json_t *elm, char *path, struct tlvdb *tlvdbelm);
extern int JsonLoadStr(json_t *root, char *path, char *value);
extern int JsonLoadBufAsHex(json_t *elm, char *path, uint8_t *data, size_t maxbufferlen, size_t *datalen);
int JsonLoadStr(json_t *root, char *path, char *value);
int JsonLoadBufAsHex(json_t *elm, char *path, uint8_t *data, size_t maxbufferlen, size_t *datalen);
extern bool ParamLoadFromJson(struct tlvdb *tlv);
bool ParamLoadFromJson(struct tlvdb *tlv);
#endif

View file

@ -15,4 +15,4 @@
#include <stdbool.h>
extern int exec_cda_test(bool verbose);
int exec_cda_test(bool verbose);

View file

@ -15,4 +15,4 @@
#include <stdbool.h>
extern int exec_crypto_test(bool verbose);
int exec_crypto_test(bool verbose);

View file

@ -10,4 +10,4 @@
#include <stdbool.h>
extern int ExecuteCryptoTests(bool verbose);
int ExecuteCryptoTests(bool verbose);

View file

@ -15,4 +15,4 @@
#include <stdbool.h>
extern int exec_dda_test(bool verbose);
int exec_dda_test(bool verbose);

View file

@ -13,4 +13,4 @@
* Lesser General Public License for more details.
*/
extern int exec_sda_test(bool verbose);
int exec_sda_test(bool verbose);