im.pidgin.pidgin: 6227c43549bf66022512f18bb36d70b7c57c4430

am at adiumx.com am at adiumx.com
Mon Jan 7 19:27:20 EST 2008


-----------------------------------------------------------------
Revision: 6227c43549bf66022512f18bb36d70b7c57c4430
Ancestor: eba096d714009d24b0e61fc0eb3ffcd47fde6b9a
Author: am at adiumx.com
Date: 2008-01-08T00:22:48
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/jabber/jabber.c
        libpurple/protocols/jabber/jabber.h

ChangeLog: 

Now checking the hostname supplied by the user, or the host-part of the JID when no host name is given against the CN of the domain. This makes libpurple comply to the RFC. Fixes http://trac.adiumx.com/ticket/8787

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	f97cf719dfbefa80f47998f7f303e19f39421904
+++ libpurple/protocols/jabber/jabber.c	60386b3899753cfe5a0290f7f91453b935ac0db5
@@ -559,13 +559,12 @@ static void tls_init(JabberStream *js)
 	purple_input_remove(js->gc->inpa);
 	js->gc->inpa = 0;
 	js->gsc = purple_ssl_connect_with_host_fd(js->gc->account, js->fd,
-			jabber_login_callback_ssl, jabber_ssl_connect_failure, js->host, js->gc);
+			jabber_login_callback_ssl, jabber_ssl_connect_failure, js->certificate_CN, js->gc);
 }
 
 static void jabber_login_connect(JabberStream *js, const char *fqdn, const char *host, int port)
 {
 	js->serverFQDN = g_strdup(fqdn);
-	js->host = g_strdup(host);
 
 	if (purple_proxy_connect(js->gc, js->gc->account, host,
 			port, jabber_login_callback, js->gc) == NULL)
@@ -616,6 +615,7 @@ jabber_login(PurpleAccount *account)
 	js->write_buffer = purple_circ_buffer_new(512);
 	js->old_length = 0;
 	js->keepalive_timeout = -1;
+	js->certificate_CN = g_strdup(connect_server[0] ? connect_server : js->user->domain);
 
 	if(!js->user) {
 		purple_connection_error_reason (gc,
@@ -653,7 +653,7 @@ jabber_login(PurpleAccount *account)
 	if(purple_account_get_bool(js->gc->account, "old_ssl", FALSE)) {
 		if(purple_ssl_is_supported()) {
 			js->gsc = purple_ssl_connect(js->gc->account,
-					connect_server[0] ? connect_server : js->user->domain,
+					js->certificate_CN,
 					purple_account_get_int(account, "port", 5223), jabber_login_callback_ssl,
 					jabber_ssl_connect_failure, js->gc);
 		} else {
@@ -1128,6 +1128,7 @@ void jabber_register_account(PurpleAccou
 		my_jb->subscription |= JABBER_SUB_BOTH;
 
 	server = connect_server[0] ? connect_server : js->user->domain;
+	js->certificate_CN = g_strdup(server);
 
 	jabber_stream_set_state(js, JABBER_STREAM_CONNECTING);
 
@@ -1304,7 +1305,7 @@ void jabber_close(PurpleConnection *gc)
 		js->commands = g_list_delete_link(js->commands, js->commands);
 	}
 	g_free(js->server_name);
-	g_free(js->host);
+	g_free(js->certificate_CN);
 	g_free(js->gmail_last_time);
 	g_free(js->gmail_last_tid);
 	g_free(js->old_msg);
============================================================
--- libpurple/protocols/jabber/jabber.h	dcf93b0868c254669630cf11ec098f499b52845c
+++ libpurple/protocols/jabber/jabber.h	ca00ad05e451b4031181a51fedbd49422cb6c91a
@@ -192,7 +192,7 @@ struct _JabberStream
 	int old_length;
 	char *old_track;
 	
-	char *host;
+	char *certificate_CN;
 	
 	/* A purple timeout tag for the keepalive */
 	int keepalive_timeout;


More information about the Commits mailing list