View | Details | Raw Unified | Return to bug 516347
Collapse All | Expand All

(-)kopete/kopete/kconf_update/CMakeLists.txt (-3 / +2 lines)
Lines 3-12 Link Here
3
	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})
3
	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})
4
endif(NOT WIN32)
4
endif(NOT WIN32)
5
5
6
install( FILES kopete-pluginloader.upd  kopete-nameTracking.upd kopete-update_yahoo_server.upd  DESTINATION ${KCONF_UPDATE_INSTALL_DIR})
6
7
7
install( FILES kopete-pluginloader.upd  kopete-nameTracking.upd  DESTINATION ${KCONF_UPDATE_INSTALL_DIR})
8
install( PROGRAMS kopete-pluginloader.pl kopete-update_yahoo_server.pl
8
9
install( PROGRAMS kopete-pluginloader.pl
10
	kopete-account-0.10.pl DESTINATION ${KCONF_UPDATE_INSTALL_DIR})
9
	kopete-account-0.10.pl DESTINATION ${KCONF_UPDATE_INSTALL_DIR})
11
10
12
11
(-)kopete/kopete/kconf_update/kopete-update_yahoo_server.pl (+370 lines)
Line 0 Link Here
1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
13
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
14
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
15
<!-- ViewVC :: http://www.viewvc.org/ -->
16
<head>
17
<title>[KDE] Contents of /branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl</title>
18
<meta name="generator" content="ViewVC 1.1.2" />
19
<link rel="shortcut icon" href="/docroot/images/favicon.ico" type="image/x-icon" />
20
<link rel="stylesheet" href="/docroot/styles.css" type="text/css" />
21
22
</head>
23
<body>
24
<div class="vc_navheader">
25
<table><tr>
26
<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&amp;pathrev=986796">kopete-update_yahoo_server.pl</a></strong></td>
27
<td style="text-align: right;"></td>
28
</tr></table>
29
</div>
30
<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>
31
<h1>Contents of /branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl</h1>
32
33
<p style="margin:0;">
34
35
<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>
36
37
| <a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl?view=log&amp;pathrev=986796"><img src="/docroot/images/log.png" class="vc_icon" alt="Revision Log" /> Revision Log</a>
38
39
40
41
42
</p>
43
44
<hr />
45
<div class="vc_summary">
46
Revision <a href="/?view=revision&amp;revision=986796"><strong>986796</strong></a> -
47
(<a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl?annotate=986796&amp;pathrev=986796"><strong>show annotations</strong></a>)
48
(<a href="/*checkout*/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.pl?revision=986796&amp;pathrev=986796"><strong>download</strong></a>)
49
50
51
<br /><em>Thu Jun 25 03:25:44 2009 UTC</em>
52
(3 months, 2 weeks ago)
53
by <em>mattr</em>
54
55
56
57
58
59
60
<br />File MIME type: text/plain
61
62
63
<br />File size: 427 byte(s)
64
65
66
67
68
69
70
<pre class="vc_log">Implement YMSG protocol version 16 authentication
71
72
Fixes bug 197104
73
74
CCBUG: 197104
75
76
This is the backport for KDE 4.2
77
78
Squashed commit of the following:
79
80
commit 2589b7859c3332d3e4c1e3623b9a5182ea060436
81
Author: Matt Rogers &lt;mattr@kde.org&gt;
82
Date:   Wed Jun 24 21:19:42 2009 -0500
83
84
    Update existing yahoo.com servers to the new one
85
86
    This kconf_update script changes all the server lines for Yahoo accounts
87
    to scsa.msg.yahoo.com if the domain name ended with ".yahoo.com" so that
88
    users don't have to go in and change their config manually in order to
89
    be able to login.
90
91
commit ca1ea33d0047877afd200d2d3c656a7235ef8009
92
Author: Matt Rogers &lt;mattr@kde.org&gt;
93
Date:   Wed Jun 24 20:45:18 2009 -0500
94
95
    Set the Yahoo default server to scsa.msg.yahoo.com
96
97
    This is inline with what several of the other clients do now that we all
98
    seem to be using protocol 16 authentication methods.
99
100
commit 9ad7a11e53815f0333909a765c81ea7131c20693
101
Author: Matt Rogers &lt;mattr@kde.org&gt;
102
Date:   Wed Jun 24 20:40:36 2009 -0500
103
104
    Implement YMSG protocol version 16 authentication.
105
106
    Kopete's Yahoo protocol can now login again, fixing bug 197104
107
108
    This is the fix for trunk (4.4) which will be backported to 4.3 and 4.2
109
    Thanks to the Pidgin folks for implementing it first and letting me use
110
    their code. :)</pre>
