fix #1286 - wrong pwd/key length checks

This commit is contained in:
iceman1001 2021-05-24 21:54:09 +02:00
commit 59b86af1a8
2 changed files with 5 additions and 4 deletions

View file

@ -559,13 +559,13 @@ static int CmdLFHitagReader(const char *Cmd) {
}
// sanity checks
if (keylen != 0 && keylen != 6) {
PrintAndLogEx(WARNING, "Wrong KEY len expected 0 or 6, got %d", keylen);
if (keylen != 0 && keylen != 4) {
PrintAndLogEx(WARNING, "Wrong KEY len expected 0 or 4, got %d", keylen);
return PM3_EINVARG;
}
if (nalen != 0 && nalen != 8) {
PrintAndLogEx(WARNING, "Wrong NR/AR len expected 0 or 8, got %d", nalen);
if (nalen != 0 && nalen != 6) {
PrintAndLogEx(WARNING, "Wrong NR/AR len expected 0 or 6, got %d", nalen);
return PM3_EINVARG;
}

View file

@ -11,6 +11,7 @@
#ifndef _NDEF_H_
#define _NDEF_H_
#include <stdbool.h>
#include "common.h"
typedef enum {