Mercurial > pidgin.yaz
changeset 11183:8dca96cbcd64
[gaim-migrate @ 13295]
I changed the cipher API to use guchar instead of guint8
This seems to be what gtk/glib uses for random bits of data
I don't know what got into me
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 03 Aug 2005 02:57:00 +0000 |
parents | 5389d7d497ce |
children | 044645e8a679 |
files | plugins/ciphertest.c plugins/perl/common/Cipher.xs src/cipher.c src/cipher.h src/mime.h src/protocols/jabber/auth.c src/protocols/jabber/buddy.c src/protocols/jabber/presence.c src/protocols/jabber/si.c src/protocols/msn/notification.c src/protocols/msn/user.c src/protocols/rendezvous/rendezvous.c src/protocols/sametime/sametime.c src/protocols/trepia/trepia.c src/protocols/yahoo/crypt.c src/protocols/yahoo/yahoo.c src/proxy.c |
diffstat | 17 files changed, 115 insertions(+), 115 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/ciphertest.c Wed Aug 03 01:39:41 2005 +0000 +++ b/plugins/ciphertest.c Wed Aug 03 02:57:00 2005 +0000 @@ -38,8 +38,8 @@ #include "version.h" struct test { - const guint8 *question; - const guint8 *answer; + const guchar *question; + const guchar *answer; }; /************************************************************************** @@ -147,7 +147,7 @@ strlen(sha1_tests[i].question)); } else { gint j; - guint8 buff[1000]; + guchar buff[1000]; memset(buff, 'a', 1000);
--- a/plugins/perl/common/Cipher.xs Wed Aug 03 01:39:41 2005 +0000 +++ b/plugins/perl/common/Cipher.xs Wed Aug 03 02:57:00 2005 +0000 @@ -21,10 +21,10 @@ gboolean gaim_cipher_digest_region(name, data, data_len, in_len, digest, out_len) const gchar * name - const guint8 * data + const guchar * data size_t data_len size_t in_len - guint8 &digest + guchar &digest size_t * out_len Gaim::Cipher @@ -91,49 +91,49 @@ void gaim_cipher_context_set_iv(context, iv, len) Gaim::Cipher::Context context - guint8 * iv + guchar * iv size_t len void gaim_cipher_context_append(context, data, len) Gaim::Cipher::Context context - guint8 * data + guchar * data size_t len gboolean gaim_cipher_context_digest(context, in_len, digest, out_len) Gaim::Cipher::Context context size_t in_len - guint8 &digest + guchar &digest size_t &out_len gboolean gaim_cipher_context_digest_to_str(context, in_len, digest_s, out_len) Gaim::Cipher::Context context size_t in_len - guint8 &digest_s + guchar &digest_s size_t &out_len gint gaim_cipher_context_encrypt(context, data, len, output, outlen) Gaim::Cipher::Context context - guint8 &data + guchar &data size_t len - guint8 &output + guchar &output size_t &outlen gint gaim_cipher_context_decrypt(context, data, len, output, outlen) Gaim::Cipher::Context context - guint8 &data + guchar &data size_t len - guint8 &output + guchar &output size_t &outlen void gaim_cipher_context_set_salt(context, salt) Gaim::Cipher::Context context - guint8 *salt + guchar *salt size_t gaim_cipher_context_get_salt_size(context) @@ -142,7 +142,7 @@ void gaim_cipher_context_set_key(context, key) Gaim::Cipher::Context context - guint8 *key + guchar *key size_t gaim_cipher_context_get_key_size(context)
--- a/src/cipher.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/cipher.c Wed Aug 03 02:57:00 2005 +0000 @@ -38,7 +38,7 @@ struct MD5Context { guint32 total[2]; guint32 state[4]; - guint8 buffer[64]; + guchar buffer[64]; }; #define MD5_GET_GUINT32(n,b,i) { \ @@ -47,11 +47,11 @@ | ((guint32)(b) [(i) + 2] << 16) \ | ((guint32)(b) [(i) + 3] << 24); \ } -#define MD5_PUT_GUINT32(n,b,i) { \ - (b)[(i) ] = (guint8)((n) ); \ - (b)[(i) + 1] = (guint8)((n) >> 8); \ - (b)[(i) + 2] = (guint8)((n) >> 16); \ - (b)[(i) + 3] = (guint8)((n) >> 24); \ +#define MD5_PUT_GUINT32(n,b,i) { \ + (b)[(i) ] = (guchar)((n) ); \ + (b)[(i) + 1] = (guchar)((n) >> 8); \ + (b)[(i) + 2] = (guchar)((n) >> 16); \ + (b)[(i) + 3] = (guchar)((n) >> 24); \ } static void @@ -96,7 +96,7 @@ } static void -md5_process(struct MD5Context *md5_context, const guint8 data[64]) { +md5_process(struct MD5Context *md5_context, const guchar data[64]) { guint32 X[16], A, B, C, D; A = md5_context->state[0]; @@ -166,7 +166,7 @@ P(C, D, A, B, 7, 14, 0x676F02D9); P(B, C, D, A, 12, 20, 0x8D2A4C8A); #undef F - + /* third pass */ #define F(x,y,z) (x ^ y ^ z) P(A, B, C, D, 5, 4, 0xFFFA3942); @@ -216,7 +216,7 @@ } static void -md5_append(GaimCipherContext *context, const guint8 *data, size_t len) { +md5_append(GaimCipherContext *context, const guchar *data, size_t len) { struct MD5Context *md5_context = NULL; guint32 left = 0, fill = 0; @@ -254,14 +254,14 @@ } static gboolean -md5_digest(GaimCipherContext *context, size_t in_len, guint8 digest[16], +md5_digest(GaimCipherContext *context, size_t in_len, guchar digest[16], size_t *out_len) { struct MD5Context *md5_context = NULL; guint32 last, pad; guint32 high, low; - guint8 message[8]; - guint8 padding[64] = { + guchar message[8]; + guchar padding[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -386,7 +386,7 @@ sha1_ctx->H[1] += B; sha1_ctx->H[2] += C; sha1_ctx->H[3] += D; - sha1_ctx->H[4] += E; + sha1_ctx->H[4] += E; } static void @@ -471,7 +471,7 @@ static void -sha1_append(GaimCipherContext *context, const guint8 *data, size_t len) { +sha1_append(GaimCipherContext *context, const guchar *data, size_t len) { struct SHA1Context *sha1_ctx; gint i; @@ -494,12 +494,12 @@ } static gboolean -sha1_digest(GaimCipherContext *context, size_t in_len, guint8 digest[20], +sha1_digest(GaimCipherContext *context, size_t in_len, guchar digest[20], size_t *out_len) { struct SHA1Context *sha1_ctx; - guint8 pad0x80 = 0x80, pad0x00 = 0x00; - guint8 padlen[8]; + guchar pad0x80 = 0x80, pad0x00 = 0x00; + guchar padlen[8]; gint i; g_return_val_if_fail(in_len >= 20, FALSE); @@ -508,14 +508,14 @@ g_return_val_if_fail(sha1_ctx, FALSE); - padlen[0] = (guint8)((sha1_ctx->sizeHi >> 24) & 255); - padlen[1] = (guint8)((sha1_ctx->sizeHi >> 16) & 255); - padlen[2] = (guint8)((sha1_ctx->sizeHi >> 8) & 255); - padlen[3] = (guint8)((sha1_ctx->sizeHi >> 0) & 255); - padlen[4] = (guint8)((sha1_ctx->sizeLo >> 24) & 255); - padlen[5] = (guint8)((sha1_ctx->sizeLo >> 16) & 255); - padlen[6] = (guint8)((sha1_ctx->sizeLo >> 8) & 255); - padlen[7] = (guint8)((sha1_ctx->sizeLo >> 0) & 255); + padlen[0] = (guchar)((sha1_ctx->sizeHi >> 24) & 255); + padlen[1] = (guchar)((sha1_ctx->sizeHi >> 16) & 255); + padlen[2] = (guchar)((sha1_ctx->sizeHi >> 8) & 255); + padlen[3] = (guchar)((sha1_ctx->sizeHi >> 0) & 255); + padlen[4] = (guchar)((sha1_ctx->sizeLo >> 24) & 255); + padlen[5] = (guchar)((sha1_ctx->sizeLo >> 16) & 255); + padlen[6] = (guchar)((sha1_ctx->sizeLo >> 8) & 255); + padlen[7] = (guchar)((sha1_ctx->sizeLo >> 0) & 255); /* pad with a 1, then zeroes, then length */ gaim_cipher_context_append(context, &pad0x80, 1); @@ -524,7 +524,7 @@ gaim_cipher_context_append(context, padlen, 8); for(i = 0; i < 20; i++) { - digest[i] = (guint8)(sha1_ctx->H[i / 4] >> 24); + digest[i] = (guchar)(sha1_ctx->H[i / 4] >> 24); sha1_ctx->H[i / 4] <<= 8; } @@ -625,9 +625,9 @@ } gboolean -gaim_cipher_digest_region(const gchar *name, const guint8 *data, +gaim_cipher_digest_region(const gchar *name, const guchar *data, size_t data_len, size_t in_len, - guint8 digest[], size_t *out_len) + guchar digest[], size_t *out_len) { GaimCipher *cipher; GaimCipherContext *context; @@ -867,7 +867,7 @@ } void -gaim_cipher_context_set_iv(GaimCipherContext *context, guint8 *iv, size_t len) +gaim_cipher_context_set_iv(GaimCipherContext *context, guchar *iv, size_t len) { GaimCipher *cipher = NULL; @@ -885,7 +885,7 @@ } void -gaim_cipher_context_append(GaimCipherContext *context, const guint8 *data, +gaim_cipher_context_append(GaimCipherContext *context, const guchar *data, size_t len) { GaimCipher *cipher = NULL; @@ -904,7 +904,7 @@ gboolean gaim_cipher_context_digest(GaimCipherContext *context, size_t in_len, - guint8 digest[], size_t *out_len) + guchar digest[], size_t *out_len) { GaimCipher *cipher = NULL; @@ -927,7 +927,7 @@ gchar digest_s[], size_t *out_len) { /* 8k is a bit excessive, will tweak later. */ - guint8 digest[BUF_LEN * 4]; + guchar digest[BUF_LEN * 4]; gint n = 0; size_t dlen = 0; @@ -952,8 +952,8 @@ } gint -gaim_cipher_context_encrypt(GaimCipherContext *context, const guint8 data[], - size_t len, guint8 output[], size_t *outlen) +gaim_cipher_context_encrypt(GaimCipherContext *context, const guchar data[], + size_t len, guchar output[], size_t *outlen) { GaimCipher *cipher = NULL; @@ -976,8 +976,8 @@ } gint -gaim_cipher_context_decrypt(GaimCipherContext *context, const guint8 data[], - size_t len, guint8 output[], size_t *outlen) +gaim_cipher_context_decrypt(GaimCipherContext *context, const guchar data[], + size_t len, guchar output[], size_t *outlen) { GaimCipher *cipher = NULL; @@ -1000,7 +1000,7 @@ } void -gaim_cipher_context_set_salt(GaimCipherContext *context, guint8 *salt) { +gaim_cipher_context_set_salt(GaimCipherContext *context, guchar *salt) { GaimCipher *cipher = NULL; g_return_if_fail(context); @@ -1035,7 +1035,7 @@ } void -gaim_cipher_context_set_key(GaimCipherContext *context, guint8 *key) { +gaim_cipher_context_set_key(GaimCipherContext *context, guchar *key) { GaimCipher *cipher = NULL; g_return_if_fail(context);
--- a/src/cipher.h Wed Aug 03 01:39:41 2005 +0000 +++ b/src/cipher.h Wed Aug 03 02:57:00 2005 +0000 @@ -77,28 +77,28 @@ void (*uninit)(GaimCipherContext *context); /** The set initialization vector function */ - void (*set_iv)(GaimCipherContext *context, guint8 *iv, size_t len); + void (*set_iv)(GaimCipherContext *context, guchar *iv, size_t len); /** The append data function */ - void (*append)(GaimCipherContext *context, const guint8 *data, size_t len); + void (*append)(GaimCipherContext *context, const guchar *data, size_t len); /** The digest function */ - gboolean (*digest)(GaimCipherContext *context, size_t in_len, guint8 digest[], size_t *out_len); + gboolean (*digest)(GaimCipherContext *context, size_t in_len, guchar digest[], size_t *out_len); /** The encrypt function */ - int (*encrypt)(GaimCipherContext *context, const guint8 data[], size_t len, guint8 output[], size_t *outlen); + int (*encrypt)(GaimCipherContext *context, const guchar data[], size_t len, guchar output[], size_t *outlen); /** The decrypt function */ - int (*decrypt)(GaimCipherContext *context, const guint8 data[], size_t len, guint8 output[], size_t *outlen); + int (*decrypt)(GaimCipherContext *context, const guchar data[], size_t len, guchar output[], size_t *outlen); /** The set salt function */ - void (*set_salt)(GaimCipherContext *context, guint8 *salt); + void (*set_salt)(GaimCipherContext *context, guchar *salt); /** The get salt size function */ size_t (*get_salt_size)(GaimCipherContext *context); /** The set key function */ - void (*set_key)(GaimCipherContext *context, guint8 *key); + void (*set_key)(GaimCipherContext *context, guchar *key); /** The get key size function */ size_t (*get_key_size)(GaimCipherContext *context); @@ -143,7 +143,7 @@ * * @return @c TRUE if successful, @c FALSE otherwise */ -gboolean gaim_cipher_digest_region(const gchar *name, const guint8 *data, size_t data_len, size_t in_len, guint8 digest[], size_t *out_len); +gboolean gaim_cipher_digest_region(const gchar *name, const guchar *data, size_t data_len, size_t in_len, guchar digest[], size_t *out_len); /*@}*/ /******************************************************************************/ @@ -278,7 +278,7 @@ * @param iv The initialization vector to set * @param len The len of the IV */ -void gaim_cipher_context_set_iv(GaimCipherContext *context, guint8 *iv, size_t len); +void gaim_cipher_context_set_iv(GaimCipherContext *context, guchar *iv, size_t len); /** * Appends data to the context @@ -287,7 +287,7 @@ * @param data The data to append * @param len The length of the data */ -void gaim_cipher_context_append(GaimCipherContext *context, const guint8 *data, size_t len); +void gaim_cipher_context_append(GaimCipherContext *context, const guchar *data, size_t len); /** * Digests a context @@ -297,10 +297,10 @@ * @param digest The return buffer for the digest * @param out_len The length of the returned value */ -gboolean gaim_cipher_context_digest(GaimCipherContext *context, size_t in_len, guint8 digest[], size_t *out_len); +gboolean gaim_cipher_context_digest(GaimCipherContext *context, size_t in_len, guchar digest[], size_t *out_len); /** - * Converts a guint8 digest into a hex string + * Converts a guchar digest into a hex string * * @param context The context to get a digest from * @param in_len The length of the buffer @@ -320,7 +320,7 @@ * * @return A cipher specific status code */ -gint gaim_cipher_context_encrypt(GaimCipherContext *context, const guint8 data[], size_t len, guint8 output[], size_t *outlen); +gint gaim_cipher_context_encrypt(GaimCipherContext *context, const guchar data[], size_t len, guchar output[], size_t *outlen); /** * Decrypts data using the context @@ -333,7 +333,7 @@ * * @return A cipher specific status code */ -gint gaim_cipher_context_decrypt(GaimCipherContext *context, const guint8 data[], size_t len, guint8 output[], size_t *outlen); +gint gaim_cipher_context_decrypt(GaimCipherContext *context, const guchar data[], size_t len, guchar output[], size_t *outlen); /** * Sets the salt on a context @@ -341,7 +341,7 @@ * @param context The context who's salt to set * @param salt The salt */ -void gaim_cipher_context_set_salt(GaimCipherContext *context, guint8 *salt); +void gaim_cipher_context_set_salt(GaimCipherContext *context, guchar *salt); /** * Gets the size of the salt if the cipher supports it @@ -358,7 +358,7 @@ * @param context The context who's key to set * @param key The key */ -void gaim_cipher_context_set_key(GaimCipherContext *context, guint8 *key); +void gaim_cipher_context_set_key(GaimCipherContext *context, guchar *key); /** * Gets the key size for a context
--- a/src/mime.h Wed Aug 03 01:39:41 2005 +0000 +++ b/src/mime.h Wed Aug 03 02:57:00 2005 +0000 @@ -183,7 +183,7 @@ @param len The length of the buffer */ void gaim_mime_part_get_data_decoded(GaimMimePart *part, - guint8 **data, gsize *len); + guchar **data, gsize *len); /** Get the length of the data portion of a MIME document part
--- a/src/protocols/jabber/auth.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/jabber/auth.c Wed Aug 03 02:57:00 2005 +0000 @@ -227,7 +227,7 @@ x = xmlnode_new_child(query, "digest"); s = g_strdup_printf("%s%s", js->stream_id, pw); - gaim_cipher_digest_region("sha1", (guint8 *)s, strlen(s), + gaim_cipher_digest_region("sha1", (guchar *)s, strlen(s), sizeof(hashval), hashval, NULL); p = h; @@ -322,7 +322,7 @@ context = gaim_cipher_context_new(cipher, NULL); x = g_strdup_printf("%s:%s:%s", convnode, realm, convpasswd); - gaim_cipher_context_append(context, (const guint8 *)x, strlen(x)); + gaim_cipher_context_append(context, (const guchar *)x, strlen(x)); gaim_cipher_context_digest(context, sizeof(result), result, NULL); a1 = g_strdup_printf("xxxxxxxxxxxxxxxx:%s:%s", nonce, cnonce); @@ -330,13 +330,13 @@ g_memmove(a1, result, 16); gaim_cipher_context_reset(context, NULL); - gaim_cipher_context_append(context, (const guint8 *)a1, a1len); + gaim_cipher_context_append(context, (const guchar *)a1, a1len); gaim_cipher_context_digest(context, sizeof(result), result, NULL); ha1 = gaim_base16_encode(result, 16); gaim_cipher_context_reset(context, NULL); - gaim_cipher_context_append(context, (const guint8 *)a2, strlen(a2)); + gaim_cipher_context_append(context, (const guchar *)a2, strlen(a2)); gaim_cipher_context_digest(context, sizeof(result), result, NULL); ha2 = gaim_base16_encode(result, 16); @@ -344,7 +344,7 @@ kd = g_strdup_printf("%s:%s:00000001:%s:auth:%s", ha1, nonce, cnonce, ha2); gaim_cipher_context_reset(context, NULL); - gaim_cipher_context_append(context, (const guint8 *)kd, strlen(kd)); + gaim_cipher_context_append(context, (const guchar *)kd, strlen(kd)); gaim_cipher_context_digest(context, sizeof(result), result, NULL); gaim_cipher_context_destroy(context);
--- a/src/protocols/jabber/buddy.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/jabber/buddy.c Wed Aug 03 02:57:00 2005 +0000 @@ -394,7 +394,7 @@ binval = xmlnode_new_child(photo, "BINVAL"); enc = gaim_base64_encode(avatar_data, avatar_len); - gaim_cipher_digest_region("sha1", (guint8 *)avatar_data, + gaim_cipher_digest_region("sha1", (guchar *)avatar_data, avatar_len, sizeof(hashval), hashval, NULL); @@ -827,7 +827,7 @@ gaim_buddy_icons_set_for_user(js->gc->account, bare_jid, data, size); - gaim_cipher_digest_region("sha1", (guint8 *)data, size, + gaim_cipher_digest_region("sha1", (guchar *)data, size, sizeof(hashval), hashval, NULL); p = hash; for(i=0; i<20; i++, p+=2)
--- a/src/protocols/jabber/presence.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/jabber/presence.c Wed Aug 03 02:57:00 2005 +0000 @@ -231,7 +231,7 @@ char hash[41], *p; int i; - gaim_cipher_digest_region("sha1", (guint8 *)data, size, + gaim_cipher_digest_region("sha1", (guchar *)data, size, sizeof(hashval), hashval, NULL); p = hash; for(i=0; i<20; i++, p+=2)
--- a/src/protocols/jabber/si.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/jabber/si.c Wed Aug 03 02:57:00 2005 +0000 @@ -157,7 +157,7 @@ dstaddr = g_strdup_printf("%s%s%s@%s/%s", jsx->stream_id, xfer->who, jsx->js->user->node, jsx->js->user->domain, jsx->js->user->resource); - gaim_cipher_digest_region("sha1", (guint8 *)dstaddr, strlen(dstaddr), + gaim_cipher_digest_region("sha1", (guchar *)dstaddr, strlen(dstaddr), sizeof(hashval), hashval, NULL); g_free(dstaddr); dstaddr = g_malloc(41); @@ -277,7 +277,7 @@ jsx->js->user->node, jsx->js->user->domain, jsx->js->user->resource, xfer->who); - gaim_cipher_digest_region("sha1", (guint8 *)dstaddr, strlen(dstaddr), + gaim_cipher_digest_region("sha1", (guchar *)dstaddr, strlen(dstaddr), sizeof(hashval), hashval, NULL); g_free(dstaddr); dstaddr = g_malloc(41);
--- a/src/protocols/msn/notification.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/msn/notification.c Wed Aug 03 02:57:00 2005 +0000 @@ -405,18 +405,18 @@ const char *challenge_resp; GaimCipher *cipher; GaimCipherContext *context; - guint8 digest[16]; + guchar digest[16]; int i; cipher = gaim_ciphers_find_cipher("md5"); context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, (const guint8 *)cmd->params[1], + gaim_cipher_context_append(context, (const guchar *)cmd->params[1], strlen(cmd->params[1])); challenge_resp = "VT6PX?UQTM4WM%YR"; - gaim_cipher_context_append(context, (const guint8 *)challenge_resp, + gaim_cipher_context_append(context, (const guchar *)challenge_resp, strlen(challenge_resp)); gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); gaim_cipher_context_destroy(context); @@ -919,7 +919,7 @@ const char *url; GaimCipher *cipher; GaimCipherContext *context; - guint8 digest[16]; + guchar digest[16]; FILE *fd; char *buf; char buf2[3]; @@ -940,7 +940,7 @@ cipher = gaim_ciphers_find_cipher("md5"); context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, (const guint8 *)buf, strlen(buf)); + gaim_cipher_context_append(context, (const guchar *)buf, strlen(buf)); gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); gaim_cipher_context_destroy(context);
--- a/src/protocols/msn/user.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/msn/user.c Wed Aug 03 02:57:00 2005 +0000 @@ -204,7 +204,7 @@ memset(digest, 0, sizeof(digest)); ctx = gaim_cipher_context_new_by_name("sha1", NULL); - gaim_cipher_context_append(ctx, (const guint8 *)buf, st.st_size); + gaim_cipher_context_append(ctx, (const guchar *)buf, st.st_size); gaim_cipher_context_digest(ctx, sizeof(digest), digest, NULL); g_free(buf); @@ -227,7 +227,7 @@ memset(digest, 0, sizeof(digest)); gaim_cipher_context_reset(ctx, NULL); - gaim_cipher_context_append(ctx, (const guint8 *)buf, strlen(buf)); + gaim_cipher_context_append(ctx, (const guchar *)buf, strlen(buf)); gaim_cipher_context_digest(ctx, sizeof(digest), digest, NULL); gaim_cipher_context_destroy(ctx); g_free(buf);
--- a/src/protocols/rendezvous/rendezvous.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/rendezvous/rendezvous.c Wed Aug 03 02:57:00 2005 +0000 @@ -493,7 +493,7 @@ return; icondata = rendezvous_read_icon_data(iconfile, &iconlength); - gaim_cipher_digest_region("sha1", (guint8 *)icondata, iconlength, sizeof(hash), hash, NULL); + gaim_cipher_digest_region("sha1", (guchar *)icondata, iconlength, sizeof(hash), hash, NULL); g_free(icondata); base16 = gaim_base16_encode(hash, 20);
--- a/src/protocols/sametime/sametime.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/sametime/sametime.c Wed Aug 03 02:57:00 2005 +0000 @@ -2328,7 +2328,7 @@ } else if(g_str_has_prefix(type, "image")) { /* put images into the image store */ - guint8 *d_dat; + guchar *d_dat; gsize d_len; char *cid; int img; @@ -2353,7 +2353,7 @@ } else if(g_str_has_prefix(type, "text")) { /* concatenate all the text parts together */ - guint8 *data; + guchar *data; char *txt; gsize len;
--- a/src/protocols/trepia/trepia.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/trepia/trepia.c Wed Aug 03 02:57:00 2005 +0000 @@ -984,7 +984,7 @@ char md5_password[17]; GaimCipher *cipher; GaimCipherContext *context; - guint8 di[16]; + guchar di[16]; int i; if (source < 0) { @@ -1004,7 +1004,7 @@ cipher = gaim_ciphers_find_cipher("md5"); context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, password, strlen(password)); + gaim_cipher_context_append(context, (const guchar *)password, strlen(password)); gaim_cipher_context_digest(context, sizeof(di), di, NULL); *md5_password = '\0';
--- a/src/protocols/yahoo/crypt.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/yahoo/crypt.c Wed Aug 03 02:57:00 2005 +0000 @@ -41,7 +41,7 @@ { GaimCipher *cipher; GaimCipherContext *context1, *context2; - guint8 digest[16]; + guchar digest[16]; static char *buffer = NULL; static int buflen = 0; int needed = 3 + strlen (salt) + 1 + 26 + 1; @@ -73,32 +73,32 @@ key_len = strlen (key); /* Add the key string. */ - gaim_cipher_context_append(context1, (const guint8 *)key, key_len); + gaim_cipher_context_append(context1, (const guchar *)key, key_len); /* Because the SALT argument need not always have the salt prefix we * add it separately. */ - gaim_cipher_context_append(context1, (const guint8 *)md5_salt_prefix, + gaim_cipher_context_append(context1, (const guchar *)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, (const guint8 *)salt, salt_len); + gaim_cipher_context_append(context1, (const guchar *)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, (const guint8 *)key, key_len); + gaim_cipher_context_append(context2, (const guchar *)key, key_len); /* Add salt. */ - gaim_cipher_context_append(context2, (const guint8 *)salt, salt_len); + gaim_cipher_context_append(context2, (const guchar *)salt, salt_len); /* Add key again. */ - gaim_cipher_context_append(context2, (const guint8 *)key, key_len); + gaim_cipher_context_append(context2, (const guchar *)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); @@ -118,7 +118,7 @@ */ for (cnt = key_len; cnt > 0; cnt >>= 1) gaim_cipher_context_append(context1, - (cnt & 1) != 0 ? digest : (guint8 *)key, 1); + (cnt & 1) != 0 ? digest : (guchar *)key, 1); /* Create intermediate result. */ gaim_cipher_context_digest(context1, sizeof(digest), digest, NULL); @@ -133,23 +133,23 @@ /* Add key or last result. */ if ((cnt & 1) != 0) - gaim_cipher_context_append(context2, (const guint8 *)key, key_len); + gaim_cipher_context_append(context2, (const guchar *)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, (const guint8 *)salt, salt_len); + gaim_cipher_context_append(context2, (const guchar *)salt, salt_len); /* Add key for numbers not divisible by 7. */ if (cnt % 7 != 0) - gaim_cipher_context_append(context2, (const guint8 *)key, key_len); + gaim_cipher_context_append(context2, (const guchar *)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, (const guint8 *)key, key_len); + gaim_cipher_context_append(context2, (const guchar *)key, key_len); /* Create intermediate result. */ gaim_cipher_context_digest(context2, sizeof(digest), digest, NULL);
--- a/src/protocols/yahoo/yahoo.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/protocols/yahoo/yahoo.c Wed Aug 03 02:57:00 2005 +0000 @@ -1101,7 +1101,7 @@ cipher = gaim_ciphers_find_cipher("md5"); context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, (const guint8 *)pass, strlen(pass)); + gaim_cipher_context_append(context, (const guchar *)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, (const guint8 *)crypt_result, strlen(crypt_result)); + gaim_cipher_context_append(context, (const guchar *)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, (const guint8 *)hash_string_p, strlen(hash_string_p)); + gaim_cipher_context_append(context, (const guchar *)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, (const guint8 *)hash_string_c, strlen(hash_string_c)); + gaim_cipher_context_append(context, (const guchar *)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); @@ -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, (const guint8 *)pass, strlen(pass)); + gaim_cipher_context_append(md5_ctx, (const guchar *)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, (const guint8 *)crypt_result, strlen(crypt_result)); + gaim_cipher_context_append(md5_ctx, (const guchar *)crypt_result, strlen(crypt_result)); gaim_cipher_context_digest(md5_ctx, sizeof(md5_digest), md5_digest, NULL); to_y64(crypt_hash, md5_digest, 16); @@ -2331,7 +2331,7 @@ int i; GaimCipher *cipher; GaimCipherContext *context; - guint8 digest[16]; + guchar digest[16]; url = g_string_append(url, sn); url = g_string_append(url, "&passwd="); @@ -2339,7 +2339,7 @@ cipher = gaim_ciphers_find_cipher("md5"); context = gaim_cipher_context_new(cipher, NULL); - gaim_cipher_context_append(context, (const guint8 *)pass, strlen(pass)); + gaim_cipher_context_append(context, (const guchar *)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, (const guint8 *)chal, strlen(chal)); + gaim_cipher_context_append(context, (const guchar *)chal, strlen(chal)); gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); hashp = md5; for (i = 0; i < 16; ++i) {
--- a/src/proxy.c Wed Aug 03 01:39:41 2005 +0000 +++ b/src/proxy.c Wed Aug 03 02:57:00 2005 +0000 @@ -1418,7 +1418,7 @@ unsigned char Kxoropad[65]; int pwlen; char * pwinput; - guint8 md5buf[16]; + guchar md5buf[16]; cipher = gaim_ciphers_find_cipher("md5"); ctx = gaim_cipher_context_new(cipher, NULL); @@ -1426,7 +1426,7 @@ pwinput=(char *)passwd; pwlen=strlen(passwd); if (pwlen>64) { - gaim_cipher_context_append(ctx, (const guint8 *)passwd, strlen(passwd)); + gaim_cipher_context_append(ctx, (const guchar *)passwd, strlen(passwd)); gaim_cipher_context_digest(ctx, sizeof(md5buf), md5buf, NULL); pwinput=(char *)md5buf; pwlen=16;