Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 306270

Summary: [msn] ECF MSN Provider throws an Error
Product: [RT] ECF Reporter: Harshana Eranga Martin <harshana05>
Component: ecf.providersAssignee: Harshana Eranga Martin <harshana05>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: harshana05, remy.suen, slewis
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Harshana Eranga Martin CLA 2010-03-17 15:57:44 EDT
ECF MSN Provider throws the following error message when trying to connect through the ECF container.
 
"An internal error occurred during: "Container connect".
5"


Stack Trace:

java.lang.ArrayIndexOutOfBoundsException: 5
at org.eclipse.ecf.protocol.msn.NotificationSession.retrieveBuddyList(NotificationSession.java:163)
at org.eclipse.ecf.protocol.msn.NotificationSession.login(NotificationSession.java:112)
at org.eclipse.ecf.protocol.msn.MsnClient.connect(MsnClient.java:143)
at org.eclipse.ecf.internal.provider.msn.MSNContainer.connect(MSNContainer.java:306)
at org.eclipse.ecf.ui.actions.AsynchContainerConnectAction$AsynchActionJob.run(AsynchContainerConnectAction.java:112)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Harshana Eranga Martin CLA 2010-03-18 04:58:19 EDT
I tried finding the bug tracking the stack trace. I found it at the NotificationSession.java:163. 

Problem is there were few request i did not accept. But these requests, when we split the input at line 150, contact.length is 4. This is where the problem occurs. So when we check the contact.length at the switch, it goes to the default section and there it tries to access the contact[5]. In this case there are only up to contact[3]. so it throws the AIOFB exception.
Comment 2 Harshana Eranga Martin CLA 2011-08-21 13:17:23 EDT
Hi All,

I tried fixing this but it seems protocol has changed a lot. Hence need to understand the protocol first.
Comment 3 Harshana Eranga Martin CLA 2011-08-21 14:34:40 EDT
Hi All,

Here are the information I found so far.

Protocol Version we are using: MSNP11
Supported protocol versions by server: MSNP8 and upward

So after fixing the initial NPEs, I was able to login to the service but the contact list does not work as we expected since we do not receive LSG message which is providing group info as a reply for the SYN request we sent.

Therefore our contacts do not appear on the contacts list.

So currently I'm looking to fix this issue. 

Thanks and Regards,
Harshana
Comment 4 Harshana Eranga Martin CLA 2011-08-22 03:39:55 EDT
Hi All,

Now connecting to the MSN service is working. Presence info exchange also working fine. 

But when I try to type something in the Messages view, Eclipse stops responding. I'm now looking at the MessagesView class to identify the issue.
Comment 5 Harshana Eranga Martin CLA 2011-08-22 05:31:21 EDT
Eclipse is stucked because UI thread try to do some back ground thread. I think we have to use something similar to UI jobs to fix it. 

Therefore the Eclipse is stucked and fails to respond.
Comment 6 Harshana Eranga Martin CLA 2011-08-22 07:57:42 EDT
I just found the reason why UI Thread stucked. 

When the Server challenges our client, our response to challenge fails. Therefore server close the connection from server side.

Therefore while we are waiting for the WhiteBoard session to be initiated, server has closed connection.

Since we are running a while waiting for correct response for our XFR, our UI is blocked since we do not receive anything.

Here is the conversation:

When ECF MSN client try to initiate a connection,

CHG 6 NLN 268435488

MSG Hotmail Hotmail 2332
MIME-Version: 1.0
Content-Type: text/x-msmsgsinitialmdatanotification; charset=UTF-8

Mail-Data: <MD><E><I>1</I><IU>1</IU><O>1</O><OU>1</OU></E><Q><QTM>409600</QTM><QNM>204800</QNM></Q><M><T>11</T><S>7</S><RT>2011-08-22T07:47:15.450Z</RT><RS>0</RS><SZ>903</SZ><E>harshana.martin@live.com</E><I>C2E7E8DA-8556-46A1-AE7C-60E381E5F20E</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T07:49:17.983Z</RT><RS>0</RS><SZ>912</SZ><E>harshana.martin@live.com</E><I>E67E5C02-04EB-4264-BDB0-43761D54FC66</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T07:49:39.680Z</RT><RS>0</RS><SZ>934</SZ><E>harshana.martin@live.com</E><I>F1EE1D10-E643-416E-A97D-F53F47BDEC81</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T07:50:26.863Z</RT><RS>0</RS><SZ>927</SZ><E>harshana.martin@live.com</E><I>3989DE92-20D1-4000-8
06D-C2E061B67753</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T09:27:16.207Z</RT><RS>0</RS><SZ>908</SZ><E>harshana.martin@live.com</E><I>C9356ABF-40A3-4480-AB69-AAAF32E92D21</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T10:20:45.900Z</RT><RS>0</RS><SZ>909</SZ><E>harshana.martin@live.com</E><I>F1BC40B1-255A-473F-9205-2E2036414BFB</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T10:57:52.530Z</RT><RS>0</RS><SZ>905</SZ><E>harshana.martin@live.com</E><I>B1A8DAF1-D74C-4C43-B52C-9996DC9C5740</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T10:58:58.253Z</RT><RS>0</RS><SZ>909</SZ><E>harshana.martin@live.com</E><I>EEAEB869-C0CF-4A61-9BAF-670830A62D67</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</
S><RT>2011-08-22T11:14:50.687Z</RT><RS>0</RS><SZ>917</SZ><E>harshana.martin@live.com</E><I>201CEE78-059B-467C-850B-D7716CD18AD7</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M></MD>
Inbox-URL: /cgi-bin/HoTMaiL
Folders-URL: /cgi-bin/folders
Post-URL: http://www.hotmail.com

