mirror of
https://github.com/wiire-a/pixiewps.git
synced 2025-07-27 07:44:36 +02:00
Fixed new PRNG false positive issue
This commit is contained in:
parent
7db5fd84f9
commit
c21e8b061c
@ -104,7 +104,7 @@ static void crack_thread_rtl(struct crack_job *j) {
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
glibc_lazyseed(&glibc_lazyprng, seed);
|
glibc_lazyseed(&glibc_lazyprng, seed);
|
||||||
if (glibc_rand1(&glibc_lazyprng) == job_control.randr_enonce[0]) {
|
if (glibc_rand1(&glibc_lazyprng) == job_control.randr_enonce[0]) {
|
||||||
if (!memcmp(glibc_randfill(&glibc_lazyprng, tmp), job_control.randr_enonce, 4)) {
|
if (!memcmp(glibc_randfill(&glibc_lazyprng, tmp), job_control.randr_enonce, WPS_NONCE_LEN)) {
|
||||||
job_control.nonce_seed = seed;
|
job_control.nonce_seed = seed;
|
||||||
DEBUG_PRINT("Seed found %u", seed);
|
DEBUG_PRINT("Seed found %u", seed);
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,11 @@ static unsigned int glibc_rand1(struct glibc_lazyprng *prng)
|
|||||||
static int *glibc_randfill(struct glibc_lazyprng *prng, uint32_t *arr)
|
static int *glibc_randfill(struct glibc_lazyprng *prng, uint32_t *arr)
|
||||||
{
|
{
|
||||||
int *state = prng->state;
|
int *state = prng->state;
|
||||||
arr[0] = ((unsigned int)(state[344 - 31] + state[344 - 3])) >> 1;
|
int const first = state[344 - 31] + state[344 - 3];
|
||||||
arr[1] = ((unsigned int)(state[344 - 31 + 1] + state[344 - 3 + 1])) >> 1;
|
arr[0] = ((unsigned int)first) >> 1;
|
||||||
arr[2] = ((unsigned int)(state[344 - 31 + 2] + state[344 - 3 + 2])) >> 1;
|
arr[1] = ((unsigned int)(state[344 - 31 + 1] + state[342 - 31] + state[342 - 3])) >> 1;
|
||||||
arr[3] = ((unsigned int)(state[344 - 31 + 3] + arr[0])) >> 1;
|
arr[2] = ((unsigned int)(state[344 - 31 + 2] + state[343 - 31] + state[343 - 3])) >> 1;
|
||||||
|
arr[3] = ((unsigned int)(state[344 - 31 + 3] + first)) >> 1;
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user