Mercurial > pidgin
changeset 17652:06d60201e371
Use constants for IP address list, defined in myspace.h.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Wed, 20 Jun 2007 03:58:26 +0000 |
parents | 333fe6ac1046 |
children | 01d7e5096dde |
files | libpurple/protocols/myspace/myspace.c libpurple/protocols/myspace/myspace.h |
diffstat | 2 files changed, 18 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c Wed Jun 20 03:51:52 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Wed Jun 20 03:58:26 2007 +0000 @@ -529,24 +529,16 @@ purple_cipher_context_set_key(rc4, key); #endif - /* TODO: obtain IPs of network interfaces. This is not immediately - * important because you can still connect and perform basic - * functions of the protocol. There is also a high chance that the addreses - * are RFC1918 private, so the servers couldn't do anything with them - * anyways except make note of that fact. Probably important for any - * kind of direct connection, or file transfer functionality. - */ + /* TODO: obtain IPs of network interfaces */ + /* rc4 encrypt: * nonce1+email+IP list */ - data_len = NONCE_SIZE + strlen(email) - /* TODO: change to length of IP list */ - + 25; + + data_len = NONCE_SIZE + strlen(email) + MSIM_LOGIN_IP_LIST_LEN; data = g_new0(guchar, data_len); memcpy(data, nonce, NONCE_SIZE); memcpy(data + NONCE_SIZE, email, strlen(email)); - memcpy(data + NONCE_SIZE + strlen(email), - /* TODO: IP addresses of network interfaces */ - "\x00\x00\x00\x00\x05\x7f\x00\x00\x01\x00\x00\x00\x00\x0a\x00\x00\x40\xc0\xa8\x58\x01\xc0\xa8\x3c\x01", 25); + memcpy(data + NONCE_SIZE + strlen(email), MSIM_LOGIN_IP_LIST, MSIM_LOGIN_IP_LIST_LEN); #ifdef MSIM_USE_PURPLE_RC4 data_out = g_new0(guchar, data_len); @@ -1226,7 +1218,6 @@ purple_debug_info("msim", "msim_error: %s\n", full_errmsg); - /* TODO: do something with the error # (localization of errmsg?) */ purple_notify_error(session->account, g_strdup(_("MySpaceIM Error")), full_errmsg, NULL); @@ -1314,7 +1305,6 @@ buddy = purple_find_buddy(session->account, username); if (!buddy) { - /* TODO: purple aliases, userids and usernames */ purple_debug_info("msim", "msim_status: making new buddy for %s\n", username); buddy = purple_buddy_new(session->account, username, NULL);
--- a/libpurple/protocols/myspace/myspace.h Wed Jun 20 03:51:52 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.h Wed Jun 20 03:58:26 2007 +0000 @@ -98,6 +98,19 @@ /* Authentication algorithm for login2 */ #define MSIM_AUTH_ALGORITHM 196610 +/* TODO: obtain IPs of network interfaces from user's machine, instead of + * hardcoding these values below (used in msim_compute_login_response). + * This is not immediately + * important because you can still connect and perform basic + * functions of the protocol. There is also a high chance that the addreses + * are RFC1918 private, so the servers couldn't do anything with them + * anyways except make note of that fact. Probably important for any + * kind of direct connection, or file transfer functionality. + */ + +#define MSIM_LOGIN_IP_LIST "\x00\x00\x00\x00\x05\x7f\x00\x00\x01\x00\x00\x00\x00\x0a\x00\x00\x40\xc0\xa8\x58\x01\xc0\xa8\x3c\x01" +#define MSIM_LOGIN_IP_LIST_LEN 25 + /* Indexes into status string (0|1|2|3|..., but 0 always empty) */ #define MSIM_STATUS_ORDINAL_EMPTY 0 #define MSIM_STATUS_ORDINAL_UNKNOWNs 1