Exemplo n.º 1
0
static void
pn_send_login_uux (MsnSession *session)
{
    MsnCmdProc *cmdproc;
    gchar *payload;
    const gchar *state_text;
    cmdproc = session->notification->cmdproc;

    payload = g_strdup_printf ("<EndpointData><Capabilities>%ld:0</Capabilities></EndpointData>",
                               session->client_id);
    {
        MsnTransaction *trans;
        trans = msn_transaction_new (cmdproc, "UUX", "%d", strlen (payload));
        msn_transaction_set_payload (trans, payload, strlen (payload));
        msn_cmdproc_send_trans (cmdproc, trans);
    }
    g_free (payload);

    state_text = util_type_to_str (util_status_from_session (session));
    payload = g_strdup_printf ("<PrivateEndpointData><EpName>msn-pecan</EpName><Idle>%s</Idle><ClientType>1</ClientType><State>%s</State></PrivateEndpointData>",
                               strcmp (state_text, "ILN") == 0 ? "true" : "false", state_text);
    {
        MsnTransaction *trans;
        trans = msn_transaction_new (cmdproc, "UUX", "%d", strlen (payload));
        msn_transaction_set_payload (trans, payload, strlen (payload));
        msn_cmdproc_send_trans (cmdproc, trans);
    }
    g_free (payload);
}
Exemplo n.º 2
0
static void
chl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
{
	MsnTransaction *trans;
	char buf[33];
	const char *challenge_resp;
	GaimCipher *cipher;
	GaimCipherContext *context;
	guchar digest[16];
	int i;

	cipher = gaim_ciphers_find_cipher("md5");
	context = gaim_cipher_context_new(cipher, NULL);

	gaim_cipher_context_append(context, (const guchar *)cmd->params[1],
							   strlen(cmd->params[1]));

	challenge_resp = "VT6PX?UQTM4WM%YR";

	gaim_cipher_context_append(context, (const guchar *)challenge_resp,
							   strlen(challenge_resp));
	gaim_cipher_context_digest(context, sizeof(digest), digest, NULL);
	gaim_cipher_context_destroy(context);

	for (i = 0; i < 16; i++)
		g_snprintf(buf + (i*2), 3, "%02x", digest[i]);

	trans = msn_transaction_new(cmdproc, "QRY", "%s 32", "PROD0038W!61ZTF9");

	msn_transaction_set_payload(trans, buf, 32);

	msn_cmdproc_send_trans(cmdproc, trans);
}
Exemplo n.º 3
0
static inline void
pn_set_personal_message (MsnSession *session,
                         gchar *value,
                         gchar *current_media)
{
    MsnCmdProc *cmdproc;
    gchar *payload;

    cmdproc = session->notification->cmdproc;
    payload = g_strdup_printf ("<Data><PSM>%s</PSM><CurrentMedia>%s</CurrentMedia></Data>",
                               value ? value : "", current_media ? current_media : "");

    {
        MsnTransaction *trans;
        trans = msn_transaction_new (cmdproc, "UUX", "%d", strlen (payload));
        msn_transaction_set_payload (trans, payload, strlen (payload));
        msn_cmdproc_send_trans (cmdproc, trans);
    }
    g_free (payload);
}
Exemplo n.º 4
0
static void
chl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
{
    MsnTransaction *trans;
    gchar buf[32];

#if 0
    PurpleCipher *cipher;
    PurpleCipherContext *context;
    guchar digest[16];
    const char *challenge_resp;
    int i;

    cipher = purple_ciphers_find_cipher("md5");
    context = purple_cipher_context_new(cipher, NULL);

    purple_cipher_context_append(context, (const guchar *)cmd->params[1],
                                 strlen(cmd->params[1]));

    challenge_resp = "VT6PX?UQTM4WM%YR";

    purple_cipher_context_append(context, (const guchar *)challenge_resp,
                                 strlen(challenge_resp));
    purple_cipher_context_digest(context, sizeof(digest), digest, NULL);
    purple_cipher_context_destroy(context);

    for (i = 0; i < 16; i++)
        g_snprintf(buf + (i*2), 3, "%02x", digest[i]);
#else
    pecan_handle_challenge (cmd->params[1], "PROD0101{0RM?UBW", buf);
#endif

    /* trans = msn_transaction_new(cmdproc, "QRY", "%s 32", "PROD0038W!61ZTF9"); */
    trans = msn_transaction_new (cmdproc, "QRY", "%s 32", "PROD0101{0RM?UBW");

    msn_transaction_set_payload (trans, buf, 32);

    msn_cmdproc_send_trans (cmdproc, trans);
}