Changeset 660cb00
- Timestamp:
- 2010-08-15T13:23:03Z (14 years ago)
- Branches:
- master
- Children:
- 9679fd8
- Parents:
- 5a7af1b
- Location:
- protocols/msn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.h
r5a7af1b r660cb00 204 204 /* ns.c */ 205 205 gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond ); 206 void msn_auth_got_passport_token( struct im_connection *ic, c har *token);206 void msn_auth_got_passport_token( struct im_connection *ic, const char *token, const char *error ); 207 207 void msn_auth_got_contact_list( struct im_connection *ic ); 208 208 -
protocols/msn/ns.c
r5a7af1b r660cb00 697 697 } 698 698 699 void msn_auth_got_passport_token( struct im_connection *ic, c har *token)699 void msn_auth_got_passport_token( struct im_connection *ic, const char *token, const char *error ) 700 700 { 701 701 struct msn_data *md; … … 707 707 md = ic->proto_data; 708 708 709 if( token ) 709 710 { 710 711 char buf[1536]; … … 712 713 g_snprintf( buf, sizeof( buf ), "USR %d SSO S %s %s\r\n", ++md->trId, md->tokens[0], token ); 713 714 msn_write( ic, buf, strlen( buf ) ); 715 } 716 else 717 { 718 imcb_error( ic, "Error during Passport authentication: %s", error ); 719 imc_logout( ic, TRUE ); 714 720 } 715 721 } -
protocols/msn/soap.c
r5a7af1b r660cb00 173 173 char *nonce; 174 174 char *secret; 175 char *error; 175 176 }; 176 177 … … 217 218 } 218 219 220 static xt_status msn_soap_passport_failure( struct xt_node *node, gpointer data ) 221 { 222 struct msn_soap_req_data *soap_req = data; 223 struct msn_soap_passport_sso_data *sd = soap_req->data; 224 struct xt_node *code = xt_find_node( node->children, "faultcode" ); 225 struct xt_node *string = xt_find_node( node->children, "faultstring" ); 226 227 if( code == NULL || code->text_len == 0 ) 228 sd->error = g_strdup( "Unknown error" ); 229 else 230 sd->error = g_strdup_printf( "%s (%s)", code->text, string && string->text_len ? 231 string->text : "no description available" ); 232 233 return XT_HANDLED; 234 } 235 219 236 static const struct xt_handler_entry msn_soap_passport_sso_parser[] = { 220 237 { "wsse:BinarySecurityToken", "wst:RequestedSecurityToken", msn_soap_passport_sso_token }, 238 { "S:Fault", "S:Envelope", msn_soap_passport_failure }, 221 239 { NULL, NULL, NULL } 222 240 }; … … 270 288 GUINT32_TO_LE( 72 ), 271 289 }; 290 291 if( sd->secret == NULL ) 292 { 293 msn_auth_got_passport_token( ic, NULL, sd->error ); 294 return MSN_SOAP_OK; 295 } 272 296 273 297 key1_len = base64_decode( sd->secret, (unsigned char**) &key1 ); … … 287 311 288 312 blurb64 = base64_encode( (unsigned char*) &blurb, sizeof( blurb ) ); 289 msn_auth_got_passport_token( ic, blurb64 );313 msn_auth_got_passport_token( ic, blurb64, NULL ); 290 314 291 315 g_free( padnonce ); … … 306 330 g_free( sd->nonce ); 307 331 g_free( sd->secret ); 332 g_free( sd->error ); 308 333 309 334 return MSN_SOAP_OK;
Note: See TracChangeset
for help on using the changeset viewer.