mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-06 12:14:04 -05:00
SAE: Fix memory leak in random number generation
If the randomly generated bignum does not meet the validation steps, the iteration loop in sae_get_rand() did not free the data properly. Fix the memory leak by freeing the temporary bignum before starting the next attempt at generating the value. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
de93da914f
commit
13c330385a
@ -134,8 +134,10 @@ static struct crypto_bignum * sae_get_rand(struct sae_data *sae)
|
|||||||
return NULL;
|
return NULL;
|
||||||
if (crypto_bignum_is_zero(bn) ||
|
if (crypto_bignum_is_zero(bn) ||
|
||||||
crypto_bignum_is_one(bn) ||
|
crypto_bignum_is_one(bn) ||
|
||||||
crypto_bignum_cmp(bn, sae->tmp->order) >= 0)
|
crypto_bignum_cmp(bn, sae->tmp->order) >= 0) {
|
||||||
|
crypto_bignum_deinit(bn, 0);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user