From 486ddb53b93b6677dc3feeb4afaad2ea93a71a81 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 19 Dec 2011 15:50:58 +0100 Subject: Initial merge of tls_verify patch from AopicieR. --- protocols/jabber/jabber.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'protocols/jabber/jabber.c') diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 7d9547ab..dd2f0866 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -81,6 +81,9 @@ static void jabber_init( account_t *acc ) s = set_add( &acc->set, "tls", "try", set_eval_tls, acc ); s->flags |= ACC_SET_OFFLINE_ONLY; + s = set_add( &acc->set, "tls_verify", "true", set_eval_bool, acc ); + s->flags |= ACC_SET_OFFLINE_ONLY; + s = set_add( &acc->set, "sasl", "true", set_eval_bool, acc ); s->flags |= ACC_SET_OFFLINE_ONLY | SET_HIDDEN_DEFAULT; -- cgit v1.2.3 From a72dc2bb447e754295f8efc6f44fc6572f0f8511 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 19 Dec 2011 18:57:20 +0100 Subject: Add verify argument to ssl_connect() so HTTPS-based stuff is also secure. (Think of Twitter, but also MSN/Yahoo! authentication.) --- protocols/jabber/jabber.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols/jabber/jabber.c') diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index dd2f0866..372d73a9 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -235,7 +235,7 @@ static void jabber_login( account_t *acc ) non-standard ports... */ if( set_getbool( &acc->set, "ssl" ) ) { - jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), jabber_connected_ssl, ic ); + jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), FALSE, jabber_connected_ssl, ic ); jd->fd = jd->ssl ? ssl_getfd( jd->ssl ) : -1; } else -- cgit v1.2.3 From ad46e4d3ed1997e6b3f718a7a8be9a37eb63388d Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 22 Dec 2011 12:23:18 +0100 Subject: Use initgroups() as well when dropping privileges. Closes bug #852. --- protocols/jabber/jabber.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'protocols/jabber/jabber.c') diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 7d9547ab..fae55ffe 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -335,6 +335,25 @@ static int jabber_buddy_msg( struct im_connection *ic, char *who, char *message, if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) return jabber_write( ic, message, strlen( message ) ); + + if( g_strcasecmp( who, JABBER_MOCK_HANDLE ) == 0 ) + { + /* Parse. */ + if( xt_feed( jd->xt, message, strlen( message ) ) < 0 ) + { + imcb_error( ic, "XML stream error" ); + imc_logout( ic, TRUE ); + return FALSE; + } + + /* Execute all handlers. */ + if( !xt_handle( jd->xt, NULL, 1 ) ) + { + /* Don't do anything, the handlers should have + aborted the connection already. */ + return FALSE; + } + } if( ( s = strchr( who, '=' ) ) && jabber_chat_by_jid( ic, s + 1 ) ) bud = jabber_buddy_by_ext_jid( ic, who, 0 ); @@ -425,7 +444,13 @@ static void jabber_add_buddy( struct im_connection *ic, char *who, char *group ) if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) { jd->flags |= JFLAG_XMLCONSOLE; - imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL ); + imcb_add_buddy( ic, who, NULL ); + return; + } + else if( g_strcasecmp( who, JABBER_MOCK_HANDLE ) == 0 ) + { + jd->flags |= JFLAG_MOCK; + imcb_add_buddy( ic, who, NULL ); return; } @@ -447,6 +472,11 @@ static void jabber_remove_buddy( struct im_connection *ic, char *who, char *grou */ return; } + else if( g_strcasecmp( who, JABBER_MOCK_HANDLE ) == 0 ) + { + jd->flags &= ~JFLAG_MOCK; + return; + } /* We should always do this part. Clean up our administration a little bit. */ jabber_buddy_remove_bare( ic, who ); -- cgit v1.2.3 From 96f954df218e81f5580257c319b91217dac2f4bf Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 24 Dec 2011 18:49:12 +0100 Subject: Removing unfinished debugging stuff accidentally committed in changeset:devel,856. --- protocols/jabber/jabber.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'protocols/jabber/jabber.c') diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 2856f1b6..372d73a9 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -338,25 +338,6 @@ static int jabber_buddy_msg( struct im_connection *ic, char *who, char *message, if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) return jabber_write( ic, message, strlen( message ) ); - - if( g_strcasecmp( who, JABBER_MOCK_HANDLE ) == 0 ) - { - /* Parse. */ - if( xt_feed( jd->xt, message, strlen( message ) ) < 0 ) - { - imcb_error( ic, "XML stream error" ); - imc_logout( ic, TRUE ); - return FALSE; - } - - /* Execute all handlers. */ - if( !xt_handle( jd->xt, NULL, 1 ) ) - { - /* Don't do anything, the handlers should have - aborted the connection already. */ - return FALSE; - } - } if( ( s = strchr( who, '=' ) ) && jabber_chat_by_jid( ic, s + 1 ) ) bud = jabber_buddy_by_ext_jid( ic, who, 0 ); @@ -447,13 +428,7 @@ static void jabber_add_buddy( struct im_connection *ic, char *who, char *group ) if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) { jd->flags |= JFLAG_XMLCONSOLE; - imcb_add_buddy( ic, who, NULL ); - return; - } - else if( g_strcasecmp( who, JABBER_MOCK_HANDLE ) == 0 ) - { - jd->flags |= JFLAG_MOCK; - imcb_add_buddy( ic, who, NULL ); + imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL ); return; } @@ -475,11 +450,6 @@ static void jabber_remove_buddy( struct im_connection *ic, char *who, char *grou */ return; } - else if( g_strcasecmp( who, JABBER_MOCK_HANDLE ) == 0 ) - { - jd->flags &= ~JFLAG_MOCK; - return; - } /* We should always do this part. Clean up our administration a little bit. */ jabber_buddy_remove_bare( ic, who ); -- cgit v1.2.3