@@ -2909,7 +2909,7 @@ void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain) {
29092909 }
29102910
29112911 // read block
2912- if ((mifare_sendcmd_short (NULL , CRYPT_NONE , ISO14443A_CMD_READBLOCK , blockNo , receivedAnswer , sizeof (receivedAnswer ), receivedAnswerPar , NULL ) != MIFARE_BLOCK_SIZE + 2 )) {
2912+ if ((mifare_sendcmd_short (NULL , CRYPT_NONE , ISO14443A_CMD_READBLOCK , blockNo , receivedAnswer , sizeof (receivedAnswer ), receivedAnswerPar , NULL ) != MIFARE_BLOCK_SIZE + CRC16_SIZE )) {
29132913 if (g_dbglevel >= DBG_ERROR ) Dbprintf ("read block send command error" );
29142914 errormsg = 0 ;
29152915 break ;
@@ -3515,7 +3515,7 @@ void MifareGen3Blk(uint8_t block_len, uint8_t *block) {
35153515
35163516 int retval = PM3_SUCCESS ;
35173517 uint8_t block_cmd [5 ] = { 0x90 , 0xf0 , 0xcc , 0xcc , 0x10 };
3518- uint8_t cmdlen = sizeof (block_cmd ) + MIFARE_BLOCK_SIZE + 2 ;
3518+ uint8_t cmdlen = sizeof (block_cmd ) + MIFARE_BLOCK_SIZE + CRC16_SIZE ;
35193519 uint8_t * cmd = BigBuf_calloc (cmdlen );
35203520
35213521 iso14a_card_select_t * card_info = (iso14a_card_select_t * ) BigBuf_calloc (sizeof (iso14a_card_select_t ));
@@ -3532,7 +3532,7 @@ void MifareGen3Blk(uint8_t block_len, uint8_t *block) {
35323532
35333533 bool doReselect = false;
35343534 if (block_len < MIFARE_BLOCK_SIZE ) {
3535- if ((mifare_sendcmd_short (NULL , CRYPT_NONE , ISO14443A_CMD_READBLOCK , 0 , & cmd [sizeof (block_cmd )], MIFARE_BLOCK_SIZE + 2 , NULL , NULL ) != MIFARE_BLOCK_SIZE + 2 )) {
3535+ if ((mifare_sendcmd_short (NULL , CRYPT_NONE , ISO14443A_CMD_READBLOCK , 0 , & cmd [sizeof (block_cmd )], MIFARE_BLOCK_SIZE + CRC16_SIZE , NULL , NULL ) != MIFARE_BLOCK_SIZE + CRC16_SIZE )) {
35363536 if (g_dbglevel >= DBG_ERROR ) Dbprintf ("Read manufacturer block failed" );
35373537 retval = PM3_ESOFT ;
35383538 goto OUT ;
@@ -3567,7 +3567,7 @@ void MifareGen3Blk(uint8_t block_len, uint8_t *block) {
35673567 }
35683568 }
35693569
3570- retval = DoGen3Cmd (cmd , sizeof (block_cmd ) + MIFARE_BLOCK_SIZE + 2 );
3570+ retval = DoGen3Cmd (cmd , sizeof (block_cmd ) + MIFARE_BLOCK_SIZE + CRC16_SIZE );
35713571 }
35723572
35733573OUT :
0 commit comments