mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-13 02:23:50 -05:00
Do an smemclr(bytes) in bignum_random_in_range.
It's used for sensitive data, so we shouldn't leave it lying around after free.
This commit is contained in:
parent
c46da2f079
commit
ae4986a433
1
sshbn.c
1
sshbn.c
@ -1260,6 +1260,7 @@ Bignum bignum_random_in_range(const Bignum lower, const Bignum upper)
|
|||||||
|
|
||||||
ret = bignum_from_bytes(bytes, upper_bytes);
|
ret = bignum_from_bytes(bytes, upper_bytes);
|
||||||
} while (bignum_cmp(ret, lower) < 0 || bignum_cmp(ret, upper) > 0);
|
} while (bignum_cmp(ret, lower) < 0 || bignum_cmp(ret, upper) > 0);
|
||||||
|
smemclr(bytes, upper_bytes);
|
||||||
sfree(bytes);
|
sfree(bytes);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user