mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
FIX: 'hf iclass' - sneaky fread bug. thanks to @bettse who found it
This commit is contained in:
parent
d5ce45bae7
commit
f92a6ddf7d
1 changed files with 7 additions and 8 deletions
|
@ -675,23 +675,22 @@ int doTestsWithKnownInputs() {
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
int readKeyFile(uint8_t key[8]) {
|
static bool readKeyFile(uint8_t key[8]) {
|
||||||
int retval = 1;
|
bool retval = false;
|
||||||
FILE *f = fopen("iclass_key.bin", "rb");
|
FILE *f = fopen("iclass_key.bin", "rb");
|
||||||
if (!f)
|
if (!f)
|
||||||
return 0;
|
return retval;
|
||||||
|
|
||||||
size_t bytes_read = fread(key, sizeof(uint8_t), 8, f);
|
size_t bytes_read = fread(key, sizeof(uint8_t), sizeof(key), f);
|
||||||
if ( bytes_read == 1)
|
if ( bytes_read == sizeof(key))
|
||||||
retval = 0;
|
retval = true;
|
||||||
|
|
||||||
if (f)
|
if (f)
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int doKeyTests(uint8_t debuglevel)
|
int doKeyTests(uint8_t debuglevel) {
|
||||||
{
|
|
||||||
debug_print = debuglevel;
|
debug_print = debuglevel;
|
||||||
|
|
||||||
prnlog("[+] Checking if the master key is present (iclass_key.bin)...");
|
prnlog("[+] Checking if the master key is present (iclass_key.bin)...");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue