FIX: several calls to nonce2key/nonce2key_ex has problems with not clearing up memory pointers laying around.
Still exists problem which needs to be dealt with.
This commit is contained in:
@@ -150,6 +150,7 @@ int nonce2key_ex(uint8_t blockno, uint8_t keytype, uint32_t uid, uint32_t nt, ui
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t retval = 1;
|
||||||
// Validate all key candidates with testing each of them with mfCheckKeys
|
// Validate all key candidates with testing each of them with mfCheckKeys
|
||||||
uint8_t keyBlock[6] = {0,0,0,0,0,0};
|
uint8_t keyBlock[6] = {0,0,0,0,0,0};
|
||||||
uint64_t key64;
|
uint64_t key64;
|
||||||
@@ -159,13 +160,16 @@ int nonce2key_ex(uint8_t blockno, uint8_t keytype, uint32_t uid, uint32_t nt, ui
|
|||||||
key64 = 0;
|
key64 = 0;
|
||||||
if (!mfCheckKeys(blockno, keytype, false, 1, keyBlock, &key64)) {
|
if (!mfCheckKeys(blockno, keytype, false, 1, keyBlock, &key64)) {
|
||||||
*key = key64;
|
*key = key64;
|
||||||
free(last_keylist);
|
retval = 0;
|
||||||
last_keylist = NULL;
|
goto out;
|
||||||
free(state);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
|
||||||
|
out:
|
||||||
|
free(last_keylist);
|
||||||
|
last_keylist = NULL;
|
||||||
|
free(state);
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 32 bit recover key from 2 nonces
|
// 32 bit recover key from 2 nonces
|
||||||
|
|||||||
Reference in New Issue
Block a user