111
112
</div>
113
114
115
116
117
118
119
<div id="vc_file">
120
<table cellspacing="0" cellpadding="0">
121
122
123
124
125
126
127
128
129
<tr class="vc_row_odd" id="l1">
130
<td class="vc_file_line_number">1</td>
131
132
<td class="vc_file_line_text">#!/usr/bin/perl
133
</td>
134
</tr>
135
136
137
138
139
<tr class="vc_row_odd" id="l2">
140
<td class="vc_file_line_number">2</td>
141
142
<td class="vc_file_line_text">
143
</td>
144
</tr>
145
146
147
148
149
<tr class="vc_row_odd" id="l3">
150
<td class="vc_file_line_number">3</td>
151
152
<td class="vc_file_line_text"># Rename the old Gaim style to Pidgin
153
</td>
154
</tr>
155
156
157
158
159
<tr class="vc_row_odd" id="l4">
160
<td class="vc_file_line_number">4</td>
161
162
<td class="vc_file_line_text">
163
</td>
164
</tr>
165
166
167
168
169
<tr class="vc_row_odd" id="l5">
170
<td class="vc_file_line_number">5</td>
171
172
<td class="vc_file_line_text">my $inYahoo = 0;
173
</td>
174
</tr>
175
176
177
178
179
<tr class="vc_row_odd" id="l6">
180
<td class="vc_file_line_number">6</td>
181
182
<td class="vc_file_line_text">foreach (&lt;&gt;) {
183
</td>
184
</tr>
185
186
187
188
189
<tr class="vc_row_odd" id="l7">
190
<td class="vc_file_line_number">7</td>
191
192
<td class="vc_file_line_text">    $inYahoo = 1 if (/^\[Account_YahooProtocol_.*$/);
193
</td>
194
</tr>
195
196
197
198
199
<tr class="vc_row_odd" id="l8">
200
<td class="vc_file_line_number">8</td>
201
202
<td class="vc_file_line_text">    if ($inYahoo) {
203
</td>
204
</tr>
205
206
207
208
209
<tr class="vc_row_odd" id="l9">
210
<td class="vc_file_line_number">9</td>
211
212
<td class="vc_file_line_text">        if (/^Server\=(.*)/) {
213
</td>
214
</tr>
215
216
217
218
219
<tr class="vc_row_odd" id="l10">
220
<td class="vc_file_line_number">10</td>
221
222
<td class="vc_file_line_text">            my $oldServer = $1;
223
</td>
224
</tr>
225
226
227
228
229
<tr class="vc_row_odd" id="l11">
230
<td class="vc_file_line_number">11</td>
231
232
<td class="vc_file_line_text">            if ($oldServer =~ m/\.yahoo\.com$/) {
233
</td>
234
</tr>
235
236
237
238
239
<tr class="vc_row_odd" id="l12">
240
<td class="vc_file_line_number">12</td>
241
242
<td class="vc_file_line_text">                print "Server=scsa.msg.yahoo.com\n";
243
</td>
244
</tr>
245
246
247
248
249
<tr class="vc_row_odd" id="l13">
250
<td class="vc_file_line_number">13</td>
251
252
<td class="vc_file_line_text">                $inYahoo = 0;
253
</td>
254
</tr>
255
256
257
258
259
<tr class="vc_row_odd" id="l14">
260
<td class="vc_file_line_number">14</td>
261
262
<td class="vc_file_line_text">                next;
263
</td>
264
</tr>
265
266
267
268
269
<tr class="vc_row_odd" id="l15">
270
<td class="vc_file_line_number">15</td>
271
272
<td class="vc_file_line_text">            }
273
</td>
274
</tr>
275
276
277
278
279
<tr class="vc_row_odd" id="l16">
280
<td class="vc_file_line_number">16</td>
281
282
<td class="vc_file_line_text">        }
283
</td>
284
</tr>
285
286
287
288
289
<tr class="vc_row_odd" id="l17">
290
<td class="vc_file_line_number">17</td>
291
292
<td class="vc_file_line_text">    }
293
</td>
294
</tr>
295
296
297
298
299
<tr class="vc_row_odd" id="l18">
300
<td class="vc_file_line_number">18</td>
301
302
<td class="vc_file_line_text">
303
</td>
304
</tr>
305
306
307
308
309
<tr class="vc_row_odd" id="l19">
310
<td class="vc_file_line_number">19</td>
311
312
<td class="vc_file_line_text">    print $_;
313
</td>
314
</tr>
315
316
317
318
319
<tr class="vc_row_odd" id="l20">
320
<td class="vc_file_line_number">20</td>
321
322
<td class="vc_file_line_text">}
323
</td>
324
</tr>
325
326
327
</table>
328
</div>
329
330
331
332
<hr/>
333
<div class="vc_properties">
334
<h2>Properties</h2>
335
<table cellspacing="1" cellpadding="2" class="auto">
336
<thead>
337
<tr>
338
<th class="vc_header_sort">Name</th>
339
<th class="vc_header">Value</th>
340
</tr>
341
</thead>
342
<tbody>
343
344
<tr class="vc_row_even">
345
<td><strong>svn:executable</strong></td>
346
347
<td style="white-space: pre;">*</td>
348
349
</tr>
350
351
</tbody>
352
</table>
353
</div>
354
355
356
357
<hr />
358
<table>
359
<tr>
360
<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>
361
<td style="text-align: right;"><strong><a href="/docroot/help_rootview.html">ViewVC Help</a></strong></td>
362
</tr>
363
<tr>
364
<td>Powered by <a href="http://viewvc.tigris.org/">ViewVC 1.1.2</a></td>
365
<td style="text-align: right;">&nbsp;</td>
366
</tr>
367
</table>
368
</body>
369
</html>
370
(-)kopete/kopete/kconf_update/kopete-update_yahoo_server.upd (+185 lines)
Line 0 Link Here
1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
13
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
14
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
15
<!-- ViewVC :: http://www.viewvc.org/ -->
16
<head>
17
<title>[KDE] Contents of /branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd</title>
18
<meta name="generator" content="ViewVC 1.1.2" />
19
<link rel="shortcut icon" href="/docroot/images/favicon.ico" type="image/x-icon" />
20
<link rel="stylesheet" href="/docroot/styles.css" type="text/css" />
21
22
</head>
23
<body>
24
<div class="vc_navheader">
25
<table><tr>
26
<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&amp;pathrev=986796">kopete-update_yahoo_server.upd</a></strong></td>
27
<td style="text-align: right;"></td>
28
</tr></table>
29
</div>
30
<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>
31
<h1>Contents of /branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd</h1>
32
33
<p style="margin:0;">
34
35
<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>
36
37
| <a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd?view=log&amp;pathrev=986796"><img src="/docroot/images/log.png" class="vc_icon" alt="Revision Log" /> Revision Log</a>
38
39
40
41
42
</p>
43
44
<hr />
45
<div class="vc_summary">
46
Revision <a href="/?view=revision&amp;revision=986796"><strong>986796</strong></a> -
47
(<a href="/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd?annotate=986796&amp;pathrev=986796"><strong>show annotations</strong></a>)
48
(<a href="/*checkout*/branches/KDE/4.2/kdenetwork/kopete/kopete/kconf_update/kopete-update_yahoo_server.upd?revision=986796&amp;pathrev=986796"><strong>download</strong></a>)
49
50
51
<br /><em>Thu Jun 25 03:25:44 2009 UTC</em>
52
(3 months, 2 weeks ago)
53
by <em>mattr</em>
54
55
56
57
58
59
60
61
<br />File size: 107 byte(s)
62
63
64
65
66
67
68
<pre class="vc_log">Implement YMSG protocol version 16 authentication
69
70
Fixes bug 197104
71
72
CCBUG: 197104
73
74
This is the backport for KDE 4.2
75
76
Squashed commit of the following:
77
78
commit 2589b7859c3332d3e4c1e3623b9a5182ea060436
79
Author: Matt Rogers &lt;mattr@kde.org&gt;
80
Date:   Wed Jun 24 21:19:42 2009 -0500
81
82
    Update existing yahoo.com servers to the new one
83
84
    This kconf_update script changes all the server lines for Yahoo accounts
85
    to scsa.msg.yahoo.com if the domain name ended with ".yahoo.com" so that
86
    users don't have to go in and change their config manually in order to
87
    be able to login.
88
89
commit ca1ea33d0047877afd200d2d3c656a7235ef8009
90
Author: Matt Rogers &lt;mattr@kde.org&gt;
91
Date:   Wed Jun 24 20:45:18 2009 -0500
92
93
    Set the Yahoo default server to scsa.msg.yahoo.com
94
95
    This is inline with what several of the other clients do now that we all
96
    seem to be using protocol 16 authentication methods.
97
98
commit 9ad7a11e53815f0333909a765c81ea7131c20693
99
Author: Matt Rogers &lt;mattr@kde.org&gt;
100
Date:   Wed Jun 24 20:40:36 2009 -0500
101
102
    Implement YMSG protocol version 16 authentication.
103
104
    Kopete's Yahoo protocol can now login again, fixing bug 197104
105
106
    This is the fix for trunk (4.4) which will be backported to 4.3 and 4.2
107
    Thanks to the Pidgin folks for implementing it first and letting me use
108
    their code. :)</pre>
