comparison libpurple/protocols/msn/nexus.c @ 20531:a96b5015395a

signs on!
author Ka-Hing Cheung <khc@hxbc.us>
date Mon, 01 Oct 2007 00:29:44 +0000
parents 719ce4acfcb9
children 10d27a4be2fd
comparison
equal deleted inserted replaced
20530:719ce4acfcb9 20531:a96b5015395a
55 msn_nexus_destroy(MsnNexus *nexus) 55 msn_nexus_destroy(MsnNexus *nexus)
56 { 56 {
57 if (nexus->challenge_data != NULL) 57 if (nexus->challenge_data != NULL)
58 g_hash_table_destroy(nexus->challenge_data); 58 g_hash_table_destroy(nexus->challenge_data);
59 59
60 //msn_soap_destroy(nexus->soapconn);
61 g_free(nexus); 60 g_free(nexus);
62 } 61 }
63 62
64 #if 0 /* khc */ 63 #if 0 /* khc */
65 /************************************************************************** 64 /**************************************************************************
158 for (; node; node = node->next) { 157 for (; node; node = node->next) {
159 xmlnode *token = msn_soap_xml_get(node, 158 xmlnode *token = msn_soap_xml_get(node,
160 "RequestedSecurityToken/BinarySecurityToken"); 159 "RequestedSecurityToken/BinarySecurityToken");
161 160
162 if (token) { 161 if (token) {
162 char *token_str = xmlnode_get_data(token);
163 char **elems, **cur, **tokens; 163 char **elems, **cur, **tokens;
164 char *msn_twn_t, *msn_twn_p, *cert_str; 164 char *msn_twn_t, *msn_twn_p, *cert_str;
165 165
166 elems = g_strsplit(token->data, "&amp;", 0); 166 if (token_str == NULL) continue;
167
168 elems = g_strsplit(token_str, "&", 0);
167 169
168 for (cur = elems; *cur != NULL; cur++){ 170 for (cur = elems; *cur != NULL; cur++){
169 tokens = g_strsplit(*cur, "=", 2); 171 tokens = g_strsplit(*cur, "=", 2);
170 g_hash_table_insert(nexus->challenge_data, tokens[0], tokens[1]); 172 g_hash_table_insert(nexus->challenge_data, tokens[0], tokens[1]);
171 /* Don't free each of the tokens, only the array. */ 173 /* Don't free each of the tokens, only the array. */
172 g_free(tokens); 174 g_free(tokens);
173 } 175 }
174 176
177 g_free(token_str);
175 g_strfreev(elems); 178 g_strfreev(elems);
176 179
177 msn_twn_t = g_hash_table_lookup(nexus->challenge_data, "t"); 180 msn_twn_t = g_hash_table_lookup(nexus->challenge_data, "t");
178 msn_twn_p = g_hash_table_lookup(nexus->challenge_data, "p"); 181 msn_twn_p = g_hash_table_lookup(nexus->challenge_data, "p");
179 182
196 session->nexus = NULL; 199 session->nexus = NULL;
197 200
198 return; 201 return;
199 } 202 }
200 } 203 }
204
205 /* we must have failed! */
206 msn_session_set_error(session, MSN_ERROR_AUTH, _("Windows Live ID authentication: cannot find authenticate token in server response"));
207
201 } 208 }
202 #if 0 209 #if 0
203 /*process the SOAP reply, get the Authentication Info*/ 210 /*process the SOAP reply, get the Authentication Info*/
204 static void 211 static void
205 nexus_login_read_cb(gpointer data, gint source, PurpleInputCondition cond) 212 nexus_login_read_cb(gpointer data, gint source, PurpleInputCondition cond)