Skip to content

Commit

Permalink
Incorporating bug fixes by @colinoflynn at https://github.com/colinof…
Browse files Browse the repository at this point in the history
  • Loading branch information
maxieds committed Apr 22, 2022
1 parent 19e0d1c commit 4536789
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Firmware/Chameleon-Mini/Application/CryptoAES128.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static void CryptoAESEncryptBlock(uint8_t *Plaintext, uint8_t *Ciphertext, const
NOP();
AES.CTRL = 0;
aes_configure_encrypt(AES_MANUAL, XorModeOn ? AES_XOR_ON : AES_XOR_OFF);
aes_isr_configure(AES_INTLVL_LO);
aes_isr_configure(AES_INTLVL_OFF);
aes_set_key(Key);
for (uint8_t i = 0; i < CRYPTO_AES_BLOCK_SIZE; i++) {
AES.STATE = 0x00;
Expand All @@ -221,7 +221,7 @@ static void CryptoAESDecryptBlock(uint8_t *Plaintext, uint8_t *Ciphertext, const
NOP();
AES.CTRL = 0;
aes_configure_decrypt(AES_MANUAL, AES_XOR_OFF);
aes_isr_configure(AES_INTLVL_LO);
aes_isr_configure(AES_INTLVL_OFF);
aes_set_key(lastSubKey);
for (uint8_t i = 0; i < CRYPTO_AES_BLOCK_SIZE; i++) {
AES.STATE = 0x00;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ static uint16_t ISO144434ProcessBlock(uint8_t *Buffer, uint16_t ByteCount, uint1
return ISO14443A_APP_NO_RESPONSE;
}
}
break;
}
case ISO14443_4_STATE_LAST: {
return ISO14443A_APP_NO_RESPONSE;
Expand Down Expand Up @@ -184,7 +185,7 @@ static uint16_t ISO144434ProcessBlock(uint8_t *Buffer, uint16_t ByteCount, uint1
}
Buffer[0] = PCB;
/* Let the DESFire application code process the input data */
ByteCount = MifareDesfireProcess(Buffer + PrologueLength, ByteCount - PrologueLength);
ByteCount = MifareDesfireProcessCommand(Buffer + PrologueLength, ByteCount - PrologueLength);
/* Short-circuit in case the app decides not to respond at all */
if (ByteCount == ISO14443A_APP_NO_RESPONSE) {
const char *debugPrintStr = PSTR("ISO14443-4: APP_NO_RESP");
Expand All @@ -194,7 +195,7 @@ static uint16_t ISO144434ProcessBlock(uint8_t *Buffer, uint16_t ByteCount, uint1
ByteCount += PrologueLength;
const char *debugPrintStr = PSTR("ISO14443-4: I-BLK");
LogDebuggingMsg(debugPrintStr);
break;
return GetAndSetBufferCRCA(Buffer, ByteCount);
}

case ISO14443_PCB_R_BLOCK: {
Expand Down Expand Up @@ -227,7 +228,7 @@ static uint16_t ISO144434ProcessBlock(uint8_t *Buffer, uint16_t ByteCount, uint1
}
const char *debugPrintStr6 = PSTR("ISO14443-4: R-BLK");
LogDebuggingMsg(debugPrintStr6);
break;
return GetAndSetBufferCRCA(Buffer, ByteCount);
}

case ISO14443_PCB_S_BLOCK: {
Expand Down

0 comments on commit 4536789

Please sign in to comment.