109
110
</div>
111
112
113
114
115
116
117
<div id="vc_file">
118
<table cellspacing="0" cellpadding="0">
119
120
121
122
123
124
125
126
127
<tr class="vc_row_odd" id="l1">
128
<td class="vc_file_line_number">1</td>
129
130
<td class="vc_file_line_text">Id=kopete-update-yahoo-server/r1
131
</td>
132
</tr>
133
134
135
136
137
<tr class="vc_row_odd" id="l2">
138
<td class="vc_file_line_number">2</td>
139
140
<td class="vc_file_line_text">File=kopeterc
141
</td>
142
</tr>
143
144
145
146
147
<tr class="vc_row_odd" id="l3">
148
<td class="vc_file_line_number">3</td>
149
150
<td class="vc_file_line_text">Options=overwrite
151
</td>
152
</tr>
153
154
155
156
157
<tr class="vc_row_odd" id="l4">
158
<td class="vc_file_line_number">4</td>
159
160
<td class="vc_file_line_text">Script=kopete-update_yahoo_server.pl,perl
161
</td>
162
</tr>
163
164
165
</table>
166
</div>
167
168
169
170
171
172
<hr />
173
<table>
174
<tr>
175
<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>
176
<td style="text-align: right;"><strong><a href="/docroot/help_rootview.html">ViewVC Help</a></strong></td>
177
</tr>
178
<tr>
179
<td>Powered by <a href="http://viewvc.tigris.org/">ViewVC 1.1.2</a></td>
180
<td style="text-align: right;">&nbsp;</td>
181
</tr>
182
</table>
183
</body>
184
</html>
185
(-)kopete/protocols/yahoo/libkyahoo/logintask.cpp (-36 / +185 lines)
Lines 3-12 Link Here
3
    Handles logging into to the Yahoo service
