1
0
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:
Simon Tatham 2016-01-25 19:24:41 +00:00
parent 51465fac73
commit 0f1cab3182

View File

@ -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;