mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Adopt the new hash API functions where they're useful.
This commit switches as many ssh_hash_free / ssh_hash_new pairs as possible to reuse the previous hash object via ssh_hash_reset. Also a few other cleanups: use the wrapper function hash_simple() where possible, and I've also introduced ssh_hash_digest_nondestructive() and switched to that where possible as well.
This commit is contained in:
@ -86,11 +86,7 @@ static char *obfuscate_name(const char *realname)
|
||||
* We don't want to give away the length of the hostname either,
|
||||
* so having got it back out of CryptProtectMemory we now hash it.
|
||||
*/
|
||||
{
|
||||
ssh_hash *h = ssh_hash_new(&ssh_sha256);
|
||||
put_string(h, cryptdata, cryptlen);
|
||||
ssh_hash_final(h, digest);
|
||||
}
|
||||
hash_simple(&ssh_sha256, make_ptrlen(cryptdata, cryptlen), digest);
|
||||
|
||||
sfree(cryptdata);
|
||||
|
||||
|
Reference in New Issue
Block a user