3
    Handles logging into to the Yahoo service
4
4
5
    Copyright (c) 2004 Duncan Mac-Vicar P. <duncan@kde.org>
5
    Copyright (c) 2004 Duncan Mac-Vicar P. <duncan@kde.org>
6
7
    Copyright (c) 2005-2006 André Duffeck <duffeck@kde.org>
6
    Copyright (c) 2005-2006 André Duffeck <duffeck@kde.org>
7
    Copyright     2009 Matt Rogers <mattr@kde.org>
8
8
9
    Kopete (c) 2002-2006 by the Kopete developers <kopete-devel@kde.org>
9
    Kopete (c) 2002-2009 by the Kopete developers <kopete-devel@kde.org>
10
10
11
    *************************************************************************
11
    *************************************************************************
12
    *                                                                       *
12
    *                                                                       *
Lines 28-33 Link Here
28
#include <qstring.h>
28
#include <qstring.h>
29
#include <kdebug.h>
29
#include <kdebug.h>
30
#include <stdlib.h>
30
#include <stdlib.h>
31
32
#include <QCryptographicHash>
33
#include <KDE/KJob>
34
#include <KDE/KIO/Job>
31
extern "C"
35
extern "C"
32
{
36
{
33
#include "libyahoo.h"
37
#include "libyahoo.h"
Lines 168-223 Link Here
168
	
172
	
169
	QString sn = t->firstParam( 1 );
173
	QString sn = t->firstParam( 1 );
170
	QString seed = t->firstParam( 94 );
174
	QString seed = t->firstParam( 94 );
175
	m_challengeString = seed;
171
	QString version_s = t->firstParam( 13 );
176
	QString version_s = t->firstParam( 13 );
172
	uint sessionID = t->id();
177
	m_sessionID = t->id();
173
	int version = version_s.toInt();
178
	int version = version_s.toInt();
174
	
179
	
175
	switch (version)
180
	switch (version)
176
	{
181
	{
177
		case 0:
182
		case 0:
178
		kDebug(YAHOO_RAW_DEBUG) << " Version pre 0x0b "<< version_s;	
183
		case 1:
179
		break;
184
		
185
		case 2:
186
			kDebug(YAHOO_RAW_DEBUG) << "Using version 16 authorization" << endl;
187
			sendAuthSixteenStage1(sn, seed);
188
			break;
180
		default:
189
		default:
181
		kDebug(YAHOO_RAW_DEBUG) << " Version 0x0b "<< version_s;
190
			 kWarning(YAHOO_RAW_DEBUG) << "Unknown authentication method used!"
182
		sendAuthResp_0x0b(sn, seed, sessionID);
191
			                           << "Attempting current authentication anyways";
183
		break;
192
			 sendAuthSixteenStage1(sn, seed);
193
		break;		
184
	}	
194
	}	
185
	mState = SentAuthResp;
195
	mState = SentAuthResp;
186
196
187
	emit haveSessionID( sessionID );
197
	emit haveSessionID( m_sessionID );
188
}
198
}
189
199
190
void LoginTask::sendAuthResp_0x0b(const QString &sn, const QString &seed, uint sessionID)
200
void LoginTask::sendAuthSixteenStage1(const QString& sn, const QString& seed)
191
{
201
{
192
	kDebug(YAHOO_RAW_DEBUG) << " with seed " << seed;
202
	const QString YahooTokenUrl = "https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=&login=%1&passwd=%2&chal=%3";
193
	char *resp_6 = (char *) malloc(100);
203
	kDebug(YAHOO_RAW_DEBUG) << "seed:" << seed;
194
	char *resp_96 = (char *) malloc(100);
204
	m_stage1Data.clear();
195
	authresp_0x0b(seed.toLatin1(), sn.toLatin1(), (client()->password()).toLatin1(), resp_6, resp_96);
205
	/* construct a URL from the seed and request tokens */
196
	kDebug(YAHOO_RAW_DEBUG) << "resp_6: " << resp_6 << " resp_69: " << resp_96;
206
	QByteArray encodedUrl;
197
	YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceAuthResp, m_stateOnConnect);
207
	QString fullUrl = YahooTokenUrl.arg(sn, client()->password(), seed);
198
	t->setId( sessionID );
208
	KUrl tokenUrl(fullUrl);
199
	t->setParam( 0 , sn.toLocal8Bit());
209
	KIO::Job* job = KIO::get(tokenUrl, KIO::Reload, KIO::HideProgressInfo);
200
	t->setParam( 2 , sn.toLocal8Bit());
210
	connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),
