diff libpurple/protocols/jabber/auth.c @ 26272: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 5f9a24d1c25e
children f25410b0827c
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth.c	Sun Mar 22 23:44:31 2009 +0000
+++ b/libpurple/protocols/jabber/auth.c	Mon Mar 23 00:38:20 2009 +0000
@@ -281,7 +281,7 @@
 	secprops.min_ssf = 0;
 	secprops.security_flags = SASL_SEC_NOANONYMOUS;
 
-	if (!js->gsc) {
+	if (!jabber_stream_is_ssl(js)) {
 		secprops.max_ssf = -1;
 		secprops.maxbufsize = 4096;
 		plaintext = purple_account_get_bool(js->gc->account, "auth_plain_in_clear", FALSE);
@@ -544,7 +544,7 @@
 	} else if(plain) {
 		js->auth_type = JABBER_AUTH_PLAIN;
 
-		if(js->gsc == NULL && !purple_account_get_bool(js->gc->account, "auth_plain_in_clear", FALSE)) {
+		if(!jabber_stream_is_ssl(js) && !purple_account_get_bool(js->gc->account, "auth_plain_in_clear", FALSE)) {
 			char *msg = g_strdup_printf(_("%s requires plaintext authentication over an unencrypted connection.  Allow this and continue authentication?"),
 					js->gc->account->username);
 			purple_request_yes_no(js->gc, _("Plaintext Authentication"),
@@ -662,7 +662,7 @@
 			jabber_iq_send(iq);
 
 		} else if(xmlnode_get_child(query, "password")) {
-			if(js->gsc == NULL && !purple_account_get_bool(js->gc->account,
+			if(!jabber_stream_is_ssl(js) && !purple_account_get_bool(js->gc->account,
 						"auth_plain_in_clear", FALSE)) {
 				char *msg = g_strdup_printf(_("%s requires plaintext authentication over an unencrypted connection.  Allow this and continue authentication?"),
 											js->gc->account->username);