mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +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] |= 64;
|
||||
key->privateKey = bignum_from_bytes(bytes, sizeof(bytes));
|
||||
for (i = 0; i < sizeof(bytes); ++i)
|
||||
{
|
||||
((volatile char*)bytes)[i] = 0;
|
||||
}
|
||||
smemclr(bytes, sizeof(bytes));
|
||||
if (!key->privateKey) {
|
||||
sfree(key);
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user