Skip to content
Merged
2 changes: 1 addition & 1 deletion armsrc/epa.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ int EPA_Setup()
// return code
int return_code = 0;
// card UID
uint8_t uid[8];
uint8_t uid[10];
// card select information
iso14a_card_select_t card_select_info;
// power up the field
Expand Down
4 changes: 2 additions & 2 deletions armsrc/hitag2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ void ReaderHitag(hitag_function htf, hitag_data* htd) {
case RHT2F_PASSWORD: {
Dbprintf("List identifier in password mode");
memcpy(password,htd->pwd.password,4);
blocknr = 0;
blocknr = 0;
bQuitTraceFull = false;
bQuiet = false;
bPwd = false;
Expand All @@ -1158,7 +1158,7 @@ void ReaderHitag(hitag_function htf, hitag_data* htd) {

case RHT2F_CRYPTO: {
DbpString("Authenticating using key:");
memcpy(key,htd->crypto.key,6);
memcpy(key,htd->crypto.key,4);
Dbhexdump(6,key,false);
blocknr = 0;
bQuiet = false;
Expand Down
29 changes: 16 additions & 13 deletions armsrc/iclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,20 +1295,23 @@ static void TransmitIClassCommand(const uint8_t *cmd, int len, int *samples, int
FpgaSetupSsc();

if (wait)
if(*wait < 10)
*wait = 10;
{
if(*wait < 10) *wait = 10;

for(c = 0; c < *wait;) {
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {
AT91C_BASE_SSC->SSC_THR = 0x00; // For exact timing!
c++;
}
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
volatile uint32_t r = AT91C_BASE_SSC->SSC_RHR;
(void)r;
}
WDT_HIT();
}

}

for(c = 0; c < *wait;) {
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {
AT91C_BASE_SSC->SSC_THR = 0x00; // For exact timing!
c++;
}
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
volatile uint32_t r = AT91C_BASE_SSC->SSC_RHR;
(void)r;
}
WDT_HIT();
}

uint8_t sendbyte;
bool firstpart = TRUE;
Expand Down
11 changes: 9 additions & 2 deletions armsrc/iso14443a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,13 @@ int iso14443a_select_card(byte_t* uid_ptr, iso14a_card_select_t* p_hi14a_card, u
if ((sak & 0x04) /* && uid_resp[0] == 0x88 */) {
// Remove first byte, 0x88 is not an UID byte, it CT, see page 3 of:
// http://www.nxp.com/documents/application_note/AN10927.pdf
memcpy(uid_resp, uid_resp + 1, 3);
// This was earlier:
//memcpy(uid_resp, uid_resp + 1, 3);
// But memcpy should not be used for overlapping arrays,
// and memmove appears to not be available in the arm build.
// So this has been replaced with a for-loop:
for(int xx = 0; xx < 3; xx++) uid_resp[xx] = uid_resp[xx+1];

uid_resp_len = 3;
}

Expand Down Expand Up @@ -1936,7 +1942,8 @@ void ReaderMifare(bool first_try)
uint8_t uid[10];
uint32_t cuid;

uint32_t nt, previous_nt;
uint32_t nt =0 ;
uint32_t previous_nt = 0;
static uint32_t nt_attacked = 0;
byte_t par_list[8] = {0,0,0,0,0,0,0,0};
byte_t ks_list[8] = {0,0,0,0,0,0,0,0};
Expand Down
Loading