diff src/protocols/jabber/auth.c @ 11127:719779387f96

[gaim-migrate @ 13183] Change the base16 and base64 functions to use better data types, and make appropriate changes to other parts of the Gaim code to get rid of a few warnings and hopefully make things more correct. In other news, why is CVS HEAD crashing for me on exit? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 19 Jul 2005 05:15:45 +0000
parents 94cc67130789
children 096020ae09a9
line wrap: on
line diff
--- a/src/protocols/jabber/auth.c	Tue Jul 19 03:51:54 2005 +0000
+++ b/src/protocols/jabber/auth.c	Tue Jul 19 05:15:45 2005 +0000
@@ -64,7 +64,7 @@
 	if(js->auth_type == JABBER_AUTH_PLAIN) {
 		xmlnode *auth;
 		GString *response;
-		unsigned char *enc_out;
+		gchar *enc_out;
 
 		auth = xmlnode_new("auth");
 		xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl");
@@ -76,7 +76,7 @@
 		response = g_string_append(response,
 				gaim_connection_get_password(js->gc));
 
-		enc_out = gaim_base64_encode(response->str, response->len);
+		enc_out = gaim_base64_encode((guint8 *)response->str, response->len);
 
 		xmlnode_set_attrib(auth, "mechanism", "PLAIN");
 		xmlnode_insert_data(auth, enc_out, -1);
@@ -307,7 +307,8 @@
 	guint8 result[16];
 	size_t a1len;
 
-	unsigned char *x, *a1, *ha1, *ha2, *kd, *z, *convnode, *convpasswd;
+	unsigned char *x, *a1, *kd, *convnode, *convpasswd;
+	gchar *ha1, *ha2, *z;
 
 	if((convnode = g_convert(jid->node, strlen(jid->node), "iso-8859-1", "utf-8",
 					NULL, NULL, NULL)) == NULL) {
@@ -376,7 +377,7 @@
 			return;
 		}
 
-		gaim_base64_decode(enc_in, &dec_in, NULL);
+		dec_in = (char *)gaim_base64_decode(enc_in, NULL);
 		gaim_debug(GAIM_DEBUG_MISC, "jabber", "decoded challenge (%d): %s\n",
 				strlen(dec_in), dec_in);
 
@@ -444,7 +445,7 @@
 			g_free(auth_resp);
 			g_free(cnonce);
 
-			enc_out = gaim_base64_encode(response->str, response->len);
+			enc_out = gaim_base64_encode((guint8 *)response->str, response->len);
 
 			gaim_debug(GAIM_DEBUG_MISC, "jabber", "decoded response (%d): %s\n", response->len, response->str);