Changeset 5997488


Ignore:
Timestamp:
2006-09-22T12:04:35Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
8d74291
Parents:
deff040
Message:

Basic SASL (PLAIN only ATM) authentication code. Doesn't log in completely
yet.

Location:
protocols/jabber
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/Makefile

    rdeff040 r5997488  
    1010
    1111# [SH] Program variables
    12 objects = io.o iq.o jabber.o jabber_util.o message.o presence.o xmltree.o
     12objects = io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o xmltree.o
    1313
    1414CFLAGS += -Wall
  • protocols/jabber/io.c

    rdeff040 r5997488  
    134134                           aborted the connection already... Or not? FIXME */
    135135                        return FALSE;
     136                }
     137               
     138                if( jd->flags & JFLAG_STREAM_RESTART )
     139                {
     140                        jd->flags &= ~JFLAG_STREAM_RESTART;
     141                        xt_reset( jd->xt );
     142                        jabber_start_stream( gc );
    136143                }
    137144               
     
    204211        { "message",            "stream:stream",        jabber_pkt_message },
    205212        { "presence",           "stream:stream",        jabber_pkt_presence },
     213        { "mechanisms",         "stream:features",      sasl_pkt_mechanisms },
     214        { "challenge",          "stream:stream",        sasl_pkt_challenge },
     215        { "success",            "stream:stream",        sasl_pkt_result },
     216        { "failure",            "stream:stream",        sasl_pkt_result },
    206217        { NULL,                 "stream:stream",        jabber_pkt_misc },
    207218        { NULL,                 NULL,                   NULL }
     
    224235        greet = g_strdup_printf( "<?xml version='1.0' ?>"
    225236                                 "<stream:stream to=\"%s\" xmlns=\"jabber:client\" "
    226                                   "xmlns:stream=\"http://etherx.jabber.org/streams\">", jd->server );
    227         /* Add this when TLS and SASL are supported? */
    228         // version=\"1.0\">"
     237                                  "xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">", jd->server );
    229238       
    230239        st = jabber_write( gc, greet, strlen( greet ) );
  • protocols/jabber/jabber.h

    rdeff040 r5997488  
    3232typedef enum
    3333{
    34         JFLAG_STREAM_STARTED = 1,
    35         JFLAG_AUTHENTICATED = 2,
     34        JFLAG_STREAM_STARTED = 1,       /* Set when we detected the beginning of the stream and want to do auth. */
     35        JFLAG_AUTHENTICATED = 2,        /* Set when we're successfully authenticatd. */
     36        JFLAG_STREAM_RESTART = 4,       /* Set when we want to restart the stream (after SASL or TLS). */
     37        JFLAG_SUPPORTS_TLS = 8,         /* Set when there's <starttls/> in <stream:features>. */
    3638} jabber_flags_t;
    3739
     
    6062void jabber_end_stream( struct gaim_connection *gc );
    6163
     64/* sasl.c */
     65xt_status sasl_pkt_mechanisms( struct xt_node *node, gpointer data );
     66xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data );
     67xt_status sasl_pkt_result( struct xt_node *node, gpointer data );
     68
    6269struct jabber_data
    6370{
Note: See TracChangeset for help on using the changeset viewer.