mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-04 04:52:47 -05:00
Rename crc32() to crc32_compute(), to avoid clashing catastrophically
with the crc32() function in the zlib interface. (Not that PuTTY itself _uses_ zlib, but on Unix it's linked against libgtk which uses libpng which uses zlib. And zlib has poor namespace management so it defines this ridiculously intrusive function name. Arrrrgh.) [originally from svn r3191]
This commit is contained in:
4
ssh.c
4
ssh.c
@ -856,7 +856,7 @@ static int ssh1_rdpkt(Ssh ssh, unsigned char **data, int *datalen)
|
||||
if (ssh->cipher)
|
||||
ssh->cipher->decrypt(ssh->v1_cipher_ctx, ssh->pktin.data, st->biglen);
|
||||
|
||||
st->realcrc = crc32(ssh->pktin.data, st->biglen - 4);
|
||||
st->realcrc = crc32_compute(ssh->pktin.data, st->biglen - 4);
|
||||
st->gotcrc = GET_32BIT(ssh->pktin.data + st->biglen - 4);
|
||||
if (st->gotcrc != st->realcrc) {
|
||||
bombout(("Incorrect CRC received on packet"));
|
||||
@ -1244,7 +1244,7 @@ static int s_wrpkt_prepare(Ssh ssh)
|
||||
|
||||
for (i = 0; i < pad; i++)
|
||||
ssh->pktout.data[i + 4] = random_byte();
|
||||
crc = crc32(ssh->pktout.data + 4, biglen - 4);
|
||||
crc = crc32_compute(ssh->pktout.data + 4, biglen - 4);
|
||||
PUT_32BIT(ssh->pktout.data + biglen, crc);
|
||||
PUT_32BIT(ssh->pktout.data, len);
|
||||
|
||||
|
Reference in New Issue
Block a user