Skip to content

Commit

Permalink
fix const param, bitwiseboolean
Browse files Browse the repository at this point in the history
  • Loading branch information
iceman1001 committed May 14, 2024
1 parent 4bbfc94 commit 5fd4d7e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion armsrc/hitag2.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define DBG if (g_dbglevel >= DBG_EXTENDED)

#include "hitag2.h"
#include "hitag2_crypto.h"
#include "hitag2/hitag2_crypto.h"
#include "string.h"
#include "proxmark3_arm.h"
#include "cmd.h"
Expand Down
2 changes: 1 addition & 1 deletion armsrc/hitag2_crack.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


#include "hitag2_crack.h"
#include "hitag2_crypto.h"
#include "hitag2/hitag2_crypto.h"
#include "hitag2.h"
#include "proxmark3_arm.h"
#include "commonutil.h"
Expand Down
6 changes: 3 additions & 3 deletions armsrc/hitagS.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "util.h"
#include "string.h"
#include "commonutil.h"
#include "hitag2_crypto.h"
#include "hitag2/hitag2_crypto.h"
#include "lfadc.h"
#include "crc.h"

Expand Down Expand Up @@ -1090,7 +1090,7 @@ static void hitagS_receive_frame(uint8_t *rx, size_t sizeofrx, size_t *rxlen, ui
// Dbprintf("RX0 %i:%02X.. err:%i resptime:%i", *rxlen, rx[0], errorCount, *resptime);
}

static void sendReceiveHitagS(uint8_t *tx, size_t txlen, uint8_t *rx, size_t sizeofrx, size_t *prxbits, int t_wait, bool ledcontrol, bool ac_seq) {
static void sendReceiveHitagS( const uint8_t *tx, size_t txlen, uint8_t *rx, size_t sizeofrx, size_t *prxbits, int t_wait, bool ledcontrol, bool ac_seq) {

LogTraceBits(tx, txlen, HITAG_T_WAIT_2, HITAG_T_WAIT_2, true);

Expand Down Expand Up @@ -1557,7 +1557,7 @@ void WritePageHitagS(const lf_hitag_data_t *payload, bool ledcontrol) {
break;
default: {
res = PM3_EINVARG;
return;
goto write_end;
}
}

Expand Down
10 changes: 5 additions & 5 deletions client/src/cmdhf14a.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ int CmdHF14ASim(const char *Cmd) {
if ((flags & FLAG_NR_AR_ATTACK) != FLAG_NR_AR_ATTACK)
break;

nonces_t *data = (nonces_t *)resp.data.asBytes;
const nonces_t *data = (nonces_t *)resp.data.asBytes;
readerAttack(k_sector, k_sectors_cnt, data[0], setEmulatorMem, verbose);

keypress = kbd_enter_pressed();
Expand Down Expand Up @@ -1099,7 +1099,7 @@ int SelectCard14443A_4(bool disconnect, bool verbose, iso14a_card_select_t *card
return SelectCard14443A_4_WithParameters(disconnect, verbose, card, NULL);
}

static int CmdExchangeAPDU(bool chainingin, uint8_t *datain, int datainlen, bool activateField, uint8_t *dataout, int maxdataoutlen, int *dataoutlen, bool *chainingout) {
static int CmdExchangeAPDU(bool chainingin, const uint8_t *datain, int datainlen, bool activateField, uint8_t *dataout, int maxdataoutlen, int *dataoutlen, bool *chainingout) {
*chainingout = false;

size_t timeout = 1500;
Expand Down Expand Up @@ -1158,7 +1158,7 @@ static int CmdExchangeAPDU(bool chainingin, uint8_t *datain, int datainlen, bool
PacketResponseNG resp;

if (WaitForResponseTimeout(CMD_ACK, &resp, timeout)) {
uint8_t *recv = resp.data.asBytes;
const uint8_t *recv = resp.data.asBytes;
int iLen = resp.oldarg[0];
uint8_t res = resp.oldarg[1];

Expand Down Expand Up @@ -1216,7 +1216,7 @@ static int CmdExchangeAPDU(bool chainingin, uint8_t *datain, int datainlen, bool
return PM3_SUCCESS;
}

int ExchangeAPDU14a(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen) {
int ExchangeAPDU14a(const uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen) {
*dataoutlen = 0;
bool chaining = false;
int res;
Expand Down Expand Up @@ -1519,7 +1519,7 @@ static int CmdHF14ACmdRaw(const char *Cmd) {
}

// TODO: allow to use reader command with both data and polling configuration
if (use_ecp | use_magsafe) {
if (use_ecp || use_magsafe) {
PrintAndLogEx(WARNING, "ECP and Magsafe not supported with this command at this moment. Instead use 'hf 14a reader -sk --ecp/--mag'");
// flags |= ISO14A_USE_MAGSAFE;
// flags |= ISO14A_USE_ECP;
Expand Down
2 changes: 1 addition & 1 deletion client/src/cmdhf14a.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search);
int infoHF14A4Applications(bool verbose);
const char *getTagInfo(uint8_t uid);
int Hf14443_4aGetCardData(iso14a_card_select_t *card);
int ExchangeAPDU14a(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen);
int ExchangeAPDU14a(const uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen);
int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leaveSignalON, uint8_t *dataout, int maxdataoutlen, int *dataoutlen, bool silentMode);

iso14a_polling_parameters_t iso14a_get_polling_parameters(bool use_ecp, bool use_magsafe);
Expand Down
2 changes: 1 addition & 1 deletion client/src/cmdhfmfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3253,7 +3253,7 @@ int CmdHF14MfUTamper(const char *Cmd) {
}
}

if (enable | disable | lock_msg) {
if (enable || disable || lock_msg) {

if (ul_select(&card) == false) {
PrintAndLogEx(ERR, "Unable to select tag");
Expand Down
4 changes: 2 additions & 2 deletions tools/mfkey/staticnested.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static void pm3_staticnested(uint32_t uid, uint32_t nt1, uint32_t ks1, uint32_t
for (uint32_t k = 0; k < keycnt; k++) {
uint64_t key64 = 0;
crypto1_get_lfsr(statelists[0].head.slhead + k, &key64);
printf("[ %d ] " _GREEN_("%012" PRIx64) "\n", k + 1, key64);
printf("[ %u ] " _GREEN_("%012" PRIx64) "\n", k + 1, key64);
}
}
}
Expand Down Expand Up @@ -222,7 +222,7 @@ int main(int argc, char *const argv[]) {
if (key_count) {
printf("Ultra Static nested --> Found " _YELLOW_("%u") " key candidates\n", key_count);
for (uint32_t k = 0; k < key_count; k++) {
printf("[ %d ] " _GREEN_("%012" PRIx64) "\n", k + 1, keys[k]);
printf("[ %u ] " _GREEN_("%012" PRIx64) "\n", k + 1, keys[k]);
}
}

Expand Down

0 comments on commit 5fd4d7e

Please sign in to comment.