Mercurial > pidgin
diff src/protocols/yahoo/yahoo.c @ 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 | 096020ae09a9 |
children | 8e600ee6ec61 |
line wrap: on
line diff
--- 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) {