201
	t->setParam( 6 , resp_6);
211
	this, SLOT(handleAuthSixteenStage1Data(KIO::Job*, const QByteArray&)));
202
	t->setParam( 96 , resp_96);
212
	connect(job, SIGNAL(result(KJob*)),
203
// 	t->setParam( 59 , "B\\tfckeert1kk1nl&b=2" );	// ???
213
	this, SLOT(handleAuthSixteenStage1Result(KJob*)));
204
	t->setParam( 135 , YMSG_PROGRAM_VERSION_STRING );	// Client version
214
} 
205
	t->setParam( 148 , -60 );
206
	t->setParam( 192 , client()->pictureChecksum() );
207
// 	t->setParam( 244 , 524223 );
208
	t->setParam( 1 , sn.toLocal8Bit());
209
215
210
	if( !m_verificationWord.isEmpty() )
216
void LoginTask::handleAuthSixteenStage1Data(KIO::Job* job, const QByteArray& data)
217
{
218
	kDebug(YAHOO_RAW_DEBUG) << "data:" << data;
219
	m_stage1Data.append(data);
220
}
221
	
222
void LoginTask::handleAuthSixteenStage1Result(KJob* job)
223
{
224
	int responseNumber = -1;
225
	QString token;
226
	int error = job->error();
227
	kDebug(YAHOO_RAW_DEBUG) << "error:" << error;
228
	if (error == 0)
211
	{
229
	{
212
		t->setParam( 227 , m_verificationWord.toLocal8Bit() );
230
		QStringList responses = m_stage1Data.split("\r\n");
213
		m_verificationWord.clear();
231
		if (responses.count() >= 3)
214
	}
232
		{
215
233
			responseNumber = responses[0].toInt();
216
	free(resp_6);
234
			token = responses[1];
217
	free(resp_96);
235
			token.remove("ymsgr=");
218
	send(t);
236
			kDebug(YAHOO_RAW_DEBUG) << "response is:" << responseNumber;
237
			kDebug(YAHOO_RAW_DEBUG) << "token is:" << token;
238
		}
239
	
240
		if (responseNumber != 0)
241
		{
242
			switch(responseNumber)
243
			{
244
				case -1:
245
					/* error in the received stream */
246
					emit loginResponse(Yahoo::LoginSock, QString());
247
					kDebug(YAHOO_RAW_DEBUG) << "unknown error logging in";
248
					break;
249
				case 1212:
250
					/* password incorrect */
251
					emit loginResponse(Yahoo::LoginPasswd, QString());
252
					kDebug(YAHOO_RAW_DEBUG) << "password incorrect";
253
					break;
254
				case 1213:
255
					/* security lock */
256
					emit loginResponse(Yahoo::LoginLock, QString());
257
					break;
258
				case 1235:
259
					/* username does not exist */
260
					emit loginResponse(Yahoo::LoginUname, QString());
261
					kDebug(YAHOO_RAW_DEBUG) << "user does not exist";
262
					break;
263
				case 1214:
264
				case 1236:
265
					emit loginResponse(Yahoo::LoginVerify, QString());
266
					break;
267
				case 100: /* username or password missing */
268
					/*FIXME handle this */
269
					break;
270
				default:
271
				 	/* FIXME unknown error. handle it! */
272
					break;
273
			}
274
		}
275
	 	else
276
	 	{
277
	 		/* start stage 2 here */
278
		 	sendAuthSixteenStage2(token);
279
	 	}
280
 	}
281
}
282
void LoginTask::sendAuthSixteenStage2(const QString& token)
283
{
284
 	const QString YahooLoginUrl = "https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=&token=%1";
285
 	kDebug(YAHOO_RAW_DEBUG) << "token:" << token;
286
 	m_stage2Data.clear();
287
 	QString fullUrl = YahooLoginUrl.arg(token);
288
 	KUrl loginUrl(fullUrl);
289
 	KIO::Job* job = KIO::get(loginUrl, KIO::Reload, KIO::HideProgressInfo);
290
 	connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),
