mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-14 09:37:34 -05:00
Add the CRC32 compensation attack detector that all other SSH
clients have had for ages and I forgot about. Of course I've got the version with the buffer overflow fixed! [originally from svn r1535]
This commit is contained in:
8
sshcrc.c
8
sshcrc.c
@ -211,9 +211,8 @@ int main(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
unsigned long crc32(const void *buf, size_t len)
|
||||
unsigned long crc32_update(unsigned long crcword, const void *buf, size_t len)
|
||||
{
|
||||
unsigned long crcword = 0L;
|
||||
const unsigned char *p = (const unsigned char *) buf;
|
||||
while (len--) {
|
||||
unsigned long newbyte = *p++;
|
||||
@ -222,3 +221,8 @@ unsigned long crc32(const void *buf, size_t len)
|
||||
}
|
||||
return crcword;
|
||||
}
|
||||
|
||||
unsigned long crc32(const void *buf, size_t len)
|
||||
{
|
||||
return crc32_update(0L, buf, len);
|
||||
}
|
||||
|
Reference in New Issue
Block a user