fix data crypt - output error. We have 8 bytes.
This commit is contained in:
1 parent
fd88967443
commit
a0efcb2686
3 files changed
+32
-1
No files matched your search
@@ -3681,7 +3681,7 @@ static int CmdCryptography(const char *Cmd) {
|
|||||||
if ((type & 0x02) == 0x02) {
|
if ((type & 0x02) == 0x02) {
|
||||||
// If we will calculate a MAC
|
// If we will calculate a MAC
|
||||||
aes_cmac8(iv, key, dati, dato, datilen);
|
aes_cmac8(iv, key, dati, dato, datilen);
|
||||||
PrintAndLogEx(INFO, "AES CMAC... " _YELLOW_("%s"), sprint_hex_inrow(dato, datilen));
|
PrintAndLogEx(INFO, "AES CMAC... " _YELLOW_("%s"), sprint_hex_inrow(dato, 8));
|
||||||
} else {
|
} else {
|
||||||
if (keylen == 32) {
|
if (keylen == 32) {
|
||||||
aes256_encode(iv, key, dati, dato, datilen);
|
aes256_encode(iv, key, dati, dato, datilen);
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ typedef enum ISO14A_COMMAND {
|
|||||||
ISO14A_USE_CUSTOM_POLLING = (1 << 13),
|
ISO14A_USE_CUSTOM_POLLING = (1 << 13),
|
||||||
ISO14A_CRYPTO1MODE = (1 << 14),
|
ISO14A_CRYPTO1MODE = (1 << 14),
|
||||||
ISO14A_SET_WAIT_US = (1 << 15),
|
ISO14A_SET_WAIT_US = (1 << 15),
|
||||||
|
ISO14A_APPEND_CMAC = (1 << 16),
|
||||||
} iso14a_command_t;
|
} iso14a_command_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -355,6 +355,36 @@ typedef struct {
|
|||||||
uint8_t keys[];
|
uint8_t keys[];
|
||||||
} PACKED mfulc_keys_t;
|
} PACKED mfulc_keys_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
bool turn_off_field;
|
||||||
|
bool use_schann;
|
||||||
|
uint8_t keyno;
|
||||||
|
uint8_t key[16];
|
||||||
|
} PACKED mfulaes_keys_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
bool use_schann;
|
||||||
|
uint8_t block_no;
|
||||||
|
uint8_t num_of_blocks;
|
||||||
|
uint8_t keytype;
|
||||||
|
uint8_t keylen;
|
||||||
|
uint8_t key[16];
|
||||||
|
} PACKED mful_readblock_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint8_t bytelen;
|
||||||
|
uint16_t startidx;
|
||||||
|
} PACKED mful_readblock_resp_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
bool use_schann;
|
||||||
|
uint8_t block_no;
|
||||||
|
uint8_t keytype;
|
||||||
|
uint8_t keylen;
|
||||||
|
uint8_t key[16];
|
||||||
|
uint8_t data[16];
|
||||||
|
} PACKED mful_writeblock_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
uint8_t CSN[8];
|
uint8_t CSN[8];
|
||||||
|
|||||||
Reference in new issue
Block a user