291
	 	this, SLOT(handleAuthSixteenStage2Data(KIO::Job*, const QByteArray&)));
292
 	connect(job, SIGNAL(result(KJob*)),
293
	 	this, SLOT(handleAuthSixteenStage2Result(KJob*)));
294
}
295
 	
296
void LoginTask::handleAuthSixteenStage2Data(KIO::Job*, const QByteArray& data)
297
{
298
 	kDebug(YAHOO_RAW_DEBUG) << "data:" << data;
299
 	m_stage2Data.append(data);
300
}
301
 	
302
void LoginTask::handleAuthSixteenStage2Result(KJob* job)
303
{
304
 	QString crumb;
305
 	int responseNumber = -1;
306
 	int error = job->error();
307
 	kDebug(YAHOO_RAW_DEBUG) << "error:" << error;
308
 	if (error == 0)
309
 	{
310
	 	QStringList responses = m_stage2Data.split("\r\n");
311
	 	kDebug(YAHOO_RAW_DEBUG) << responses;
312
	 	responseNumber = responses[0].toInt();
313
	 	if (responseNumber == 0)
314
	 	{
315
		 	crumb = responses[1];
316
		 	crumb.remove("crumb=");
317
		 	m_yCookie = responses[2].remove(0,2); /* remove Y= */
318
		 	m_tCookie = responses[3].remove(0,2); /* remove T= */
319
	 	}
320
 	
321
	 	if (responseNumber != 0)
322
	 	{
323
		 	switch(responseNumber)
324
		 	{
325
		 	case -1:
326
			 	emit loginResponse(Yahoo::LoginSock, QString());
327
			 	break;
328
		 	case 100:
329
			 	emit loginResponse(Yahoo::LoginSock, QString());
330
			 	break;
331
		 	default: /* try to login anyways */
332
			 	break;
333
		 	}
334
	 	}
335
	 	else
336
	 	{
337
		 	QString cryptString = crumb;
338
		 	cryptString.append(m_challengeString);
339
		 	sendAuthSixteenStage3(cryptString);
340
	 	}
341
 	}
342
}
343
 	
344
void LoginTask::sendAuthSixteenStage3(const QString& cryptString)
345
{
346
 	kDebug(YAHOO_RAW_DEBUG) << " with crypt string" << cryptString;
347
 	QByteArray cryptStringHash = QCryptographicHash::hash( cryptString.toAscii(),
348
 	QCryptographicHash::Md5 );
349
 	cryptStringHash = cryptStringHash.toBase64();
350
 	cryptStringHash = cryptStringHash.replace('+', '.');
351
 	cryptStringHash = cryptStringHash.replace('/', '_');
352
 	cryptStringHash = cryptStringHash.replace('=', '-');
353
 	
354
 	YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceAuthResp, m_stateOnConnect);
355
 	t->setId( m_sessionID );
356
 	t->setParam( 1, client()->userId().toLocal8Bit());
357
 	t->setParam( 0 , client()->userId().toLocal8Bit());
358
 	t->setParam( 277, m_yCookie.toLocal8Bit() );
359
 	t->setParam( 278, m_tCookie.toLocal8Bit() );
360
 	t->setParam( 307, cryptStringHash );
361
 	t->setParam( 244, 2097087 );
362
 	t->setParam( 2 , client()->userId().toLocal8Bit());
363
 	t->setParam( 2, 1 ); // Both parameter 2s wind up in the packet
364
 	t->setParam( 135, YMSG_PROGRAM_VERSION_STRING );
365
 	
366
 	send(t);
367
 	
368
} 
219
369
220
}
221
370
222
void LoginTask::sendAuthResp_pre_0x0b(const QString &/*sn*/, const QString &/*seed*/)
371
void LoginTask::sendAuthResp_pre_0x0b(const QString &/*sn*/, const QString &/*seed*/)
223
{
372
{
(-)kopete/protocols/yahoo/libkyahoo/logintask.h (+18 lines)
Lines 26-31 Link Here
26
26
27
class QString;
27
class QString;
28
class YMSGTransfer;
28
class YMSGTransfer;
29
class KJob;
30
31
namespace KIO
32
{
33
	class Job;
34
}
29
35
30
/**
36
/**
31
@author Duncan Mac-Vicar
37
@author Duncan Mac-Vicar
Lines 58-63 Link Here
58
	void sendAuthResp_pre_0x0b(const QString &sn, const QString &seed);
64
	void sendAuthResp_pre_0x0b(const QString &sn, const QString &seed);
59
	void handleAuthResp(YMSGTransfer *transfer);
65
	void handleAuthResp(YMSGTransfer *transfer);
60
	void parseCookies( YMSGTransfer *transfer );
66
	void parseCookies( YMSGTransfer *transfer );
67
	void sendAuthSixteenStage1(const QString& sn, const QString& seed);
68
	void sendAuthSixteenStage2(const QString& token);
69
	void sendAuthSixteenStage3(const QString& cryptString);
70
	protected Q_SLOTS:
71
	void handleAuthSixteenStage1Data(KIO::Job*, const QByteArray& data);
72
	void handleAuthSixteenStage1Result(KJob*);
73
	void handleAuthSixteenStage2Data(KIO::Job*, const QByteArray& data);
74
	void handleAuthSixteenStage2Result(KJob*); 
61
signals:
75
signals:
62
	void haveSessionID( uint );
76
	void haveSessionID( uint );
63
	void haveCookies();
77
	void haveCookies();
Lines 70-75 Link Here
70
	QString m_cCookie;
84
	QString m_cCookie;
71
	QString m_loginCookie;
85
	QString m_loginCookie;
72
	QString m_verificationWord;
86
	QString m_verificationWord;
87
	QString m_stage1Data;
88
	QString m_stage2Data;
89
	QString m_challengeString;
90
	uint m_sessionID;
73
};
91
};
74
92
75
#endif
93
#endif
(-)kopete/protocols/yahoo/yahooaccount.cpp (-1 / +1 lines)
Lines 521-527 Link Here
521
		return;
521
		return;
522
	}
522
	}
523
523
524
	QString server = configGroup()->readEntry( "Server", "scs.msg.yahoo.com" );
524
	QString server = configGroup()->readEntry( "Server", "scsa.msg.yahoo.com" );
525
	int port = configGroup()->readEntry( "Port", 5050 );
525
	int port = configGroup()->readEntry( "Port", 5050 );
526
526
527
	initConnectionSignals( MakeConnections );
527
	initConnectionSignals( MakeConnections );
(-)kopete/protocols/yahoo/yahooeditaccount.cpp (-3 / +3 lines)
Lines 63-71 Link Here
63
		mAutoConnect->setChecked(acct->excludeConnect());
63
		mAutoConnect->setChecked(acct->excludeConnect());
64
		mPasswordWidget->load( &acct->password() );
64
		mPasswordWidget->load( &acct->password() );
65
65
66
		QString pagerServer = account()->configGroup()->readEntry("Server", "scs.msg.yahoo.com");
66
		QString pagerServer = account()->configGroup()->readEntry("Server", "scsa.msg.yahoo.com");
67
		int pagerPort = account()->configGroup()->readEntry("Port", 5050);
67
		int pagerPort = account()->configGroup()->readEntry("Port", 5050);
68
		if( pagerServer != "scs.msg.yahoo.com" || pagerPort != 5050 )
68
		if( pagerServer != "scsa.msg.yahoo.com" || pagerPort != 5050 )
69
			optionOverrideServer->setChecked( true );
69
			optionOverrideServer->setChecked( true );
70
		else
70
		else
71
			optionOverrideServer->setChecked( false );
71
			optionOverrideServer->setChecked( false );
Lines 133-139 Link Here
133
	}
133
	}
134
	else
134
	else
135
	{
135
	{
136
		yahooAccount->setServer( "scs.msg.yahoo.com" );
136
		yahooAccount->setServer( "scsa.msg.yahoo.com" );
137
		yahooAccount->setPort( 5050 );
137
		yahooAccount->setPort( 5050 );
138
	}
138
	}
139
139

Return to bug 516347