comparison libpurple/protocols/jabber/jabber.c @ 26354:fcee93c74230

BOSH: For authentication purposes, HTTPS is equivalent to a secured JabberStream. Since we always require the connection from CM to server to be secure, allow BOSH+HTTPS to pass 'Require SSL/TLS'.
author Paul Aurich <paul@darkrain42.org>
date Mon, 23 Mar 2009 00:38:20 +0000
parents e4a060a1e3de
children 882748e27f9d
comparison
equal deleted inserted replaced
26353:07e22e1897f6 26354:fcee93c74230
186 { 186 {
187 if(xmlnode_get_child(packet, "starttls")) { 187 if(xmlnode_get_child(packet, "starttls")) {
188 if(jabber_process_starttls(js, packet)) 188 if(jabber_process_starttls(js, packet))
189 189
190 return; 190 return;
191 } else if(purple_account_get_bool(js->gc->account, "require_tls", FALSE) && !js->gsc) { 191 } else if(purple_account_get_bool(js->gc->account, "require_tls", FALSE) && !jabber_stream_is_ssl(js)) {
192 purple_connection_error_reason (js->gc, 192 purple_connection_error_reason (js->gc,
193 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, 193 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
194 _("You require encryption, but it is not available on this server.")); 194 _("You require encryption, but it is not available on this server."));
195 return; 195 return;
196 } 196 }
1741 g_free(id->lang); 1741 g_free(id->lang);
1742 g_free(id->name); 1742 g_free(id->name);
1743 g_free(id); 1743 g_free(id);
1744 jabber_identities = g_list_remove_link(jabber_identities, jabber_identities); 1744 jabber_identities = g_list_remove_link(jabber_identities, jabber_identities);
1745 } 1745 }
1746 }
1747
1748 gboolean jabber_stream_is_ssl(JabberStream *js)
1749 {
1750 return (js->bosh && jabber_bosh_connection_is_ssl(js->bosh)) ||
1751 (!js->bosh && js->gsc);
1746 } 1752 }
1747 1753
1748 const char *jabber_list_icon(PurpleAccount *a, PurpleBuddy *b) 1754 const char *jabber_list_icon(PurpleAccount *a, PurpleBuddy *b)
1749 { 1755 {
1750 return "jabber"; 1756 return "jabber";