mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-02-09 16:36:34 +00:00
Replace an ad-hoc buffer-clearing loop with smemclr.
Thanks to @ch3root on Twitter for spotting it, and thanks to Chris Emerson for bothering to let me know. I must have missed this when I code-reviewed the ECC contribution.
This commit is contained in:
parent
51465fac73
commit
0f1cab3182
5
sshecc.c
5
sshecc.c
@ -2761,10 +2761,7 @@ void *ssh_ecdhkex_newkey(const struct ssh_kex *kex)
|
|||||||
bytes[31] &= 127;
|
bytes[31] &= 127;
|
||||||
bytes[31] |= 64;
|
bytes[31] |= 64;
|
||||||
key->privateKey = bignum_from_bytes(bytes, sizeof(bytes));
|
key->privateKey = bignum_from_bytes(bytes, sizeof(bytes));
|
||||||
for (i = 0; i < sizeof(bytes); ++i)
|
smemclr(bytes, sizeof(bytes));
|
||||||
{
|
|
||||||
((volatile char*)bytes)[i] = 0;
|
|
||||||
}
|
|
||||||
if (!key->privateKey) {
|
if (!key->privateKey) {
|
||||||
sfree(key);
|
sfree(key);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user