pidgin: 88a24003: Helper functions are cool
markdoliner at pidgin.im
markdoliner at pidgin.im
Sat Jun 21 16:30:43 EDT 2008
-----------------------------------------------------------------
Revision: 88a24003053cda8454a59fd448eb6575bdea2e0e
Ancestor: 1dc65a60c4539192880bccd743e123539bd85585
Author: markdoliner at pidgin.im
Date: 2008-06-21T20:28:14
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/88a24003053cda8454a59fd448eb6575bdea2e0e
Modified files:
libpurple/protocols/oscar/family_auth.c
libpurple/protocols/oscar/family_oservice.c
libpurple/protocols/oscar/oscar.c
ChangeLog:
Helper functions are cool
-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/family_auth.c fd3854f0dae6663c87cc8614243c6e00dd6a7870
+++ libpurple/protocols/oscar/family_auth.c edc3dea4a619d3b826873b9741ab93cedceb8437
@@ -81,12 +81,9 @@ 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)
{
- PurpleCipher *cipher;
PurpleCipherContext *context;
- cipher = purple_ciphers_find_cipher("md5");
-
- context = purple_cipher_context_new(cipher, NULL);
+ 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));
============================================================
--- libpurple/protocols/oscar/family_oservice.c ed9e1a7164059c4d1e94be726452257e33b58571
+++ libpurple/protocols/oscar/family_oservice.c d41f35b555ff03a68e323fca90638eb8bc7d2bef
@@ -952,13 +952,10 @@ aim_sendmemblock(OscarData *od, FlapConn
byte_stream_putraw(&bs, buf, 0x10);
} else if (buf && (len > 0)) { /* use input buffer */
- PurpleCipher *cipher;
PurpleCipherContext *context;
guchar digest[16];
- cipher = purple_ciphers_find_cipher("md5");
-
- context = purple_cipher_context_new(cipher, NULL);
+ context = purple_cipher_context_new_by_name("md5", NULL);
purple_cipher_context_append(context, buf, len);
purple_cipher_context_digest(context, 16, digest, NULL);
purple_cipher_context_destroy(context);
@@ -966,7 +963,6 @@ aim_sendmemblock(OscarData *od, FlapConn
byte_stream_putraw(&bs, digest, 0x10);
} else if (len == 0) { /* no length, just hash NULL (buf is optional) */
- PurpleCipher *cipher;
PurpleCipherContext *context;
guchar digest[16];
guint8 nil = '\0';
@@ -975,9 +971,7 @@ aim_sendmemblock(OscarData *od, FlapConn
* I'm not sure if we really need the empty append with the
* new MD5 functions, so I'll leave it in, just in case.
*/
- cipher = purple_ciphers_find_cipher("md5");
-
- context = purple_cipher_context_new(cipher, NULL);
+ context = purple_cipher_context_new_by_name("md5", NULL);
purple_cipher_context_append(context, &nil, 0);
purple_cipher_context_digest(context, 16, digest, NULL);
purple_cipher_context_destroy(context);
============================================================
--- libpurple/protocols/oscar/oscar.c c31c2f8a69fe10d30bbc88abf9c983f4a7927a5b
+++ libpurple/protocols/oscar/oscar.c 59acd195bf72d097379b3e21fa8e72587bad7f5c
@@ -6424,15 +6424,12 @@ void oscar_set_icon(PurpleConnection *gc
if (img == NULL) {
aim_ssi_delicon(od);
} else {
- PurpleCipher *cipher;
PurpleCipherContext *context;
guchar md5[16];
gconstpointer data = purple_imgstore_get_data(img);
size_t len = purple_imgstore_get_size(img);
-
- cipher = purple_ciphers_find_cipher("md5");
- context = purple_cipher_context_new(cipher, NULL);
+ context = purple_cipher_context_new_by_name("md5", NULL);
purple_cipher_context_append(context, data, len);
purple_cipher_context_digest(context, 16, md5, NULL);
purple_cipher_context_destroy(context);
More information about the Commits
mailing list