vimmer wrote:
This patch fix it:

The fix is already included in 0.8.1.2 release, you can get it from git://gitorious.org/pyicqt/mainline.git

If you don't know how to use git, you can download tarball from http://darkk.net.ru/tmp/pyicqt-0.8.1.2.tar.bz2 The tarball is result of:
git archive 0.8.1.2 | bzip2 > .../tmp/pyicqt-0.8.1.2.tar.bz2

I uploaded tarball to my own server as author have not released 0.8.1.2 yet :-)

I also attach the patch against 0.8.1.1, it's result of:
git log -p 0.8.1.1..0.8.1.2

--
WBRBW, Leonid Evdokimov
commit 97f08d5b51ee7384b30094a8f152aee82aed2e4e
Author: Roman Mindalev <[email protected]>
Date:   Thu Jan 22 20:22:47 2009 +0300

    Fix ICQ connection
    
    Thanks INF and Persei for research
    
    Signed-off-by: Roman Mindalev <[email protected]>

diff --git a/src/tlib/oscar.py b/src/tlib/oscar.py
index 7bc422b..9681ada 100644
--- a/src/tlib/oscar.py
+++ b/src/tlib/oscar.py
@@ -35,6 +35,11 @@ import config
 import datetime
 import utils
 
+def gen_init_seqid():
+    initpool = (9833, 14936, 19200, 21818, 23301, 24722, 26522, 5695, 23595, 
23620, 23049, 0x2886, 0x2493, 23620, 23049, 2853, 17372, 1255, 1796, 1657, 
13606, 1930, 23918, 31234, 30120, 24380, 0x1BEA, 0x5342, 0x30CC, 0x2294, 
0x5697, 0x25FA, 0x3C26, 0x3303, 0x078A, 0x0FC5, 0x25D6, 0x26EE,0x7570, 0x7F33, 
0x4E94, 0x07C9, 0x7339, 0x42A8)
+    r = random.randrange(0,len(initpool))
+    return initpool[r] - 1
+
 def logPacketData(data):
     # Comment out to display packet log data
     return
@@ -598,7 +603,7 @@ class SSIPDInfo:
 class OscarConnection(protocol.Protocol):
     def connectionMade(self):
         self.state=""
-        self.seqnum=0
+        self.seqnum=gen_init_seqid()
         self.buf=''
         self.outRate=6000
         self.outTime=time.time()
@@ -617,7 +622,7 @@ class OscarConnection(protocol.Protocol):
 
     def sendFLAP(self,data,channel = 0x02):
         if not hasattr(self, "seqnum"):
-             self.seqnum = 0
+             self.seqnum = gen_init_seqid()
         self.seqnum=(self.seqnum+1)%0xFFFF
         seqnum=self.seqnum
         head=struct.pack("!BBHH", 0x2a, channel,
@@ -4013,13 +4018,13 @@ class OscarAuthenticator(OscarConnection):
                TLV(TLV_USERNAME,self.username)+
                TLV(TLV_PASSWORD,encpass)+
                TLV(0x004C)+
-               TLV(TLV_CLIENTNAME,'ICQBasic')+
+               TLV(TLV_CLIENTNAME,'ICQ Client')+
                TLV(TLV_CLIENTID,"\x01\x0a")+
-               TLV(TLV_CLIENTMAJOR,"\x00\x14")+
-               TLV(TLV_CLIENTMINOR,"\x00\x22")+
-               TLV(TLV_CLIENTLESSER,"\x00\x01")+
-               TLV(TLV_CLIENTSUB,"\x06\x66")+
-               TLV(TLV_CLIENTDISTNUM,"\x00\x00\x06\x66")+
+               TLV(TLV_CLIENTMAJOR,"\x00\x06")+
+               TLV(TLV_CLIENTMINOR,"\x00\x05")+
+               TLV(TLV_CLIENTLESSER,"\x00\x00")+
+               TLV(TLV_CLIENTSUB,"\x00\x68")+
+               TLV(TLV_CLIENTDISTNUM,"\x00\x00\x75\x53")+
                TLV(TLV_LANG,"en")+
                TLV(TLV_COUNTRY,"us")))
         return "Cookie"

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to