make style

This commit is contained in:
Philippe Teuwen 2020-01-15 19:26:12 +01:00
commit b57f40e3d7
2 changed files with 321 additions and 311 deletions

View file

@ -434,11 +434,13 @@ bool hitag_plain(uint8_t* rx, const size_t rxlen, uint8_t* tx, size_t* txlen, bo
tx[2] = crc << 4; tx[2] = crc << 4;
*txlen = 20; *txlen = 20;
} }
} break; }
break;
default: { default: {
Dbprintf("Uknown frame length: %d", rxlen); Dbprintf("Uknown frame length: %d", rxlen);
return false; return false;
} break; }
break;
} }
return true; return true;
} }
@ -465,7 +467,8 @@ bool hitag1_authenticate(uint8_t* rx, const size_t rxlen, uint8_t* tx, size_t* t
} }
bCollision = true; bCollision = true;
// will receive 32-bit UID // will receive 32-bit UID
} break; }
break;
case 2: { case 2: {
if (bAuthenticating) { if (bAuthenticating) {
// received Auth init ACK, send nonce // received Auth init ACK, send nonce
@ -490,7 +493,8 @@ bool hitag1_authenticate(uint8_t* rx, const size_t rxlen, uint8_t* tx, size_t* t
*txlen = 20; *txlen = 20;
// will receive 32-bit encrypted page // will receive 32-bit encrypted page
} }
} break; }
break;
case 32: { case 32: {
if (bCollision) { if (bCollision) {
// Select card by serial from response // Select card by serial from response
@ -555,11 +559,13 @@ bool hitag1_authenticate(uint8_t* rx, const size_t rxlen, uint8_t* tx, size_t* t
tx[2] = crc << 4; tx[2] = crc << 4;
*txlen = 20; *txlen = 20;
} }
} break; }
break;
default: { default: {
Dbprintf("Uknown frame length: %d", rxlen); Dbprintf("Uknown frame length: %d", rxlen);
return false; return false;
} break; }
break;
} }
return true; return true;
@ -1229,7 +1235,8 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) {
// this part will be unreadable // this part will be unreadable
memset(tag.sectors + 2, 0x0, 30); memset(tag.sectors + 2, 0x0, 30);
blocknr = 0; blocknr = 0;
} break; }
break;
case RHT1F_AUTHENTICATE: { case RHT1F_AUTHENTICATE: {
Dbprintf("Read all blocks in authed mode"); Dbprintf("Read all blocks in authed mode");
@ -1251,7 +1258,8 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) {
DbpString("Logdata_1:"); DbpString("Logdata_1:");
Dbhexdump(4, logdata_1, false); Dbhexdump(4, logdata_1, false);
blocknr = 0; blocknr = 0;
} break; }
break;
case RHT2F_PASSWORD: { case RHT2F_PASSWORD: {
Dbprintf("List identifier in password mode"); Dbprintf("List identifier in password mode");
memcpy(password, htd->pwd.password, 4); memcpy(password, htd->pwd.password, 4);
@ -1358,11 +1366,13 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) {
switch (htf) { switch (htf) {
case RHT1F_PLAIN: { case RHT1F_PLAIN: {
bStop = !hitag_plain(rx, rxlen, tx, &txlen, false); bStop = !hitag_plain(rx, rxlen, tx, &txlen, false);
} break; }
break;
case RHT1F_AUTHENTICATE: { case RHT1F_AUTHENTICATE: {
bStop = !hitag1_authenticate(rx, rxlen, tx, &txlen); bStop = !hitag1_authenticate(rx, rxlen, tx, &txlen);
} break; }
break;
case RHT2F_PASSWORD: { case RHT2F_PASSWORD: {
bStop = !hitag2_password(rx, rxlen, tx, &txlen, false); bStop = !hitag2_password(rx, rxlen, tx, &txlen, false);