Bugzilla – Attachment 321788 Details for
Bug 516347
kopete cant connect to yahoo
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
Patch to Implement Yahoo Messenger protocol version16
r986796_YMSG_protocol_version_16.diff (text/plain), 26.54 KB, created by
Henning Brandt
on 2009-10-09 10:36:34 UTC
(
hide
)
Description:
Patch to Implement Yahoo Messenger protocol version16
Filename:
MIME Type:
Creator:
Henning Brandt
Created:
2009-10-09 10:36:34 UTC
Size:
26.54 KB
patch
obsolete
>diff -Naur kopete/kopete/kconf_update/CMakeLists.txt kopete/kopete/kconf_update/CMakeLists.txt >--- kopete/kopete/kconf_update/CMakeLists.txt 2008-01-05 00:59:03.000000000 +0100 >+++ kopete/kopete/kconf_update/CMakeLists.txt 2009-10-08 21:28:36.000000000 +0200 >@@ -3,10 +3,9 @@ > install(FILES kopete-account-kconf_update.upd kopete-jabberproxytype-kconf_update.upd kopete-jabberpriorityaddition-kconf_update.upd kopete-pluginloader2.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR}) > endif(NOT WIN32) > >+install( FILES kopete-pluginloader.upd kopete-nameTracking.upd kopete-update_yahoo_server.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR}) > >-install( FILES kopete-pluginloader.upd kopete-nameTracking.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR}) >- >-install( PROGRAMS kopete-pluginloader.pl >+install( PROGRAMS kopete-pluginloader.pl kopete-update_yahoo_server.pl > kopete-account-0.10.pl DESTINATION ${KCONF_UPDATE_INSTALL_DIR}) > > >diff -Naur kopete/kopete/kconf_update/kopete-update_yahoo_server.pl kopete/kopete/kconf_update/kopete-update_yahoo_server.pl >--- kopete/kopete/kconf_update/kopete-update_yahoo_server.pl 1970-01-01 01:00:00.000000000 +0100 >+++ kopete/kopete/kconf_update/kopete-update_yahoo_server.pl 2009-10-08 21:28:47.000000000 +0200 >@@ -0,0 +1,370 @@ >+ >+ >+ >+ >+ >+ >+ >+ >+ >+ >+ >+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> >+<!-- ViewVC :: http://www.viewvc.org/ --> >+<head> >+<title>[KDE] Contents of /branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl</title> >+<meta name="generator" content="ViewVC 1.1.2" /> >+<link rel="shortcut icon" href="/docroot/images/favicon.ico" type="image/x-icon" /> >+<link rel="stylesheet" href="/docroot/styles.css" type="text/css" /> >+ >+</head> >+<body> >+<div class="vc_navheader"> >+<table><tr> >+<td><strong><a href="/?view=roots"><span class="pathdiv">/</span></a><a href="/?pathrev=986796">[KDE]</a><span class="pathdiv">/</span><a href="/branches/?pathrev=986796">branches</a><span class="pathdiv">/</span><a href="/branches/KDE/?pathrev=986796">KDE</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/?pathrev=986796">4.2</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/?pathrev=986796">kdenetwork</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/kopete/?pathrev=986796">kopete</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/?pathrev=986796">kopete</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/?pathrev=986796">kconf_update</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl?view=log&pathrev=986796">kopete-update_yahoo_server.pl</a></strong></td> >+<td style="text-align: right;"></td> >+</tr></table> >+</div> >+<div style="float: right; padding: 5px;"><a href="http://www.viewvc.org/" title="ViewVC Home"><img src="/docroot/images/viewvc-logo.png" alt="ViewVC logotype" width="240" height="70" /></a></div> >+<h1>Contents of /branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl</h1> >+ >+<p style="margin:0;"> >+ >+<a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/?pathrev=986796"><img src="/docroot/images/back_small.png" class="vc_icon" alt="Parent Directory" /> Parent Directory</a> >+ >+| <a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl?view=log&pathrev=986796"><img src="/docroot/images/log.png" class="vc_icon" alt="Revision Log" /> Revision Log</a> >+ >+ >+ >+ >+</p> >+ >+<hr /> >+<div class="vc_summary"> >+Revision <a href="/?view=revision&revision=986796"><strong>986796</strong></a> - >+(<a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl?annotate=986796&pathrev=986796"><strong>show annotations</strong></a>) >+(<a href="/*checkout*/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl?revision=986796&pathrev=986796"><strong>download</strong></a>) >+ >+ >+<br /><em>Thu Jun 25 03:25:44 2009 UTC</em> >+(3 months, 2 weeks ago) >+by <em>mattr</em> >+ >+ >+ >+ >+ >+ >+<br />File MIME type: text/plain >+ >+ >+<br />File size: 427 byte(s) >+ >+ >+ >+ >+ >+ >+<pre class="vc_log">Implement YMSG protocol version 16 authentication >+ >+Fixes bug 197104 >+ >+CCBUG: 197104 >+ >+This is the backport for KDE 4.2 >+ >+Squashed commit of the following: >+ >+commit 2589b7859c3332d3e4c1e3623b9a5182ea060436 >+Author: Matt Rogers <mattr@kde.org> >+Date: Wed Jun 24 21:19:42 2009 -0500 >+ >+ Update existing yahoo.com servers to the new one >+ >+ This kconf_update script changes all the server lines for Yahoo accounts >+ to scsa.msg.yahoo.com if the domain name ended with ".yahoo.com" so that >+ users don't have to go in and change their config manually in order to >+ be able to login. >+ >+commit ca1ea33d0047877afd200d2d3c656a7235ef8009 >+Author: Matt Rogers <mattr@kde.org> >+Date: Wed Jun 24 20:45:18 2009 -0500 >+ >+ Set the Yahoo default server to scsa.msg.yahoo.com >+ >+ This is inline with what several of the other clients do now that we all >+ seem to be using protocol 16 authentication methods. >+ >+commit 9ad7a11e53815f0333909a765c81ea7131c20693 >+Author: Matt Rogers <mattr@kde.org> >+Date: Wed Jun 24 20:40:36 2009 -0500 >+ >+ Implement YMSG protocol version 16 authentication. >+ >+ Kopete's Yahoo protocol can now login again, fixing bug 197104 >+ >+ This is the fix for trunk (4.4) which will be backported to 4.3 and 4.2 >+ Thanks to the Pidgin folks for implementing it first and letting me use >+ their code. :)</pre> >+ >+</div> >+ >+ >+ >+ >+ >+ >+<div id="vc_file"> >+<table cellspacing="0" cellpadding="0"> >+ >+ >+ >+ >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l1"> >+<td class="vc_file_line_number">1</td> >+ >+<td class="vc_file_line_text">#!/usr/bin/perl >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l2"> >+<td class="vc_file_line_number">2</td> >+ >+<td class="vc_file_line_text"> >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l3"> >+<td class="vc_file_line_number">3</td> >+ >+<td class="vc_file_line_text"># Rename the old Gaim style to Pidgin >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l4"> >+<td class="vc_file_line_number">4</td> >+ >+<td class="vc_file_line_text"> >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l5"> >+<td class="vc_file_line_number">5</td> >+ >+<td class="vc_file_line_text">my $inYahoo = 0; >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l6"> >+<td class="vc_file_line_number">6</td> >+ >+<td class="vc_file_line_text">foreach (<>) { >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l7"> >+<td class="vc_file_line_number">7</td> >+ >+<td class="vc_file_line_text"> $inYahoo = 1 if (/^\[Account_YahooProtocol_.*$/); >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l8"> >+<td class="vc_file_line_number">8</td> >+ >+<td class="vc_file_line_text"> if ($inYahoo) { >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l9"> >+<td class="vc_file_line_number">9</td> >+ >+<td class="vc_file_line_text"> if (/^Server\=(.*)/) { >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l10"> >+<td class="vc_file_line_number">10</td> >+ >+<td class="vc_file_line_text"> my $oldServer = $1; >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l11"> >+<td class="vc_file_line_number">11</td> >+ >+<td class="vc_file_line_text"> if ($oldServer =~ m/\.yahoo\.com$/) { >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l12"> >+<td class="vc_file_line_number">12</td> >+ >+<td class="vc_file_line_text"> print "Server=scsa.msg.yahoo.com\n"; >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l13"> >+<td class="vc_file_line_number">13</td> >+ >+<td class="vc_file_line_text"> $inYahoo = 0; >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l14"> >+<td class="vc_file_line_number">14</td> >+ >+<td class="vc_file_line_text"> next; >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l15"> >+<td class="vc_file_line_number">15</td> >+ >+<td class="vc_file_line_text"> } >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l16"> >+<td class="vc_file_line_number">16</td> >+ >+<td class="vc_file_line_text"> } >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l17"> >+<td class="vc_file_line_number">17</td> >+ >+<td class="vc_file_line_text"> } >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l18"> >+<td class="vc_file_line_number">18</td> >+ >+<td class="vc_file_line_text"> >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l19"> >+<td class="vc_file_line_number">19</td> >+ >+<td class="vc_file_line_text"> print $_; >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l20"> >+<td class="vc_file_line_number">20</td> >+ >+<td class="vc_file_line_text">} >+</td> >+</tr> >+ >+ >+</table> >+</div> >+ >+ >+ >+<hr/> >+<div class="vc_properties"> >+<h2>Properties</h2> >+<table cellspacing="1" cellpadding="2" class="auto"> >+<thead> >+<tr> >+<th class="vc_header_sort">Name</th> >+<th class="vc_header">Value</th> >+</tr> >+</thead> >+<tbody> >+ >+<tr class="vc_row_even"> >+<td><strong>svn:executable</strong></td> >+ >+<td style="white-space: pre;">*</td> >+ >+</tr> >+ >+</tbody> >+</table> >+</div> >+ >+ >+ >+<hr /> >+<table> >+<tr> >+<td><address><a href="mailto:<a href="mailto:sysadmin@kde.org">KDE Sysadmin</a>"><a href="mailto:sysadmin@kde.org">KDE Sysadmin</a></a></address></td> >+<td style="text-align: right;"><strong><a href="/docroot/help_rootview.html">ViewVC Help</a></strong></td> >+</tr> >+<tr> >+<td>Powered by <a href="http://viewvc.tigris.org/">ViewVC 1.1.2</a></td> >+<td style="text-align: right;"> </td> >+</tr> >+</table> >+</body> >+</html> >+ >diff -Naur kopete/kopete/kconf_update/kopete-update_yahoo_server.upd kopete/kopete/kconf_update/kopete-update_yahoo_server.upd >--- kopete/kopete/kconf_update/kopete-update_yahoo_server.upd 1970-01-01 01:00:00.000000000 +0100 >+++ kopete/kopete/kconf_update/kopete-update_yahoo_server.upd 2009-10-08 21:28:47.000000000 +0200 >@@ -0,0 +1,185 @@ >+ >+ >+ >+ >+ >+ >+ >+ >+ >+ >+ >+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> >+<!-- ViewVC :: http://www.viewvc.org/ --> >+<head> >+<title>[KDE] Contents of /branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd</title> >+<meta name="generator" content="ViewVC 1.1.2" /> >+<link rel="shortcut icon" href="/docroot/images/favicon.ico" type="image/x-icon" /> >+<link rel="stylesheet" href="/docroot/styles.css" type="text/css" /> >+ >+</head> >+<body> >+<div class="vc_navheader"> >+<table><tr> >+<td><strong><a href="/?view=roots"><span class="pathdiv">/</span></a><a href="/?pathrev=986796">[KDE]</a><span class="pathdiv">/</span><a href="/branches/?pathrev=986796">branches</a><span class="pathdiv">/</span><a href="/branches/KDE/?pathrev=986796">KDE</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/?pathrev=986796">4.2</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/?pathrev=986796">kdenetwork</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/kopete/?pathrev=986796">kopete</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/?pathrev=986796">kopete</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/?pathrev=986796">kconf_update</a><span class="pathdiv">/</span><a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd?view=log&pathrev=986796">kopete-update_yahoo_server.upd</a></strong></td> >+<td style="text-align: right;"></td> >+</tr></table> >+</div> >+<div style="float: right; padding: 5px;"><a href="http://www.viewvc.org/" title="ViewVC Home"><img src="/docroot/images/viewvc-logo.png" alt="ViewVC logotype" width="240" height="70" /></a></div> >+<h1>Contents of /branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd</h1> >+ >+<p style="margin:0;"> >+ >+<a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/?pathrev=986796"><img src="/docroot/images/back_small.png" class="vc_icon" alt="Parent Directory" /> Parent Directory</a> >+ >+| <a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd?view=log&pathrev=986796"><img src="/docroot/images/log.png" class="vc_icon" alt="Revision Log" /> Revision Log</a> >+ >+ >+ >+ >+</p> >+ >+<hr /> >+<div class="vc_summary"> >+Revision <a href="/?view=revision&revision=986796"><strong>986796</strong></a> - >+(<a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd?annotate=986796&pathrev=986796"><strong>show annotations</strong></a>) >+(<a href="/*checkout*/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd?revision=986796&pathrev=986796"><strong>download</strong></a>) >+ >+ >+<br /><em>Thu Jun 25 03:25:44 2009 UTC</em> >+(3 months, 2 weeks ago) >+by <em>mattr</em> >+ >+ >+ >+ >+ >+ >+ >+<br />File size: 107 byte(s) >+ >+ >+ >+ >+ >+ >+<pre class="vc_log">Implement YMSG protocol version 16 authentication >+ >+Fixes bug 197104 >+ >+CCBUG: 197104 >+ >+This is the backport for KDE 4.2 >+ >+Squashed commit of the following: >+ >+commit 2589b7859c3332d3e4c1e3623b9a5182ea060436 >+Author: Matt Rogers <mattr@kde.org> >+Date: Wed Jun 24 21:19:42 2009 -0500 >+ >+ Update existing yahoo.com servers to the new one >+ >+ This kconf_update script changes all the server lines for Yahoo accounts >+ to scsa.msg.yahoo.com if the domain name ended with ".yahoo.com" so that >+ users don't have to go in and change their config manually in order to >+ be able to login. >+ >+commit ca1ea33d0047877afd200d2d3c656a7235ef8009 >+Author: Matt Rogers <mattr@kde.org> >+Date: Wed Jun 24 20:45:18 2009 -0500 >+ >+ Set the Yahoo default server to scsa.msg.yahoo.com >+ >+ This is inline with what several of the other clients do now that we all >+ seem to be using protocol 16 authentication methods. >+ >+commit 9ad7a11e53815f0333909a765c81ea7131c20693 >+Author: Matt Rogers <mattr@kde.org> >+Date: Wed Jun 24 20:40:36 2009 -0500 >+ >+ Implement YMSG protocol version 16 authentication. >+ >+ Kopete's Yahoo protocol can now login again, fixing bug 197104 >+ >+ This is the fix for trunk (4.4) which will be backported to 4.3 and 4.2 >+ Thanks to the Pidgin folks for implementing it first and letting me use >+ their code. :)</pre> >+ >+</div> >+ >+ >+ >+ >+ >+ >+<div id="vc_file"> >+<table cellspacing="0" cellpadding="0"> >+ >+ >+ >+ >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l1"> >+<td class="vc_file_line_number">1</td> >+ >+<td class="vc_file_line_text">Id=kopete-update-yahoo-server/r1 >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l2"> >+<td class="vc_file_line_number">2</td> >+ >+<td class="vc_file_line_text">File=kopeterc >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l3"> >+<td class="vc_file_line_number">3</td> >+ >+<td class="vc_file_line_text">Options=overwrite >+</td> >+</tr> >+ >+ >+ >+ >+<tr class="vc_row_odd" id="l4"> >+<td class="vc_file_line_number">4</td> >+ >+<td class="vc_file_line_text">Script=kopete-update_yahoo_server.pl,perl >+</td> >+</tr> >+ >+ >+</table> >+</div> >+ >+ >+ >+ >+ >+<hr /> >+<table> >+<tr> >+<td><address><a href="mailto:<a href="mailto:sysadmin@kde.org">KDE Sysadmin</a>"><a href="mailto:sysadmin@kde.org">KDE Sysadmin</a></a></address></td> >+<td style="text-align: right;"><strong><a href="/docroot/help_rootview.html">ViewVC Help</a></strong></td> >+</tr> >+<tr> >+<td>Powered by <a href="http://viewvc.tigris.org/">ViewVC 1.1.2</a></td> >+<td style="text-align: right;"> </td> >+</tr> >+</table> >+</body> >+</html> >+ >diff -Naur kopete/protocols/yahoo/libkyahoo/logintask.cpp kopete/protocols/yahoo/libkyahoo/logintask.cpp >--- kopete/protocols/yahoo/libkyahoo/logintask.cpp 2008-01-05 00:58:45.000000000 +0100 >+++ kopete/protocols/yahoo/libkyahoo/logintask.cpp 2009-10-08 21:29:20.000000000 +0200 >@@ -3,10 +3,10 @@ > Handles logging into to the Yahoo service > > Copyright (c) 2004 Duncan Mac-Vicar P. <duncan@kde.org> >- > Copyright (c) 2005-2006 André Duffeck <duffeck@kde.org> >+ Copyright 2009 Matt Rogers <mattr@kde.org> > >- Kopete (c) 2002-2006 by the Kopete developers <kopete-devel@kde.org> >+ Kopete (c) 2002-2009 by the Kopete developers <kopete-devel@kde.org> > > ************************************************************************* > * * >@@ -28,6 +28,10 @@ > #include <qstring.h> > #include <kdebug.h> > #include <stdlib.h> >+ >+#include <QCryptographicHash> >+#include <KDE/KJob> >+#include <KDE/KIO/Job> > extern "C" > { > #include "libyahoo.h" >@@ -168,56 +172,201 @@ > > QString sn = t->firstParam( 1 ); > QString seed = t->firstParam( 94 ); >+ m_challengeString = seed; > QString version_s = t->firstParam( 13 ); >- uint sessionID = t->id(); >+ m_sessionID = t->id(); > int version = version_s.toInt(); > > switch (version) > { > case 0: >- kDebug(YAHOO_RAW_DEBUG) << " Version pre 0x0b "<< version_s; >- break; >+ case 1: >+ >+ case 2: >+ kDebug(YAHOO_RAW_DEBUG) << "Using version 16 authorization" << endl; >+ sendAuthSixteenStage1(sn, seed); >+ break; > default: >- kDebug(YAHOO_RAW_DEBUG) << " Version 0x0b "<< version_s; >- sendAuthResp_0x0b(sn, seed, sessionID); >- break; >+ kWarning(YAHOO_RAW_DEBUG) << "Unknown authentication method used!" >+ << "Attempting current authentication anyways"; >+ sendAuthSixteenStage1(sn, seed); >+ break; > } > mState = SentAuthResp; > >- emit haveSessionID( sessionID ); >+ emit haveSessionID( m_sessionID ); > } > >-void LoginTask::sendAuthResp_0x0b(const QString &sn, const QString &seed, uint sessionID) >+void LoginTask::sendAuthSixteenStage1(const QString& sn, const QString& seed) > { >- kDebug(YAHOO_RAW_DEBUG) << " with seed " << seed; >- char *resp_6 = (char *) malloc(100); >- char *resp_96 = (char *) malloc(100); >- authresp_0x0b(seed.toLatin1(), sn.toLatin1(), (client()->password()).toLatin1(), resp_6, resp_96); >- kDebug(YAHOO_RAW_DEBUG) << "resp_6: " << resp_6 << " resp_69: " << resp_96; >- YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceAuthResp, m_stateOnConnect); >- t->setId( sessionID ); >- t->setParam( 0 , sn.toLocal8Bit()); >- t->setParam( 2 , sn.toLocal8Bit()); >- t->setParam( 6 , resp_6); >- t->setParam( 96 , resp_96); >-// t->setParam( 59 , "B\\tfckeert1kk1nl&b=2" ); // ??? >- t->setParam( 135 , YMSG_PROGRAM_VERSION_STRING ); // Client version >- t->setParam( 148 , -60 ); >- t->setParam( 192 , client()->pictureChecksum() ); >-// t->setParam( 244 , 524223 ); >- t->setParam( 1 , sn.toLocal8Bit()); >+ const QString YahooTokenUrl = "https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=&login=%1&passwd=%2&chal=%3"; >+ kDebug(YAHOO_RAW_DEBUG) << "seed:" << seed; >+ m_stage1Data.clear(); >+ /* construct a URL from the seed and request tokens */ >+ QByteArray encodedUrl; >+ QString fullUrl = YahooTokenUrl.arg(sn, client()->password(), seed); >+ KUrl tokenUrl(fullUrl); >+ KIO::Job* job = KIO::get(tokenUrl, KIO::Reload, KIO::HideProgressInfo); >+ connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)), >+ this, SLOT(handleAuthSixteenStage1Data(KIO::Job*, const QByteArray&))); >+ connect(job, SIGNAL(result(KJob*)), >+ this, SLOT(handleAuthSixteenStage1Result(KJob*))); >+} > >- if( !m_verificationWord.isEmpty() ) >+void LoginTask::handleAuthSixteenStage1Data(KIO::Job* job, const QByteArray& data) >+{ >+ kDebug(YAHOO_RAW_DEBUG) << "data:" << data; >+ m_stage1Data.append(data); >+} >+ >+void LoginTask::handleAuthSixteenStage1Result(KJob* job) >+{ >+ int responseNumber = -1; >+ QString token; >+ int error = job->error(); >+ kDebug(YAHOO_RAW_DEBUG) << "error:" << error; >+ if (error == 0) > { >- t->setParam( 227 , m_verificationWord.toLocal8Bit() ); >- m_verificationWord.clear(); >- } >- >- free(resp_6); >- free(resp_96); >- send(t); >+ QStringList responses = m_stage1Data.split("\r\n"); >+ if (responses.count() >= 3) >+ { >+ responseNumber = responses[0].toInt(); >+ token = responses[1]; >+ token.remove("ymsgr="); >+ kDebug(YAHOO_RAW_DEBUG) << "response is:" << responseNumber; >+ kDebug(YAHOO_RAW_DEBUG) << "token is:" << token; >+ } >+ >+ if (responseNumber != 0) >+ { >+ switch(responseNumber) >+ { >+ case -1: >+ /* error in the received stream */ >+ emit loginResponse(Yahoo::LoginSock, QString()); >+ kDebug(YAHOO_RAW_DEBUG) << "unknown error logging in"; >+ break; >+ case 1212: >+ /* password incorrect */ >+ emit loginResponse(Yahoo::LoginPasswd, QString()); >+ kDebug(YAHOO_RAW_DEBUG) << "password incorrect"; >+ break; >+ case 1213: >+ /* security lock */ >+ emit loginResponse(Yahoo::LoginLock, QString()); >+ break; >+ case 1235: >+ /* username does not exist */ >+ emit loginResponse(Yahoo::LoginUname, QString()); >+ kDebug(YAHOO_RAW_DEBUG) << "user does not exist"; >+ break; >+ case 1214: >+ case 1236: >+ emit loginResponse(Yahoo::LoginVerify, QString()); >+ break; >+ case 100: /* username or password missing */ >+ /*FIXME handle this */ >+ break; >+ default: >+ /* FIXME unknown error. handle it! */ >+ break; >+ } >+ } >+ else >+ { >+ /* start stage 2 here */ >+ sendAuthSixteenStage2(token); >+ } >+ } >+} >+void LoginTask::sendAuthSixteenStage2(const QString& token) >+{ >+ const QString YahooLoginUrl = "https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=&token=%1"; >+ kDebug(YAHOO_RAW_DEBUG) << "token:" << token; >+ m_stage2Data.clear(); >+ QString fullUrl = YahooLoginUrl.arg(token); >+ KUrl loginUrl(fullUrl); >+ KIO::Job* job = KIO::get(loginUrl, KIO::Reload, KIO::HideProgressInfo); >+ connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)), >+ this, SLOT(handleAuthSixteenStage2Data(KIO::Job*, const QByteArray&))); >+ connect(job, SIGNAL(result(KJob*)), >+ this, SLOT(handleAuthSixteenStage2Result(KJob*))); >+} >+ >+void LoginTask::handleAuthSixteenStage2Data(KIO::Job*, const QByteArray& data) >+{ >+ kDebug(YAHOO_RAW_DEBUG) << "data:" << data; >+ m_stage2Data.append(data); >+} >+ >+void LoginTask::handleAuthSixteenStage2Result(KJob* job) >+{ >+ QString crumb; >+ int responseNumber = -1; >+ int error = job->error(); >+ kDebug(YAHOO_RAW_DEBUG) << "error:" << error; >+ if (error == 0) >+ { >+ QStringList responses = m_stage2Data.split("\r\n"); >+ kDebug(YAHOO_RAW_DEBUG) << responses; >+ responseNumber = responses[0].toInt(); >+ if (responseNumber == 0) >+ { >+ crumb = responses[1]; >+ crumb.remove("crumb="); >+ m_yCookie = responses[2].remove(0,2); /* remove Y= */ >+ m_tCookie = responses[3].remove(0,2); /* remove T= */ >+ } >+ >+ if (responseNumber != 0) >+ { >+ switch(responseNumber) >+ { >+ case -1: >+ emit loginResponse(Yahoo::LoginSock, QString()); >+ break; >+ case 100: >+ emit loginResponse(Yahoo::LoginSock, QString()); >+ break; >+ default: /* try to login anyways */ >+ break; >+ } >+ } >+ else >+ { >+ QString cryptString = crumb; >+ cryptString.append(m_challengeString); >+ sendAuthSixteenStage3(cryptString); >+ } >+ } >+} >+ >+void LoginTask::sendAuthSixteenStage3(const QString& cryptString) >+{ >+ kDebug(YAHOO_RAW_DEBUG) << " with crypt string" << cryptString; >+ QByteArray cryptStringHash = QCryptographicHash::hash( cryptString.toAscii(), >+ QCryptographicHash::Md5 ); >+ cryptStringHash = cryptStringHash.toBase64(); >+ cryptStringHash = cryptStringHash.replace('+', '.'); >+ cryptStringHash = cryptStringHash.replace('/', '_'); >+ cryptStringHash = cryptStringHash.replace('=', '-'); >+ >+ YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceAuthResp, m_stateOnConnect); >+ t->setId( m_sessionID ); >+ t->setParam( 1, client()->userId().toLocal8Bit()); >+ t->setParam( 0 , client()->userId().toLocal8Bit()); >+ t->setParam( 277, m_yCookie.toLocal8Bit() ); >+ t->setParam( 278, m_tCookie.toLocal8Bit() ); >+ t->setParam( 307, cryptStringHash ); >+ t->setParam( 244, 2097087 ); >+ t->setParam( 2 , client()->userId().toLocal8Bit()); >+ t->setParam( 2, 1 ); // Both parameter 2s wind up in the packet >+ t->setParam( 135, YMSG_PROGRAM_VERSION_STRING ); >+ >+ send(t); >+ >+} > >-} > > void LoginTask::sendAuthResp_pre_0x0b(const QString &/*sn*/, const QString &/*seed*/) > { >diff -Naur kopete/protocols/yahoo/libkyahoo/logintask.h kopete/protocols/yahoo/libkyahoo/logintask.h >--- kopete/protocols/yahoo/libkyahoo/logintask.h 2008-01-05 00:58:45.000000000 +0100 >+++ kopete/protocols/yahoo/libkyahoo/logintask.h 2009-10-08 21:29:20.000000000 +0200 >@@ -26,6 +26,12 @@ > > class QString; > class YMSGTransfer; >+class KJob; >+ >+namespace KIO >+{ >+ class Job; >+} > > /** > @author Duncan Mac-Vicar >@@ -58,6 +64,14 @@ > void sendAuthResp_pre_0x0b(const QString &sn, const QString &seed); > void handleAuthResp(YMSGTransfer *transfer); > void parseCookies( YMSGTransfer *transfer ); >+ void sendAuthSixteenStage1(const QString& sn, const QString& seed); >+ void sendAuthSixteenStage2(const QString& token); >+ void sendAuthSixteenStage3(const QString& cryptString); >+ protected Q_SLOTS: >+ void handleAuthSixteenStage1Data(KIO::Job*, const QByteArray& data); >+ void handleAuthSixteenStage1Result(KJob*); >+ void handleAuthSixteenStage2Data(KIO::Job*, const QByteArray& data); >+ void handleAuthSixteenStage2Result(KJob*); > signals: > void haveSessionID( uint ); > void haveCookies(); >@@ -70,6 +84,10 @@ > QString m_cCookie; > QString m_loginCookie; > QString m_verificationWord; >+ QString m_stage1Data; >+ QString m_stage2Data; >+ QString m_challengeString; >+ uint m_sessionID; > }; > > #endif >diff -Naur kopete/protocols/yahoo/yahooaccount.cpp kopete/protocols/yahoo/yahooaccount.cpp >--- kopete/protocols/yahoo/yahooaccount.cpp 2008-10-30 14:23:46.000000000 +0100 >+++ kopete/protocols/yahoo/yahooaccount.cpp 2009-10-08 21:29:32.000000000 +0200 >@@ -521,7 +521,7 @@ > return; > } > >- QString server = configGroup()->readEntry( "Server", "scs.msg.yahoo.com" ); >+ QString server = configGroup()->readEntry( "Server", "scsa.msg.yahoo.com" ); > int port = configGroup()->readEntry( "Port", 5050 ); > > initConnectionSignals( MakeConnections ); >diff -Naur kopete/protocols/yahoo/yahooeditaccount.cpp kopete/protocols/yahoo/yahooeditaccount.cpp >--- kopete/protocols/yahoo/yahooeditaccount.cpp 2008-10-30 14:23:46.000000000 +0100 >+++ kopete/protocols/yahoo/yahooeditaccount.cpp 2009-10-08 21:29:32.000000000 +0200 >@@ -63,9 +63,9 @@ > mAutoConnect->setChecked(acct->excludeConnect()); > mPasswordWidget->load( &acct->password() ); > >- QString pagerServer = account()->configGroup()->readEntry("Server", "scs.msg.yahoo.com"); >+ QString pagerServer = account()->configGroup()->readEntry("Server", "scsa.msg.yahoo.com"); > int pagerPort = account()->configGroup()->readEntry("Port", 5050); >- if( pagerServer != "scs.msg.yahoo.com" || pagerPort != 5050 ) >+ if( pagerServer != "scsa.msg.yahoo.com" || pagerPort != 5050 ) > optionOverrideServer->setChecked( true ); > else > optionOverrideServer->setChecked( false ); >@@ -133,7 +133,7 @@ > } > else > { >- yahooAccount->setServer( "scs.msg.yahoo.com" ); >+ yahooAccount->setServer( "scsa.msg.yahoo.com" ); > yahooAccount->setPort( 5050 ); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 516347
: 321788