Mercurial > pidgin
changeset 11144:923b78741964
[gaim-migrate @ 13208]
Get rid of a lot of Yahoo! warnings
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 22 Jul 2005 02:25:29 +0000 |
parents | 5c56223fa24f |
children | dbc518c453f2 |
files | src/protocols/yahoo/crypt.c src/protocols/yahoo/yahoo.c |
diffstat | 2 files changed, 25 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/yahoo/crypt.c Fri Jul 22 02:06:15 2005 +0000 +++ b/src/protocols/yahoo/crypt.c Fri Jul 22 02:25:29 2005 +0000 @@ -73,32 +73,32 @@ key_len = strlen (key); /* Add the key string. */ - gaim_cipher_context_append(context1, key, key_len); + gaim_cipher_context_append(context1, (const guint8 *)key, key_len); /* Because the SALT argument need not always have the salt prefix we * add it separately. */ - gaim_cipher_context_append(context1, md5_salt_prefix, + gaim_cipher_context_append(context1, (const guint8 *)md5_salt_prefix, sizeof(md5_salt_prefix) - 1); /* The last part is the salt string. This must be at most 8 * characters and it ends at the first `$' character (for * compatibility which existing solutions). */ - gaim_cipher_context_append(context1, salt, salt_len); + gaim_cipher_context_append(context1, (const guint8 *)salt, salt_len); /* Compute alternate MD5 sum with input KEY, SALT, and KEY. The * final result will be added to the first context. */ /* Add key. */ - gaim_cipher_context_append(context2, key, key_len); + gaim_cipher_context_append(context2, (const guint8 *)key, key_len); /* Add salt. */ - gaim_cipher_context_append(context2, salt, salt_len); + gaim_cipher_context_append(context2, (const guint8 *)salt, salt_len); /* Add key again. */ - gaim_cipher_context_append(context2, key, key_len); + gaim_cipher_context_append(context2, (const guint8 *)key, key_len); /* Now get result of this (16 bytes) and add it to the other context. */ gaim_cipher_context_digest(context2, sizeof(digest), digest, NULL); @@ -133,23 +133,23 @@ /* Add key or last result. */ if ((cnt & 1) != 0) - gaim_cipher_context_append(context2, key, key_len); + gaim_cipher_context_append(context2, (const guint8 *)key, key_len); else gaim_cipher_context_append(context2, digest, 16); /* Add salt for numbers not divisible by 3. */ if (cnt % 3 != 0) - gaim_cipher_context_append(context2, salt, salt_len); + gaim_cipher_context_append(context2, (const guint8 *)salt, salt_len); /* Add key for numbers not divisible by 7. */ if (cnt % 7 != 0) - gaim_cipher_context_append(context2, key, key_len); + gaim_cipher_context_append(context2, (const guint8 *)key, key_len); /* Add key or last result. */ if ((cnt & 1) != 0) gaim_cipher_context_append(context2, digest, 16); else - gaim_cipher_context_append(context2, key, key_len); + gaim_cipher_context_append(context2, (const guint8 *)key, key_len); /* Create intermediate result. */ gaim_cipher_context_digest(context2, sizeof(digest), digest, NULL);
--- a/src/protocols/yahoo/yahoo.c Fri Jul 22 02:06:15 2005 +0000 +++ b/src/protocols/yahoo/yahoo.c Fri Jul 22 02:25:29 2005 +0000 @@ -1033,7 +1033,7 @@ /* This is taken from Sylpheed by Hiroyuki Yamamoto. We have our own tobase64 function * in util.c, but it has a bug I don't feel like finding right now ;) */ -void to_y64(unsigned char *out, const unsigned char *in, int inlen) +void to_y64(char *out, const unsigned char *in, gsize inlen) /* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */ { for (; inlen >= 3; inlen -= 3) @@ -1101,7 +1101,7 @@ cipher = gaim_ciphers_find_cipher("md5"); context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, pass, strlen(pass)); + gaim_cipher_context_append(context, (const guint8 *)pass, strlen(pass)); gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); to_y64(password_hash, digest, 16); @@ -1109,7 +1109,7 @@ crypt_result = yahoo_crypt(pass, "$1$_2S43d5f$"); gaim_cipher_context_reset(context, NULL); - gaim_cipher_context_append(context, crypt_result, strlen(crypt_result)); + gaim_cipher_context_append(context, (const guint8 *)crypt_result, strlen(crypt_result)); gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); to_y64(crypt_hash, digest, 16); @@ -1155,12 +1155,12 @@ } gaim_cipher_context_reset(context, NULL); - gaim_cipher_context_append(context, hash_string_p, strlen(hash_string_p)); + gaim_cipher_context_append(context, (const guint8 *)hash_string_p, strlen(hash_string_p)); gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); to_y64(result6, digest, 16); gaim_cipher_context_reset(context, NULL); - gaim_cipher_context_append(context, hash_string_c, strlen(hash_string_c)); + gaim_cipher_context_append(context, (const guint8 *)hash_string_c, strlen(hash_string_c)); gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); gaim_cipher_context_destroy(context); to_y64(result96, digest, 16); @@ -1203,10 +1203,10 @@ char *crypt_hash = (char *)g_malloc(25); char *crypt_result = NULL; - char pass_hash_xor1[64]; - char pass_hash_xor2[64]; - char crypt_hash_xor1[64]; - char crypt_hash_xor2[64]; + unsigned char pass_hash_xor1[64]; + unsigned char pass_hash_xor2[64]; + unsigned char crypt_hash_xor1[64]; + unsigned char crypt_hash_xor2[64]; char resp_6[100]; char resp_96[100]; @@ -1214,7 +1214,7 @@ unsigned char digest2[20]; unsigned char comparison_src[20]; unsigned char magic_key_char[4]; - const unsigned char *magic_ptr; + const char *magic_ptr; unsigned int magic[64]; unsigned int magic_work = 0; @@ -1419,14 +1419,14 @@ /* Get password and crypt hashes as per usual. */ gaim_cipher_context_reset(md5_ctx, NULL); - gaim_cipher_context_append(md5_ctx, pass, strlen(pass)); + gaim_cipher_context_append(md5_ctx, (const guint8 *)pass, strlen(pass)); gaim_cipher_context_digest(md5_ctx, sizeof(md5_digest), md5_digest, NULL); to_y64(password_hash, md5_digest, 16); crypt_result = yahoo_crypt(pass, "$1$_2S43d5f$"); gaim_cipher_context_reset(md5_ctx, NULL); - gaim_cipher_context_append(md5_ctx, crypt_result, strlen(crypt_result)); + gaim_cipher_context_append(md5_ctx, (const guint8 *)crypt_result, strlen(crypt_result)); gaim_cipher_context_digest(md5_ctx, sizeof(md5_digest), md5_digest, NULL); to_y64(crypt_hash, md5_digest, 16); @@ -1909,7 +1909,7 @@ g_free(tmp); } - tmp2 = g_strndup(decoded, len); /* so its \0 terminated...*/ + tmp2 = g_strndup((const gchar *)decoded, len); /* so its \0 terminated...*/ ip = strtol(tmp2, NULL, 10); g_free(tmp2); g_free(decoded); @@ -2339,7 +2339,7 @@ cipher = gaim_ciphers_find_cipher("md5"); context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, pass, strlen(pass)); + gaim_cipher_context_append(context, (const guint8 *)pass, strlen(pass)); gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); for (i = 0; i < 16; ++i) { g_snprintf(hashp, 3, "%02x", digest[i]); @@ -2348,7 +2348,7 @@ chal = g_strconcat(md5, g_hash_table_lookup(hash, ".challenge"), NULL); gaim_cipher_context_reset(context, NULL); - gaim_cipher_context_append(context, chal, strlen(chal)); + gaim_cipher_context_append(context, (const guint8 *)chal, strlen(chal)); gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); hashp = md5; for (i = 0; i < 16; ++i) {