comparison libpurple/protocols/msn/nexus.h @ 20461:25542d5c94ed

propagate from branch 'im.pidgin.pidgin' (head 007693114b23cd2711c1cb9030a148e2f63de8c8) to branch 'im.pidgin.cpw.khc.msnp14' (head 46048b0e7414ad1a4545b3a49494fea80191a9d1)
author Ka-Hing Cheung <khc@hxbc.us>
date Sat, 07 Jul 2007 03:52:12 +0000
parents 60bc06498746
children 723b5a2f91ce
comparison
equal deleted inserted replaced
18451:7122bcebf7c9 20461:25542d5c94ed
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 23 */
24 #ifndef _MSN_NEXUS_H_ 24 #ifndef _MSN_NEXUS_H_
25 #define _MSN_NEXUS_H_ 25 #define _MSN_NEXUS_H_
26 26
27 #include "soap.h"
28
29 /*#define MSN_TWN_SERVER "loginnet.passport.com"*/
30 #define MSN_TWN_SERVER "login.live.com"
31
32 #define TWN_START_TOKEN "<wsse:BinarySecurityToken Id=\"PPToken1\">"
33 #define TWN_END_TOKEN "</wsse:BinarySecurityToken>"
34
35 #define TWN_POST_URL "/RST.srf"
36 #define TWN_ENVELOP_TEMPLATE "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"\
37 "<Envelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\" xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\" xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2002/12/policy\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/03/addressing\" xmlns:wssc=\"http://schemas.xmlsoap.org/ws/2004/04/sc\" xmlns:wst=\"http://schemas.xmlsoap.org/ws/2004/04/trust\">"\
38 "<Header>"\
39 "<ps:AuthInfo xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" Id=\"PPAuthInfo\">"\
40 "<ps:HostingApp>{3:B}</ps:HostingApp>"\
41 "<ps:BinaryVersion>4</ps:BinaryVersion>"\
42 "<ps:UIVersion>1</ps:UIVersion>"\
43 "<ps:Cookies></ps:Cookies>"\
44 "<ps:RequestParams>AQAAAAIAAABsYwQAAAAzMDg0</ps:RequestParams>"\
45 "</ps:AuthInfo>"\
46 "<wsse:Security>"\
47 "<wsse:UsernameToken Id=\"user\">"\
48 "<wsse:Username>%s</wsse:Username>"\
49 "<wsse:Password>%s</wsse:Password>"\
50 "</wsse:UsernameToken>"\
51 "</wsse:Security>"\
52 "</Header>"\
53 "<Body>"\
54 "<ps:RequestMultipleSecurityTokens xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" Id=\"RSTS\">"\
55 "<wst:RequestSecurityToken Id=\"RST0\">"\
56 "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>"\
57 "<wsp:AppliesTo>"\
58 "<wsa:EndpointReference>"\
59 "<wsa:Address>http://Passport.NET/tb</wsa:Address>"\
60 "</wsa:EndpointReference>"\
61 "</wsp:AppliesTo>"\
62 "</wst:RequestSecurityToken>"\
63 "<wst:RequestSecurityToken Id=\"RST1\">"\
64 "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>"\
65 "<wsp:AppliesTo>"\
66 "<wsa:EndpointReference>"\
67 "<wsa:Address>messenger.msn.com</wsa:Address>"\
68 "</wsa:EndpointReference>"\
69 "</wsp:AppliesTo>"\
70 "<wsse:PolicyReference URI=\"?%s\">"\
71 "</wsse:PolicyReference>"\
72 "</wst:RequestSecurityToken>"\
73 "</ps:RequestMultipleSecurityTokens>"\
74 "</Body>"\
75 "</Envelope>"
76
77 #define TWN_LIVE_START_TOKEN "<wsse:BinarySecurityToken Id=\"PPToken1\">"
78 #define TWN_LIVE_END_TOKEN "</wsse:BinarySecurityToken>"
79 #define TWN_LIVE_ENVELOP_TEMPLATE "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"\
80 "<Envelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\" xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\" xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2002/12/policy\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/03/addressing\" xmlns:wssc=\"http://schemas.xmlsoap.org/ws/2004/04/sc\" xmlns:wst=\"http://schemas.xmlsoap.org/ws/2004/04/trust\">"\
81 "<Header>"\
82 "<ps:AuthInfo xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" Id=\"PPAuthInfo\">"\
83 "<ps:HostingApp>{7108E71A-9926-4FCB-BCC9-9A9D3F32E423}</ps:HostingApp>"\
84 "<ps:BinaryVersion>4</ps:BinaryVersion>"\
85 "<ps:UIVersion>1</ps:UIVersion>"\
86 "<ps:Cookies></ps:Cookies>"\
87 "<ps:RequestParams>AQAAAAIAAABsYwQAAAAyMDUy</ps:RequestParams>"\
88 "</ps:AuthInfo>"\
89 "<wsse:Security>"\
90 "<wsse:UsernameToken Id=\"user\">"\
91 "<wsse:Username>%s</wsse:Username>"\
92 "<wsse:Password>%s</wsse:Password>"\
93 "</wsse:UsernameToken>"\
94 "</wsse:Security>"\
95 "</Header>"\
96 "<Body>"\
97 "<ps:RequestMultipleSecurityTokens xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" Id=\"RSTS\">"\
98 "<wst:RequestSecurityToken Id=\"RST0\">"\
99 "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>"\
100 "<wsp:AppliesTo>"\
101 "<wsa:EndpointReference>"\
102 "<wsa:Address>http://Passport.NET/tb</wsa:Address>"\
103 "</wsa:EndpointReference>"\
104 "</wsp:AppliesTo>"\
105 "</wst:RequestSecurityToken>"\
106 "<wst:RequestSecurityToken Id=\"RST1\">"\
107 "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>"\
108 "<wsp:AppliesTo>"\
109 "<wsa:EndpointReference>"\
110 "<wsa:Address>messenger.msn.com</wsa:Address>"\
111 "</wsa:EndpointReference>"\
112 "</wsp:AppliesTo>"\
113 "<wsse:PolicyReference URI=\"?%s\"></wsse:PolicyReference>"\
114 "</wst:RequestSecurityToken>"\
115 "<wst:RequestSecurityToken Id=\"RST2\">"\
116 "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>"\
117 "<wsp:AppliesTo>"\
118 "<wsa:EndpointReference>"\
119 "<wsa:Address>contacts.msn.com</wsa:Address>"\
120 "</wsa:EndpointReference>"\
121 "</wsp:AppliesTo>"\
122 "<wsse:PolicyReference URI=\"?%s\"></wsse:PolicyReference>"\
123 " </wst:RequestSecurityToken>"\
124 "<wst:RequestSecurityToken Id=\"RST3\">"\
125 "<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>"\
126 "<wsp:AppliesTo>"\
127 "<wsa:EndpointReference>"\
128 "<wsa:Address>voice.messenger.msn.com</wsa:Address>"\
129 "</wsa:EndpointReference>"\
130 " </wsp:AppliesTo>"\
131 "<wsse:PolicyReference URI=\"?%s\"></wsse:PolicyReference>"\
132 "</wst:RequestSecurityToken>"\
133 "</ps:RequestMultipleSecurityTokens>"\
134 "</Body>"\
135 "</Envelope>"
136
27 typedef struct _MsnNexus MsnNexus; 137 typedef struct _MsnNexus MsnNexus;
28 138
29 struct _MsnNexus 139 struct _MsnNexus
30 { 140 {
31 MsnSession *session; 141 MsnSession *session;
32 142 MsnSoapConn *soapconn;
33 char *login_host; 143 char * challenge_data_str;
34 char *login_path;
35 GHashTable *challenge_data; 144 GHashTable *challenge_data;
36 PurpleSslConnection *gsc;
37
38 guint input_handler;
39
40 char *write_buf;
41 gsize written_len;
42 PurpleInputFunction written_cb;
43
44 char *read_buf;
45 gsize read_len;
46 }; 145 };
47 146
48 void msn_nexus_connect(MsnNexus *nexus); 147 void msn_nexus_connect(MsnNexus *nexus);
49 MsnNexus *msn_nexus_new(MsnSession *session); 148 MsnNexus *msn_nexus_new(MsnSession *session);
50 void msn_nexus_destroy(MsnNexus *nexus); 149 void msn_nexus_destroy(MsnNexus *nexus);