aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/ns.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-08-12 23:38:30 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-08-12 23:38:30 +0100
commitbe7a180689ba5dc2b1cd1dc14f55c59246e238ed (patch)
treec386ba63b69a1ea06965497a5c87f405d4fa6d77 /protocols/msn/ns.c
parentca7de3ac72f0ef10613badecb7eb6cc9a10f996b (diff)
Proper responses to CHL challenges. Clean up bee_users before calling
prpl->logout() since the buddy_data functions would like some structs to still exist.
Diffstat (limited to 'protocols/msn/ns.c')
-rw-r--r--protocols/msn/ns.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c
index ffb21c47..3e02e328 100644
--- a/protocols/msn/ns.c
+++ b/protocols/msn/ns.c
@@ -292,25 +292,20 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )
}
else if( strcmp( cmd[0], "CHL" ) == 0 )
{
- md5_state_t state;
- md5_byte_t digest[16];
- int i;
+ char *resp;
- if( num_parts != 3 )
+ if( num_parts < 3 )
{
imcb_error( ic, "Syntax error" );
imc_logout( ic, TRUE );
return( 0 );
}
- md5_init( &state );
- md5_append( &state, (const md5_byte_t *) cmd[2], strlen( cmd[2] ) );
- md5_append( &state, (const md5_byte_t *) QRY_CODE, strlen( QRY_CODE ) );
- md5_finish( &state, digest );
-
- g_snprintf( buf, sizeof( buf ), "QRY %d %s %d\r\n", ++md->trId, QRY_NAME, 32 );
- for( i = 0; i < 16; i ++ )
- g_snprintf( buf + strlen( buf ), 3, "%02x", digest[i] );
+ resp = msn_p11_challenge( cmd[2] );
+ g_snprintf( buf, sizeof( buf ), "QRY %d %s %zd\r\n%s",
+ ++md->trId, MSNP11_PROD_ID,
+ strlen( resp ), resp );
+ g_free( resp );
return( msn_write( ic, buf, strlen( buf ) ) );
}
@@ -581,6 +576,12 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )
censore. Meh. */
md->handler->msglen = atoi( cmd[2] );
}
+ else if( strcmp( cmd[0], "UBX" ) == 0 )
+ {
+ /* Status message. Parser coming soon. */
+ if( num_parts >= 4 )
+ md->handler->msglen = atoi( cmd[3] );
+ }
else if( isdigit( cmd[0][0] ) )
{
int num = atoi( cmd[0] );