[Pidgin] #12094: MSN Direct Connections not working
    Pidgin 
    trac at pidgin.im
       
    Fri Jun  4 05:59:49 EDT 2010
    
    
  
#12094: MSN Direct Connections not working
----------------------+-----------------------------------------------------
 Reporter:  markuznw  |        Owner:  QuLogic
     Type:  defect    |       Status:  new    
Milestone:            |    Component:  MSN    
  Version:  2.7.1     |   Resolution:         
 Keywords:            |  
----------------------+-----------------------------------------------------
Comment(by kukkerman):
 Hi!
 The problem is, that if libpurple receives an ''application/x-msnmsgr-
 transreqbody'' SLP message with a ''Hashed-Nonce'' then around line 735 in
 slp.c the nonce and its type are parsed and the new
 ''!MsnDirectConnNonceType'' is stored into ''dc->ntpye'':
 {{{
 nonce = parse_dc_nonce(content, &ntype);
 ...
 if (ntype == DC_NONCE_PLAIN) {
    dc->nonce_type = ntype;
    memcpy(dc->nonce, nonce, 16);
 } else if (ntype == DC_NONCE_SHA1) {
    dc->nonce_type = ntype;
    strncpy(dc->remote_nonce, nonce, 36);
    dc->remote_nonce[36] = '\0';
 }
 }}}
 But if the remote side uses SHA1 hashing ''dc->nonce_hash'' should be
 recalculated because it's generated only once in ''msn_dc_new()'' using
 the plain method:
 {{{
 dc->nonce_type = DC_NONCE_PLAIN;
 msn_dc_generate_nonce(dc);
 }}}
 Because ''dc->ntype'' is set to DC_NONCE_SHA1 the plain nonce will be used
 in the ''Hashed-Nonce' field.
 So the soulution would be:
 {{{
 if (ntype == DC_NONCE_PLAIN) {
    dc->nonce_type = ntype;
    memcpy(dc->nonce, nonce, 16);
 } else if (ntype == DC_NONCE_SHA1) {
    dc->nonce_type = ntype;
    strncpy(dc->remote_nonce, nonce, 36);
    dc->remote_nonce[36] = '\0';
    msn_dc_calculate_nonce_hash(ntype, dc->nonce, dc->nonce_hash);
 }
 }}}
 I don't know if this is the whole story but it's a problem for sure.
 Hope this help.
 Cheers,
   Gabe
-- 
Ticket URL: <http://developer.pidgin.im/ticket/12094#comment:7>
Pidgin <http://pidgin.im>
Pidgin
    
    
More information about the Tracker
mailing list