mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-02 21:54:10 +08: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;
|
||||
}
|
||||
|
||||
int readKeyFile(uint8_t key[8]) {
|
||||
int retval = 1;
|
||||
static bool readKeyFile(uint8_t key[8]) {
|
||||
bool retval = false;
|
||||
FILE *f = fopen("iclass_key.bin", "rb");
|
||||
if (!f)
|
||||
return 0;
|
||||
return retval;
|
||||
|
||||
size_t bytes_read = fread(key, sizeof(uint8_t), 8, f);
|
||||
if ( bytes_read == 1)
|
||||
retval = 0;
|
||||
size_t bytes_read = fread(key, sizeof(uint8_t), sizeof(key), f);
|
||||
if ( bytes_read == sizeof(key))
|
||||
retval = true;
|
||||
|
||||
if (f)
|
||||
fclose(f);
|
||||
return retval;
|
||||
}
|
||||
|
||||
int doKeyTests(uint8_t debuglevel)
|
||||
{
|
||||
int doKeyTests(uint8_t debuglevel) {
|
||||
debug_print = debuglevel;
|
||||
|
||||
prnlog("[+] Checking if the master key is present (iclass_key.bin)...");
|
||||
|
|
Loading…
Reference in a new issue