diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-09-22 14:04:35 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-09-22 14:04:35 +0200 |
commit | 59974884ba72d6e8fa008d07ee93bd228d30a99c (patch) | |
tree | 03ed914a6390a8e3e7fc48fcd6effd567a1ef390 /protocols/jabber/io.c | |
parent | deff0406d501264e1d91203ea8f91411a150e35f (diff) |
Basic SASL (PLAIN only ATM) authentication code. Doesn't log in completely
yet.
Diffstat (limited to 'protocols/jabber/io.c')
-rw-r--r-- | protocols/jabber/io.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c index b11ef17d..c7c1d8d9 100644 --- a/protocols/jabber/io.c +++ b/protocols/jabber/io.c @@ -135,6 +135,13 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition return FALSE; } + if( jd->flags & JFLAG_STREAM_RESTART ) + { + jd->flags &= ~JFLAG_STREAM_RESTART; + xt_reset( jd->xt ); + jabber_start_stream( gc ); + } + /* Garbage collection. */ xt_cleanup( jd->xt, NULL ); @@ -203,6 +210,10 @@ static const struct xt_handler_entry jabber_handlers[] = { { "iq", "stream:stream", jabber_pkt_iq }, { "message", "stream:stream", jabber_pkt_message }, { "presence", "stream:stream", jabber_pkt_presence }, + { "mechanisms", "stream:features", sasl_pkt_mechanisms }, + { "challenge", "stream:stream", sasl_pkt_challenge }, + { "success", "stream:stream", sasl_pkt_result }, + { "failure", "stream:stream", sasl_pkt_result }, { NULL, "stream:stream", jabber_pkt_misc }, { NULL, NULL, NULL } }; @@ -223,9 +234,7 @@ gboolean jabber_start_stream( struct gaim_connection *gc ) greet = g_strdup_printf( "<?xml version='1.0' ?>" "<stream:stream to=\"%s\" xmlns=\"jabber:client\" " - "xmlns:stream=\"http://etherx.jabber.org/streams\">", jd->server ); - /* Add this when TLS and SASL are supported? */ - // version=\"1.0\">" + "xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">", jd->server ); st = jabber_write( gc, greet, strlen( greet ) ); |