-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

the source code for the p2p handshake packets for the old protocols versions
has the ICQ_VERSION_TCP harcored. This breaks the handshakes with older
protocols. I was traying to send some messages being offline and i got:

01:42:53: [WRN] Invalid TCP version 0.  Attempting v6.
01:42:53: [TCP] Sending request for secure channel to Juam (#1).
01:42:53: [WRN] Invalid TCP version 0.  Attempting v6.
01:42:53: [TCP] Connecting to Juam (XXXXXXX) at 192.168.159.5:60000.
01:42:53: [TCP] Shaking hands with Juam (XXXXXXX) [v6].
01:42:53: [PKT] Packet (TCPv6, 44 bytes) sent:
                (192.168.159.5:33151 -> 192.168.159.5:60000)
     0000: FF 08 00 00 00 XX XX XX  00 00 00 00 00 00 00 XX
     0010: XX XX XX 00 00 00 00 00  00 00 00 04 88 13 00 00
     0020: 91 C3 B9 3A 50 00 00 00  03 00 00 00
01:42:53: [PKT] Packet (TCPv6, 4 bytes) received:
                (192.168.159.5:33151 <- 192.168.159.5:60000)
     0000: 01 00 00 00                                        ....
01:42:53: [PKT] Packet (TCPv6, 48 bytes) received:
                (192.168.159.5:33151 <- 192.168.159.5:60000)
     0000: FF 08 00 2B 00 XX XX XX  XX 00 00 60 EA 00 00 XX
     0010: XX XX 00 00 00 00 00 00  00 00 00 04 60 EA 00 00
     0020: 00 00 00 00 50 00 00 00  03 00 00 00 00 00 00 00
01:42:53: [WRN] Bad handshake session id: received 0, expecting 985252753

The attached patch fix this.

I've the feelling that CPacketTcp::InitBuffer_v2, CPacketTcp::InitBuffer_v4 suffers 
from the same problem.

Best wishes,
        Juan.
- --
Buenos Aires, Argentina

-----BEGIN PGP SIGNATURE-----

iD8DBQE+LMMVUMlRieHkprgRApoZAJ0S1/KTpapQSLqZTVIs6We5r6fbsgCfWkAA
1WKgJGXwL3mMGAaybOvhNpc=
=DV0i
-----END PGP SIGNATURE-----
--- cvs/src/icqpacket.cpp	2003-01-19 21:32:45.000000000 -0300
+++ licq/src/icqpacket.cpp	2003-01-21 00:27:09.000000000 -0300
@@ -2927,7 +2927,7 @@
   buffer = new CBuffer(m_nSize);
 
   buffer->PackChar(ICQ_CMDxTCP_HANDSHAKE);
-  buffer->PackUnsignedLong(ICQ_VERSION_TCP);
+  buffer->PackUnsignedLong(2L);
   buffer->PackUnsignedLong(m_nLocalPort);
   buffer->PackUnsignedLong(gUserManager.OwnerUin());
   buffer->PackUnsignedLong(s_nLocalIp);
@@ -2945,7 +2945,7 @@
   buffer = new CBuffer(m_nSize);
 
   buffer->PackChar(ICQ_CMDxTCP_HANDSHAKE);
-  buffer->PackUnsignedLong(ICQ_VERSION_TCP);
+  buffer->PackUnsignedLong(4L);
   buffer->PackUnsignedLong(0x00000000);
   buffer->PackUnsignedLong(gUserManager.OwnerUin());
   buffer->PackUnsignedLong(s_nLocalIp); // maybe should be 0
@@ -2968,7 +2968,7 @@
 
   buffer->PackChar(ICQ_CMDxTCP_HANDSHAKE);
   //buffer->PackUnsignedLong(0x00270006);
-  buffer->PackUnsignedLong(ICQ_VERSION_TCP);
+  buffer->PackUnsignedLong(6L);
   buffer->PackUnsignedLong(m_nDestinationUin);
   buffer->PackUnsignedShort(0);
   buffer->PackUnsignedLong(nLocalPort);

Reply via email to