Show
Ignore:
Timestamp:
2008-07-31T20:44:43Z (2 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
branch-nick:
devel
revision id:
wilmer@gaast.net-20080731204443-lvon6xxb8erdw240
Message:

Reverting to the old MSN/Passport authentication mechanism, the new one
is "broken". (Bug #439)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • devel/protocols/msn/ns.c

    r405 r411  
    3434static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int num_parts ); 
    3535 
    36 static void msn_auth_got_passport_token( struct msn_auth_data *mad ); 
     36static void msn_auth_got_passport_id( struct passport_reply *rep ); 
    3737 
    3838gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond ) 
     
    222222                { 
    223223                        /* Time for some Passport black magic... */ 
    224                         if( !passport_get_token( msn_auth_got_passport_token, ic, ic->acc->user, ic->acc->pass, cmd[4] ) ) 
     224                        if( !passport_get_id( msn_auth_got_passport_id, ic, ic->acc->user, ic->acc->pass, cmd[4] ) ) 
    225225                        { 
    226226                                imcb_error( ic, "Error while contacting Passport server" ); 
     
    709709} 
    710710 
    711 static void msn_auth_got_passport_token( struct msn_auth_data *mad ) 
     711static void msn_auth_got_passport_id( struct passport_reply *rep ) 
    712712{ 
    713         struct im_connection *ic = mad->data; 
    714         struct msn_data *md; 
    715          
    716         /* Dead connection? */ 
    717         if( g_slist_find( msn_connections, ic ) == NULL ) 
    718                 return; 
    719          
    720         md = ic->proto_data; 
    721         if( mad->token ) 
    722         { 
    723                 char buf[1024]; 
    724                  
    725                 g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, mad->token ); 
     713        struct im_connection *ic = rep->data; 
     714        struct msn_data *md = ic->proto_data; 
     715        char *key = rep->result; 
     716        char buf[1024]; 
     717         
     718        if( key == NULL ) 
     719        { 
     720                imcb_error( ic, "Error during Passport authentication (%s)", 
     721                               rep->error_string ? rep->error_string : "Unknown error" ); 
     722                imc_logout( ic, TRUE ); 
     723        } 
     724        else 
     725        { 
     726                g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, key ); 
    726727                msn_write( ic, buf, strlen( buf ) ); 
    727728        } 
    728         else 
    729         { 
    730                 imcb_error( ic, "Error during Passport authentication: %s", mad->error ); 
    731                 imc_logout( ic, TRUE ); 
    732         } 
    733729}