ILN 0 IDL harshana.martin@live.com Eranga 2684355072
UBX harshana.martin@live.com 419
<Data><FriendlyName>Eranga</FriendlyName><PSM></PSM><ColorScheme></ColorScheme><UserTileLocation></UserTileLocation><RUM></RUM><RUL></RUL><RLT></RLT><RID></RID><EndpointData id="{37645270-1b04-46f7-9e9e-3da6f467ae81}"><Capabilities>2684355072:2147484936:1</Capabilities><DMN>mail.live.com</DMN><WebAppData domain="mail.live.com"><MsgIds><Id>json</Id></MsgIds><Properties></Properties></WebAppData></EndpointData></Data>


XFR 7 SB 64.4.44.29:1863 CKI 782071035.24371236.98206248

CHL 0 17033179281455005435

540 8

When we are waiting few seconds before doing anything else, server do the challenge and fails. Following conversation is for that.

MSG Hotmail Hotmail 2332
MIME-Version: 1.0
Content-Type: text/x-msmsgsinitialmdatanotification; charset=UTF-8

Mail-Data: <MD><E><I>1</I><IU>1</IU><O>1</O><OU>1</OU></E><Q><QTM>409600</QTM><QNM>204800</QNM></Q><M><T>11</T><S>7</S><RT>2011-08-22T07:47:15.450Z</RT><RS>0</RS><SZ>903</SZ><E>harshana.martin@live.com</E><I>C2E7E8DA-8556-46A1-AE7C-60E381E5F20E</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T07:49:17.983Z</RT><RS>0</RS><SZ>912</SZ><E>harshana.martin@live.com</E><I>E67E5C02-04EB-4264-BDB0-43761D54FC66</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T07:49:39.680Z</RT><RS>0</RS><SZ>934</SZ><E>harshana.martin@live.com</E><I>F1EE1D10-E643-416E-A97D-F53F47BDEC81</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T07:50:26.863Z</RT><RS>0</RS><SZ>927</SZ><E>harshana.martin@live.com</E><I>3989DE92-20D1-4000-8
06D-C2E061B67753</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T09:27:16.207Z</RT><RS>0</RS><SZ>908</SZ><E>harshana.martin@live.com</E><I>C9356ABF-40A3-4480-AB69-AAAF32E92D21</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T10:20:45.900Z</RT><RS>0</RS><SZ>909</SZ><E>harshana.martin@live.com</E><I>F1BC40B1-255A-473F-9205-2E2036414BFB</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T10:57:52.530Z</RT><RS>0</RS><SZ>905</SZ><E>harshana.martin@live.com</E><I>B1A8DAF1-D74C-4C43-B52C-9996DC9C5740</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</S><RT>2011-08-22T10:58:58.253Z</RT><RS>0</RS><SZ>909</SZ><E>harshana.martin@live.com</E><I>EEAEB869-C0CF-4A61-9BAF-670830A62D67</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M><M><T>11</T><S>7</
S><RT>2011-08-22T11:14:50.687Z</RT><RS>0</RS><SZ>917</SZ><E>harshana.martin@live.com</E><I>201CEE78-059B-467C-850B-D7716CD18AD7</I><F>00000000-0000-0000-0000-000000000009</F><N>harshana.martin@live.com</N></M></MD>
Inbox-URL: /cgi-bin/HoTMaiL
Folders-URL: /cgi-bin/folders
Post-URL: http://www.hotmail.com
CHG 6 NLN 268435488

NLN IDL harshana.martin@live.com Eranga 2684355072
UBX harshana.martin@live.com 419
<Data><FriendlyName>Eranga</FriendlyName><PSM></PSM><ColorScheme></ColorScheme><UserTileLocation></UserTileLocation><RUM></RUM><RUL></RUL><RLT></RLT><RID></RID><EndpointData id="{37645270-1b04-46f7-9e9e-3da6f467ae81}"><Capabilities>2684355072:2147484936:1</Capabilities><DMN>mail.live.com</DMN><WebAppData domain="mail.live.com"><MsgIds><Id>json</Id></MsgIds><Properties></Properties></WebAppData></EndpointData></Data>
CHL 0 65458074714824015831383668628

540 7
Comment 7 Harshana Eranga Martin CLA 2011-08-27 03:34:31 EDT
I found some leads on fixing this Crypto related issue. I'm looking at those now.
Comment 8 Harshana Eranga Martin CLA 2011-08-28 15:14:52 EDT
Hi,

I tried current implementation with previously verified use-cases and it seems current impl is pretty much buggy. 

So I looked in to more implementation but none of them worked so far.

Here are the links about the algorithm:

[1]. http://msnpiki.msnfanatic.com/index.php/MSNP11:Challenges
[2]. http://msnpiki.msnfanatic.com/index.php/MSNP8:Challenges
Comment 9 Harshana Eranga Martin CLA 2012-01-29 11:14:41 EST
Hi All,

Started fixing this by adding a MD5 Hash function which provides 128bit hash value. 

Then we need to convert this in to a 64bit hash values according to MSN challenge response algorithm [1].

[1]. http://msnpiki.msnfanatic.com/index.php/MSNP11:Challenges

Thanks and Regards,
Harshana
Comment 10 Scott Lewis CLA 2014-02-12 14:39:53 EST
msn provider likely to be retired.