gobjectification: 28b0eaab: Fix some stuff in disabled code.

qulogic at pidgin.im qulogic at pidgin.im
Sun Jul 11 04:05:45 EDT 2010


----------------------------------------------------------------------
Revision: 28b0eaabc8262930d5f2eb267d730d9b10f957b6
Parent:   4bd61921736d7d77fd48049ff66e974cae1c6b7c
Author:   qulogic at pidgin.im
Date:     07/11/10 00:38:46
Branch:   im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/28b0eaabc8262930d5f2eb267d730d9b10f957b6

Changelog: 

Fix some stuff in disabled code.

Changes against parent 4bd61921736d7d77fd48049ff66e974cae1c6b7c

  patched  libpurple/protocols/oscar/family_auth.c
  patched  libpurple/protocols/yahoo/libymsg.c

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	0826522ecf38c06a9d803c97a2dc8c72160b9543
+++ libpurple/protocols/yahoo/libymsg.c	db7d60801fd7c7513a471b8f5f86171f750241d7
@@ -3383,10 +3383,11 @@ static void yahoo_got_cookies(gpointer d
 		return;
 	}
 
-	if (purple_object_get_int(PURPLE_OBJECT(gc),"inpa") == 0)
+	if (purple_object_get_int(PURPLE_OBJECT(gc), "inpa") == 0)
 	{
-		purple_object_get_int(PURPLE_OBJECT(gc),"inpa") = purple_input_add(source, PURPLE_INPUT_WRITE,
-			yahoo_got_cookies_send_cb, gc);
+		g_object_set(PURPLE_OBJECT(gc), "inpa",
+			purple_input_add(source, PURPLE_INPUT_WRITE,
+				yahoo_got_cookies_send_cb, gc), NULL);
 		yahoo_got_cookies_send_cb(gc, source, PURPLE_INPUT_WRITE);
 	}
 }
@@ -3454,8 +3455,7 @@ yahoo_login_page_cb(PurpleUtilFetchUrlDa
 	GString *url = g_string_new("GET http://login.yahoo.com/config/login?login=");
 	char md5[33], *hashp = md5, *chal;
 	int i;
-	PurpleCipher *cipher;
-	PurpleCipherContext *context;
+	PurpleHash *hasher;
 	guchar digest[16];
 
 	yd->url_datas = g_slist_remove(yd->url_datas, url_data);
@@ -3470,20 +3470,19 @@ yahoo_login_page_cb(PurpleUtilFetchUrlDa
 	url = g_string_append(url, sn);
 	url = g_string_append(url, "&passwd=");
 
-	cipher = purple_ciphers_find_cipher("md5");
-	context = purple_cipher_context_new(cipher, NULL);
+	hasher = purple_md5_hash_new();
 
-	purple_cipher_context_append(context, (const guchar *)pass, strlen(pass));
-	purple_cipher_context_digest(context, sizeof(digest), digest, NULL);
+	purple_hash_append(hasher, (const guchar *)pass, strlen(pass));
+	purple_hash_digest(hasher, sizeof(digest), digest, NULL);
 	for (i = 0; i < 16; ++i) {
 		g_snprintf(hashp, 3, "%02x", digest[i]);
 		hashp += 2;
 	}
 
 	chal = g_strconcat(md5, g_hash_table_lookup(hash, ".challenge"), NULL);
-	purple_cipher_context_reset(context, NULL);
-	purple_cipher_context_append(context, (const guchar *)chal, strlen(chal));
-	purple_cipher_context_digest(context, sizeof(digest), digest, NULL);
+	purple_hash_reset(hasher);
+	purple_hash_append(hasher, (const guchar *)chal, strlen(chal));
+	purple_hash_digest(hasher, sizeof(digest), digest, NULL);
 	hashp = md5;
 	for (i = 0; i < 16; ++i) {
 		g_snprintf(hashp, 3, "%02x", digest[i]);
@@ -3493,9 +3492,9 @@ yahoo_login_page_cb(PurpleUtilFetchUrlDa
 	 * I dunno why this is here and commented out.. but in case it's needed
 	 * I updated it..
 
-	purple_cipher_context_reset(context, NULL);
-	purple_cipher_context_append(context, md5, strlen(md5));
-	purple_cipher_context_digest(context, sizeof(digest), digest, NULL);
+	purple_hash_reset(hasher);
+	purple_hash_append(hasher, md5, strlen(md5));
+	purple_hash_digest(hasher, sizeof(digest), digest, NULL);
 	hashp = md5;
 	for (i = 0; i < 16; ++i) {
 		g_snprintf(hashp, 3, "%02x", digest[i]);
@@ -3517,7 +3516,7 @@ yahoo_login_page_cb(PurpleUtilFetchUrlDa
 		return;
 	}
 
-	purple_cipher_context_destroy(context);
+	g_object_unref(G_OBJECT(hasher));
 }
 #endif /* TRY_WEBMESSENGER_LOGIN */
 
============================================================
--- libpurple/protocols/oscar/family_auth.c	1b3429e9f6a2e1682818fa1da9c3dd8ce0ea2724
+++ libpurple/protocols/oscar/family_auth.c	ac93d85498b7b352771148e489034901e006efb0
@@ -81,14 +81,14 @@ aim_encode_password_md5(const char *pass
 static int
 aim_encode_password_md5(const char *password, size_t password_len, const char *key, guint8 *digest)
 {
-	PurpleCipherContext *context;
+	PurpleHash *hash;
 
-	context = purple_cipher_context_new_by_name("md5", NULL);
-	purple_cipher_context_append(context, (const guchar *)key, strlen(key));
-	purple_cipher_context_append(context, (const guchar *)password, password_len);
-	purple_cipher_context_append(context, (const guchar *)AIM_MD5_STRING, strlen(AIM_MD5_STRING));
-	purple_cipher_context_digest(context, 16, digest, NULL);
-	purple_cipher_context_destroy(context);
+	hash = purple_md5_hash_new();
+	purple_hash_append(hash, (const guchar *)key, strlen(key));
+	purple_hash_append(hash, (const guchar *)password, password_len);
+	purple_hash_append(hash, (const guchar *)AIM_MD5_STRING, strlen(AIM_MD5_STRING));
+	purple_hash_digest(hash, 16, digest, NULL);
+	g_object_unref(G_OBJECT(hash));
 
 	return 0;
 }


More information about the Commits mailing list