mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
structs: initializes explicitely all fields, so we can detect when we really forgot one [-Wmissing-field-initializers]
This commit is contained in:
parent
af3397bd19
commit
0ab6de64d4
43 changed files with 211 additions and 211 deletions
|
@ -312,7 +312,7 @@ bool smart_select(bool silent, smart_card_atr_t *atr) {
|
|||
if (atr)
|
||||
memset(atr, 0, sizeof(smart_card_atr_t));
|
||||
|
||||
UsbCommand c = {CMD_SMART_ATR, {0, 0, 0}};
|
||||
UsbCommand c = {CMD_SMART_ATR, {0, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
UsbCommand resp;
|
||||
|
@ -378,7 +378,7 @@ static int smart_responseEx(uint8_t *data, bool silent) {
|
|||
int len = data[datalen - 1];
|
||||
if (!silent) PrintAndLogEx(INFO, "Requesting 0x%02X bytes response", len);
|
||||
uint8_t getstatus[] = {0x00, ISO7816_GET_RESPONSE, 0x00, 0x00, len};
|
||||
UsbCommand cStatus = {CMD_SMART_RAW, {SC_RAW, sizeof(getstatus), 0}};
|
||||
UsbCommand cStatus = {CMD_SMART_RAW, {SC_RAW, sizeof(getstatus), 0}, {{0}}};
|
||||
memcpy(cStatus.d.asBytes, getstatus, sizeof(getstatus));
|
||||
clearCommandBuffer();
|
||||
SendCommand(&cStatus);
|
||||
|
@ -485,7 +485,7 @@ int CmdSmartRaw(const char *Cmd) {
|
|||
|
||||
// arg0 = RFU flags
|
||||
// arg1 = length
|
||||
UsbCommand c = {CMD_SMART_RAW, {0, hexlen, 0}};
|
||||
UsbCommand c = {CMD_SMART_RAW, {0, hexlen, 0}, {{0}}};
|
||||
|
||||
if (active || active_select) {
|
||||
c.arg[0] |= SC_CONNECT;
|
||||
|
@ -544,7 +544,7 @@ int ExchangeAPDUSC(uint8_t *datain, int datainlen, bool activateCard, bool leave
|
|||
|
||||
PrintAndLogEx(DEBUG, "APDU SC");
|
||||
|
||||
UsbCommand c = {CMD_SMART_RAW, {SC_RAW_T0, datainlen, 0}};
|
||||
UsbCommand c = {CMD_SMART_RAW, {SC_RAW_T0, datainlen, 0}, {{0}}};
|
||||
if (activateCard) {
|
||||
c.arg[0] |= SC_SELECT | SC_CONNECT;
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ int ExchangeAPDUSC(uint8_t *datain, int datainlen, bool activateCard, bool leave
|
|||
|
||||
// retry
|
||||
if (len > 1 && dataout[len - 2] == 0x6c && datainlen > 4) {
|
||||
UsbCommand c2 = {CMD_SMART_RAW, {SC_RAW_T0, datainlen, 0}};
|
||||
UsbCommand c2 = {CMD_SMART_RAW, {SC_RAW_T0, datainlen, 0}, {{0}}};
|
||||
memcpy(c2.d.asBytes, datain, 5);
|
||||
|
||||
// transfer length via T=0
|
||||
|
@ -723,7 +723,7 @@ int CmdSmartUpgrade(const char *Cmd) {
|
|||
|
||||
while (bytes_remaining > 0) {
|
||||
uint32_t bytes_in_packet = MIN(USB_CMD_DATA_SIZE, bytes_remaining);
|
||||
UsbCommand c = {CMD_SMART_UPLOAD, {index + bytes_sent, bytes_in_packet, 0}};
|
||||
UsbCommand c = {CMD_SMART_UPLOAD, {index + bytes_sent, bytes_in_packet, 0}, {{0}}};
|
||||
|
||||
// Fill usb bytes with 0xFF
|
||||
memset(c.d.asBytes, 0xFF, USB_CMD_DATA_SIZE);
|
||||
|
@ -746,7 +746,7 @@ int CmdSmartUpgrade(const char *Cmd) {
|
|||
PrintAndLogEx(SUCCESS, "Sim module firmware updating, don\'t turn off your PM3!");
|
||||
|
||||
// trigger the firmware upgrade
|
||||
UsbCommand c = {CMD_SMART_UPGRADE, {firmware_size, 0, 0}};
|
||||
UsbCommand c = {CMD_SMART_UPGRADE, {firmware_size, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
UsbCommand resp;
|
||||
|
@ -785,7 +785,7 @@ int CmdSmartInfo(const char *Cmd) {
|
|||
//Validations
|
||||
if (errors) return usage_sm_info();
|
||||
|
||||
UsbCommand c = {CMD_SMART_ATR, {0, 0, 0}};
|
||||
UsbCommand c = {CMD_SMART_ATR, {0, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
UsbCommand resp;
|
||||
|
@ -860,7 +860,7 @@ int CmdSmartReader(const char *Cmd) {
|
|||
//Validations
|
||||
if (errors) return usage_sm_reader();
|
||||
|
||||
UsbCommand c = {CMD_SMART_ATR, {0, 0, 0}};
|
||||
UsbCommand c = {CMD_SMART_ATR, {0, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
UsbCommand resp;
|
||||
|
@ -906,7 +906,7 @@ int CmdSmartSetClock(const char *Cmd) {
|
|||
//Validations
|
||||
if (errors || cmdp == 0) return usage_sm_setclock();
|
||||
|
||||
UsbCommand c = {CMD_SMART_SETCLOCK, {clock1, 0, 0}};
|
||||
UsbCommand c = {CMD_SMART_SETCLOCK, {clock1, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
UsbCommand resp;
|
||||
|
@ -958,7 +958,7 @@ static void smart_brute_prim() {
|
|||
|
||||
PrintAndLogEx(INFO, "Reading primitives");
|
||||
|
||||
UsbCommand c = {CMD_SMART_RAW, {SC_RAW_T0, 5, 0}};
|
||||
UsbCommand c = {CMD_SMART_RAW, {SC_RAW_T0, 5, 0}, {{0}}};
|
||||
|
||||
for (int i = 0; i < sizeof(get_card_data); i += 5) {
|
||||
|
||||
|
@ -988,7 +988,7 @@ static int smart_brute_sfi(bool decodeTLV) {
|
|||
int len;
|
||||
// READ RECORD
|
||||
uint8_t READ_RECORD[] = {0x00, 0xB2, 0x00, 0x00, 0x00};
|
||||
UsbCommand c = {CMD_SMART_RAW, {SC_RAW_T0, sizeof(READ_RECORD), 0}};
|
||||
UsbCommand c = {CMD_SMART_RAW, {SC_RAW_T0, sizeof(READ_RECORD), 0}, {{0}}};
|
||||
|
||||
PrintAndLogEx(INFO, "Start SFI brute forcing");
|
||||
|
||||
|
@ -1055,7 +1055,7 @@ static void smart_brute_options(bool decodeTLV) {
|
|||
uint8_t GET_PROCESSING_OPTIONS[] = {0x80, 0xA8, 0x00, 0x00, 0x02, 0x83, 0x00, 0x00};
|
||||
|
||||
// Get processing options command
|
||||
UsbCommand c = {CMD_SMART_RAW, {SC_RAW_T0, sizeof(GET_PROCESSING_OPTIONS), 0}};
|
||||
UsbCommand c = {CMD_SMART_RAW, {SC_RAW_T0, sizeof(GET_PROCESSING_OPTIONS), 0}, {{0}}};
|
||||
memcpy(c.d.asBytes, GET_PROCESSING_OPTIONS, sizeof(GET_PROCESSING_OPTIONS));
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
|
@ -1112,7 +1112,7 @@ int CmdSmartBruteforceSFI(const char *Cmd) {
|
|||
// uint8_t VERIFY[] = {0x00, 0x20, 0x00, 0x80};
|
||||
|
||||
// Select AID command
|
||||
UsbCommand cAid = {CMD_SMART_RAW, {SC_RAW_T0, 0, 0}};
|
||||
UsbCommand cAid = {CMD_SMART_RAW, {SC_RAW_T0, 0, 0}, {{0}}};
|
||||
|
||||
PrintAndLogEx(INFO, "Importing AID list");
|
||||
json_t *root = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue