source: protocols/msn/soap.h @ b9c10a1

Last change on this file since b9c10a1 was cdd1ded, checked in by dequis <dx@…>, at 2015-12-30T05:04:40Z

msn: Don't truncate passwords to 16 chars anymore.

This was needed back in 2010, but now it's not.

  • Property mode set to 100644
File size: 13.4 KB
Line 
1/********************************************************************\
2  * BitlBee -- An IRC to other IM-networks gateway                     *
3  *                                                                    *
4  * Copyright 2002-2012 Wilmer van der Gaast and others                *
5  \********************************************************************/
6
7/* MSN module - All the SOAPy XML stuff.
8   Some manager at Microsoft apparently thought MSNP wasn't XMLy enough so
9   someone stepped up and changed that. This is the result. Kilobytes and
10   more kilobytes of XML vomit to transfer tiny bits of informaiton. */
11
12/*
13  This program is free software; you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 2 of the License, or
16  (at your option) any later version.
17
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  GNU General Public License for more details.
22
23  You should have received a copy of the GNU General Public License with
24  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
25  if not, write to the Free Software Foundation, Inc., 51 Franklin St.,
26  Fifth Floor, Boston, MA  02110-1301  USA
27*/
28
29/* Thanks to http://msnpiki.msnfanatic.com/ for lots of info on this! */
30
31#ifndef __SOAP_H__
32#define __SOAP_H__
33
34#include <stdio.h>
35#include <stdlib.h>
36#include <string.h>
37#include <sys/types.h>
38#include <sys/socket.h>
39#include <netinet/in.h>
40#include <arpa/inet.h>
41#include <unistd.h>
42#include "nogaim.h"
43
44
45int msn_soapq_flush(struct im_connection *ic, gboolean resend);
46
47
48#define SOAP_HTTP_REQUEST \
49        "POST %s HTTP/1.0\r\n" \
50        "Host: %s\r\n" \
51        "Accept: */*\r\n" \
52        "User-Agent: BitlBee " BITLBEE_VERSION "\r\n" \
53        "Content-Type: text/xml; charset=utf-8\r\n" \
54        "%s" \
55        "Content-Length: %zd\r\n" \
56        "Cache-Control: no-cache\r\n" \
57        "\r\n" \
58        "%s"
59
60
61#define SOAP_PASSPORT_SSO_URL "https://login.live.com/RST.srf"
62#define SOAP_PASSPORT_SSO_URL_MSN "https://msnia.login.live.com/pp900/RST.srf"
63
64#define SOAP_PASSPORT_SSO_PAYLOAD \
65        "<Envelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\" " \
66        "xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\" " \
67        "xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\" " \
68        "xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2002/12/policy\" " \
69        "xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" " \
70        "xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/03/addressing\" " \
71        "xmlns:wssc=\"http://schemas.xmlsoap.org/ws/2004/04/sc\" " \
72        "xmlns:wst=\"http://schemas.xmlsoap.org/ws/2004/04/trust\">" \
73        "<Header>" \
74        "<ps:AuthInfo " \
75        "xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" " \
76        "Id=\"PPAuthInfo\">" \
77        "<ps:HostingApp>{7108E71A-9926-4FCB-BCC9-9A9D3F32E423}</ps:HostingApp>" \
78        "<ps:BinaryVersion>4</ps:BinaryVersion>" \
79        "<ps:UIVersion>1</ps:UIVersion>" \
80        "<ps:Cookies></ps:Cookies>" \
81        "<ps:RequestParams>AQAAAAIAAABsYwQAAAAxMDMz</ps:RequestParams>" \
82        "</ps:AuthInfo>" \
83        "<wsse:Security>" \
84        "<wsse:UsernameToken Id=\"user\">" \
85        "<wsse:Username>%s</wsse:Username>" \
86        "<wsse:Password>%s</wsse:Password>" \
87        "</wsse:UsernameToken>" \
88        "</wsse:Security>" \
89        "</Header>" \
90        "<Body>" \
91        "<ps:RequestMultipleSecurityTokens " \
92        "xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" " \
93        "Id=\"RSTS\">" \
94        "<wst:RequestSecurityToken Id=\"RST0\">" \
95        "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>" \
96        "<wsp:AppliesTo>" \
97        "<wsa:EndpointReference>" \
98        "<wsa:Address>http://Passport.NET/tb</wsa:Address>" \
99        "</wsa:EndpointReference>" \
100        "</wsp:AppliesTo>" \
101        "</wst:RequestSecurityToken>" \
102        "<wst:RequestSecurityToken Id=\"RST1\">" \
103        "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>" \
104        "<wsp:AppliesTo>" \
105        "<wsa:EndpointReference>" \
106        "<wsa:Address>messengerclear.live.com</wsa:Address>" \
107        "</wsa:EndpointReference>" \
108        "</wsp:AppliesTo>" \
109        "<wsse:PolicyReference URI=\"%s\"></wsse:PolicyReference>" \
110        "</wst:RequestSecurityToken>" \
111        "<wst:RequestSecurityToken Id=\"RST2\">" \
112        "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>" \
113        "<wsp:AppliesTo>" \
114        "<wsa:EndpointReference>" \
115        "<wsa:Address>contacts.msn.com</wsa:Address>" \
116        "</wsa:EndpointReference>" \
117        "</wsp:AppliesTo>" \
118        "<wsse:PolicyReference xmlns=\"http://schemas.xmlsoap.org/ws/2003/06/secext\" URI=\"MBI\"></wsse:PolicyReference>" \
119        "</wst:RequestSecurityToken>" \
120        "<wst:RequestSecurityToken Id=\"RST3\">" \
121        "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>" \
122        "<wsp:AppliesTo>" \
123        "<wsa:EndpointReference>" \
124        "<wsa:Address>messengersecure.live.com</wsa:Address>" \
125        "</wsa:EndpointReference>" \
126        "</wsp:AppliesTo>" \
127        "<wsse:PolicyReference xmlns=\"http://schemas.xmlsoap.org/ws/2003/06/secext\" URI=\"MBI_SSL\"></wsse:PolicyReference>" \
128        "</wst:RequestSecurityToken>" \
129        "<wst:RequestSecurityToken Id=\"RST4\">" \
130        "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>" \
131        "<wsp:AppliesTo>" \
132        "<wsa:EndpointReference>" \
133        "<wsa:Address>storage.msn.com</wsa:Address>" \
134        "</wsa:EndpointReference>" \
135        "</wsp:AppliesTo>" \
136        "<wsse:PolicyReference xmlns=\"http://schemas.xmlsoap.org/ws/2003/06/secext\" URI=\"MBI_SSL\"></wsse:PolicyReference>" \
137        "</wst:RequestSecurityToken>" \
138        "</ps:RequestMultipleSecurityTokens>" \
139        "</Body>" \
140        "</Envelope>"
141
142int msn_soap_passport_sso_request(struct im_connection *ic, const char *nonce);
143
144
145#define SOAP_ABSERVICE_PAYLOAD \
146        "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
147        "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
148        "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
149        "<ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
150        "<ApplicationId xmlns=\"http://www.msn.com/webservices/AddressBook\">F6D2794D-501F-443A-ADBE-8F1490FF30FD</ApplicationId>" \
151        "<IsMigration xmlns=\"http://www.msn.com/webservices/AddressBook\">false</IsMigration>" \
152        "<PartnerScenario xmlns=\"http://www.msn.com/webservices/AddressBook\">%s</PartnerScenario>" \
153        "</ABApplicationHeader>" \
154        "<ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
155        "<ManagedGroupRequest xmlns=\"http://www.msn.com/webservices/AddressBook\">false</ManagedGroupRequest>" \
156        "<TicketToken>%s</TicketToken>" \
157        "</ABAuthHeader>" \
158        "</soap:Header>" \
159        "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
160        "%%s" \
161        "</soap:Body>" \
162        "</soap:Envelope>"
163
164#define SOAP_MEMLIST_URL "http://contacts.msn.com/abservice/SharingService.asmx"
165#define SOAP_MEMLIST_ACTION "http://www.msn.com/webservices/AddressBook/FindMembership"
166
167#define SOAP_MEMLIST_PAYLOAD \
168        "<FindMembership xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceFilter><Types><ServiceType>Messenger</ServiceType><ServiceType>IMAvailability</ServiceType></Types></serviceFilter><expandMembership>true</expandMembership>" \
169        "</FindMembership>"
170
171#define SOAP_MEMLIST_ADD_ACTION "http://www.msn.com/webservices/AddressBook/AddMember"
172#define SOAP_MEMLIST_DEL_ACTION "http://www.msn.com/webservices/AddressBook/DeleteMember"
173
174#define SOAP_MEMLIST_EDIT_PAYLOAD \
175        "<%sMember xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
176        "<serviceHandle>" \
177        "<Id>0</Id>" \
178        "<Type>Messenger</Type>" \
179        "<ForeignId></ForeignId>" \
180        "</serviceHandle>" \
181        "<memberships>" \
182        "<Membership>" \
183        "<MemberRole>%s</MemberRole>" \
184        "<Members>" \
185        "<Member xsi:type=\"PassportMember\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" \
186        "<Type>Passport</Type>" \
187        "<State>Accepted</State>" \
188        "<PassportName>%s</PassportName>" \
189        "</Member>" \
190        "</Members>" \
191        "</Membership>" \
192        "</memberships>" \
193        "</%sMember>"
194
195int msn_soap_memlist_request(struct im_connection *ic);
196int msn_soap_memlist_edit(struct im_connection *ic, const char *handle, gboolean add, int list);
197
198
199#define SOAP_ADDRESSBOOK_URL "http://contacts.msn.com/abservice/abservice.asmx"
200#define SOAP_ADDRESSBOOK_ACTION "http://www.msn.com/webservices/AddressBook/ABFindAll"
201
202#define SOAP_ADDRESSBOOK_PAYLOAD \
203        "<ABFindAll xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
204        "<abId>00000000-0000-0000-0000-000000000000</abId>" \
205        "<abView>Full</abView>" \
206        "<deltasOnly>false</deltasOnly>" \
207        "<lastChange>0001-01-01T00:00:00.0000000-08:00</lastChange>" \
208        "</ABFindAll>"
209
210#define SOAP_AB_NAMECHANGE_ACTION "http://www.msn.com/webservices/AddressBook/ABContactUpdate"
211
212#define SOAP_AB_NAMECHANGE_PAYLOAD \
213        "<ABContactUpdate xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
214        "<abId>00000000-0000-0000-0000-000000000000</abId>" \
215        "<contacts>" \
216        "<Contact xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
217        "<contactInfo>" \
218        "<contactType>Me</contactType>" \
219        "<displayName>%s</displayName>" \
220        "</contactInfo>" \
221        "<propertiesChanged>DisplayName</propertiesChanged>" \
222        "</Contact>" \
223        "</contacts>" \
224        "</ABContactUpdate>"
225
226#define SOAP_AB_CONTACT_ADD_ACTION "http://www.msn.com/webservices/AddressBook/ABContactAdd"
227
228#define SOAP_AB_CONTACT_ADD_PAYLOAD \
229        "<ABContactAdd xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
230        "<abId>00000000-0000-0000-0000-000000000000</abId>" \
231        "<contacts>" \
232        "<Contact xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
233        "<contactInfo>" \
234        "<contactType>LivePending</contactType>" \
235        "<passportName>%s</passportName>" \
236        "<isMessengerUser>true</isMessengerUser>" \
237        "<MessengerMemberInfo>" \
238        "<DisplayName>%s</DisplayName>" \
239        "</MessengerMemberInfo>" \
240        "</contactInfo>" \
241        "</Contact>" \
242        "</contacts>" \
243        "<options>" \
244        "<EnableAllowListManagement>true</EnableAllowListManagement>" \
245        "</options>" \
246        "</ABContactAdd>"
247
248#define SOAP_AB_CONTACT_DEL_ACTION "http://www.msn.com/webservices/AddressBook/ABContactDelete"
249
250#define SOAP_AB_CONTACT_DEL_PAYLOAD \
251        "<ABContactDelete xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
252        "<abId>00000000-0000-0000-0000-000000000000</abId>" \
253        "<contacts>" \
254        "<Contact xmlns=\"http://www.msn.com/webservices/AddressBook\">" \
255        "<contactId>%s</contactId>" \
256        "</Contact>" \
257        "</contacts>" \
258        "</ABContactDelete>"
259
260int msn_soap_addressbook_request(struct im_connection *ic);
261int msn_soap_addressbook_set_display_name(struct im_connection *ic, const char *new);
262int msn_soap_ab_contact_add(struct im_connection *ic, bee_user_t *bu);
263int msn_soap_ab_contact_del(struct im_connection *ic, bee_user_t *bu);
264
265
266#define SOAP_STORAGE_URL "https://storage.msn.com/storageservice/SchematizedStore.asmx"
267#define SOAP_PROFILE_GET_ACTION "http://www.msn.com/webservices/storage/w10/GetProfile"
268#define SOAP_PROFILE_SET_DN_ACTION "http://www.msn.com/webservices/storage/w10/UpdateProfile"
269
270#define SOAP_PROFILE_GET_PAYLOAD \
271        "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
272        "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
273        "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
274        "<StorageApplicationHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
275        "<ApplicationID>Messenger Client 9.0</ApplicationID>" \
276        "<Scenario>Initial</Scenario>" \
277        "</StorageApplicationHeader>" \
278        "<StorageUserHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
279        "<Puid>0</Puid>" \
280        "<TicketToken>%s</TicketToken>" \
281        "</StorageUserHeader>" \
282        "</soap:Header>" \
283        "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
284        "<GetProfile xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
285        "<profileHandle>" \
286        "<Alias>" \
287        "<Name>%s</Name>" \
288        "<NameSpace>MyCidStuff</NameSpace>" \
289        "</Alias>" \
290        "<RelationshipName>MyProfile</RelationshipName>" \
291        "</profileHandle>" \
292        "<profileAttributes>" \
293        "<ResourceID>true</ResourceID>" \
294        "<DateModified>true</DateModified>" \
295        "<ExpressionProfileAttributes>" \
296        "<ResourceID>true</ResourceID>" \
297        "<DateModified>true</DateModified>" \
298        "<DisplayName>true</DisplayName>" \
299        "<DisplayNameLastModified>true</DisplayNameLastModified>" \
300        "<PersonalStatus>true</PersonalStatus>" \
301        "<PersonalStatusLastModified>true</PersonalStatusLastModified>" \
302        "<StaticUserTilePublicURL>true</StaticUserTilePublicURL>" \
303        "<Photo>true</Photo>" \
304        "<Flags>true</Flags>" \
305        "</ExpressionProfileAttributes>" \
306        "</profileAttributes>" \
307        "</GetProfile>" \
308        "</soap:Body>" \
309        "</soap:Envelope>"
310
311#define SOAP_PROFILE_SET_DN_PAYLOAD \
312        "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
313        "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
314        "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
315        "<StorageApplicationHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
316        "<ApplicationID>Messenger Client 9.0</ApplicationID>" \
317        "<Scenario>Initial</Scenario>" \
318        "</StorageApplicationHeader>" \
319        "<StorageUserHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
320        "<Puid>0</Puid>" \
321        "<TicketToken>%s</TicketToken>" \
322        "</StorageUserHeader>" \
323        "</soap:Header>" \
324        "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
325        "<UpdateProfile xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
326        "<profile>" \
327        "<ResourceID>%s</ResourceID>" \
328        "<ExpressionProfile>" \
329        "<FreeText>Update</FreeText>" \
330        "<DisplayName>%s</DisplayName>" \
331        "<Flags>0</Flags>" \
332        "</ExpressionProfile>" \
333        "</profile>" \
334        "</UpdateProfile>" \
335        "</soap:Body>" \
336        "</soap:Envelope>"
337
338int msn_soap_profile_get(struct im_connection *ic, const char *cid);
339int msn_soap_profile_set_dn(struct im_connection *ic, const char *dn);
340
341#endif /* __SOAP_H__ */
Note: See TracBrowser for help on using the repository browser.