mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-12 00:06:09 -07:00
Update ikeys.c (#537)
FIX: 'hf iclass' - sneaky fread bug. It should return same number of bytes as read if ok. Thanks to @bettse who found it.
This commit is contained in:
parent
e1e7a09db1
commit
1c313691e6
1 changed files with 6 additions and 8 deletions
|
@ -739,18 +739,16 @@ int readKeyFile(uint8_t key[8])
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int retval = 1;
|
int retval = 1;
|
||||||
f = fopen("iclass_key.bin", "rb");
|
f = fopen("iclass_key.bin", "rb");
|
||||||
if (f)
|
if (!f)
|
||||||
{
|
return retval;
|
||||||
if(fread(key, sizeof(uint8_t), 8, f) == 1)
|
|
||||||
{
|
if (fread(key, sizeof(uint8_t), 8, f) == 8) {
|
||||||
retval = 0;
|
retval = 0;
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int doKeyTests(uint8_t debuglevel)
|
int doKeyTests(uint8_t debuglevel)
|
||||||
{
|
{
|
||||||
debug_print = debuglevel;
|
debug_print = debuglevel;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue