mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-25 00:25:48 +08:00
emrtd: Remove redundant padding code
This commit is contained in:
parent
b31a610566
commit
8cb25b742a
1 changed files with 2 additions and 9 deletions
|
@ -221,12 +221,6 @@ static void des3_decrypt_cbc(uint8_t *iv, uint8_t *key, uint8_t *input, int inpu
|
|||
mbedtls_des3_free(&ctx);
|
||||
}
|
||||
|
||||
static void emrtd_pad_docnum(char *input) {
|
||||
for (int i = strlen(input); i < 9; i++) {
|
||||
input[i] = '<';
|
||||
}
|
||||
}
|
||||
|
||||
static int pad_block(uint8_t *input, int inputlen, uint8_t *output) {
|
||||
uint8_t padding[8] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
|
@ -834,8 +828,6 @@ static bool emrtd_do_auth(char *documentnumber, char *dob, char *expiry, bool BA
|
|||
uint8_t response[EMRTD_MAX_FILE_SIZE] = { 0x00 };
|
||||
int resplen = 0;
|
||||
|
||||
emrtd_pad_docnum(documentnumber);
|
||||
|
||||
// Try to 14a
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
|
@ -1237,7 +1229,8 @@ static int cmd_hf_emrtd_dump(const char *Cmd) {
|
|||
if (CLIParamStrToBuf(arg_get_str(ctx, 1), docnum, 9, &slen) != 0 || slen == 0) {
|
||||
BAC = false;
|
||||
} else {
|
||||
if ( slen != 9) {
|
||||
if (slen != 9) {
|
||||
// Pad to 9 with <
|
||||
memset(docnum + slen, 0x3c, 9 - slen);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue