mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Replace all uses of SHA*_Bytes / MD5Update.
In fact, those functions don't even exist any more. The only way to get data into a primitive hash state is via the new put_* system. Of course, that means put_data() is a viable replacement for every previous call to one of the per-hash update functions - but just mechanically doing that would have missed the opportunity to simplify a lot of the call sites.
This commit is contained in:
@ -49,7 +49,6 @@ static char *obfuscate_name(const char *realname)
|
||||
char *cryptdata;
|
||||
int cryptlen;
|
||||
SHA256_State sha;
|
||||
unsigned char lenbuf[4];
|
||||
unsigned char digest[32];
|
||||
char retbuf[65];
|
||||
int i;
|
||||
@ -90,9 +89,7 @@ static char *obfuscate_name(const char *realname)
|
||||
* so having got it back out of CryptProtectMemory we now hash it.
|
||||
*/
|
||||
SHA256_Init(&sha);
|
||||
PUT_32BIT_MSB_FIRST(lenbuf, cryptlen);
|
||||
SHA256_Bytes(&sha, lenbuf, 4);
|
||||
SHA256_Bytes(&sha, cryptdata, cryptlen);
|
||||
put_string(&sha, cryptdata, cryptlen);
|
||||
SHA256_Final(&sha, digest);
|
||||
|
||||
sfree(cryptdata);
|
||||
|
Reference in New Issue
Block a user