Changeset 164352e for protocols


Ignore:
Timestamp:
2011-12-24T18:02:39Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
34ded90
Parents:
e306fbf (diff), 96f954d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging mainline.

Location:
protocols
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • protocols/bee.h

    re306fbf r164352e  
    123123        gboolean (*chat_add_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu );
    124124        gboolean (*chat_remove_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu );
    125         gboolean (*chat_topic)( bee_t *bee, struct groupchat *c, const char *new, bee_user_t *bu );
     125        gboolean (*chat_topic)( bee_t *bee, struct groupchat *c, const char *new_topic, bee_user_t *bu );
    126126        gboolean (*chat_name_hint)( bee_t *bee, struct groupchat *c, const char *name );
    127127        gboolean (*chat_invite)( bee_t *bee, bee_user_t *bu, const char *name, const char *msg );
  • protocols/jabber/io.c

    re306fbf r164352e  
    276276}
    277277
    278 gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition cond )
     278gboolean jabber_connected_ssl( gpointer data, int returncode, void *source, b_input_condition cond )
    279279{
    280280        struct im_connection *ic = data;
     
    292292                jd->ssl = NULL;
    293293               
    294                 imcb_error( ic, "Could not connect to server" );
    295                 imc_logout( ic, TRUE );
     294                if( returncode != 0 )
     295                {
     296                        char *err = ssl_verify_strerror( returncode );
     297                        imcb_error( ic, "Certificate verification problem 0x%x: %s",
     298                                    returncode, err ? err : "Unknown" );
     299                        g_free( err );
     300                        imc_logout( ic, FALSE );
     301                }
     302                else
     303                {
     304                        imcb_error( ic, "Could not connect to server" );
     305                        imc_logout( ic, TRUE );
     306                }
     307               
    296308                return FALSE;
    297309        }
     
    397409        struct im_connection *ic = data;
    398410        struct jabber_data *jd = ic->proto_data;
    399         char *xmlns;
     411        char *xmlns, *tlsname;
    400412       
    401413        xmlns = xt_find_attr( node, "xmlns" );
     
    423435       
    424436        jd->flags |= JFLAG_STARTTLS_DONE;
    425         jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic );
     437
     438        /* If the user specified a server for the account, use this server as the
     439         * hostname in the certificate verification. Else we use the domain from
     440         * the username. */
     441        if( ic->acc->server && *ic->acc->server )
     442                tlsname = ic->acc->server;
     443        else
     444                tlsname = jd->server;
     445       
     446        jd->ssl = ssl_starttls( jd->fd, tlsname, set_getbool( &ic->acc->set, "tls_verify" ),
     447                                jabber_connected_ssl, ic );
    426448       
    427449        return XT_HANDLED;
  • protocols/jabber/jabber.c

    re306fbf r164352e  
    8787        s = set_add( &acc->set, "tls", "try", set_eval_tls, acc );
    8888        s->flags |= ACC_SET_OFFLINE_ONLY;
    89 
     89       
     90        s = set_add( &acc->set, "tls_verify", "true", set_eval_bool, acc );
     91        s->flags |= ACC_SET_OFFLINE_ONLY;
     92       
    9093        s = set_add( &acc->set, "user_agent", "BitlBee", NULL, acc );
    9194       
     
    228231        if( set_getbool( &acc->set, "ssl" ) )
    229232        {
    230                 jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), jabber_connected_ssl, ic );
     233                jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), FALSE, jabber_connected_ssl, ic );
    231234                jd->fd = jd->ssl ? ssl_getfd( jd->ssl ) : -1;
    232235        }
  • protocols/jabber/jabber.h

    re306fbf r164352e  
    317317int jabber_write( struct im_connection *ic, char *buf, int len );
    318318gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond );
    319 gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition cond );
     319gboolean jabber_connected_ssl( gpointer data, int returncode, void *source, b_input_condition cond );
    320320gboolean jabber_start_stream( struct im_connection *ic );
    321321void jabber_end_stream( struct im_connection *ic );
  • protocols/msn/soap.c

    re306fbf r164352e  
    6060        struct im_connection *ic;
    6161        int ttl;
     62        char *error;
    6263       
    6364        char *url, *action, *payload;
     
    158159        }
    159160       
     161        if( http_req->status_code != 200 )
     162                soap_req->error = g_strdup( http_req->status_string );
     163       
    160164        st = soap_req->handle_response( soap_req );
    161165
     
    164168        g_free( soap_req->action );
    165169        g_free( soap_req->payload );
    166         soap_req->url = soap_req->action = soap_req->payload = NULL;
     170        g_free( soap_req->error );
     171        soap_req->url = soap_req->action = soap_req->payload = soap_req->error = NULL;
    167172       
    168173        if( st == MSN_SOAP_RETRY && --soap_req->ttl )
     
    253258        g_free( soap_req->action );
    254259        g_free( soap_req->payload );
     260        g_free( soap_req->error );
    255261        g_free( soap_req );
    256262}
     
    410416        if( sd->secret == NULL )
    411417        {
    412                 msn_auth_got_passport_token( ic, NULL, sd->error );
     418                msn_auth_got_passport_token( ic, NULL, sd->error ? sd->error : soap_req->error );
    413419                return MSN_SOAP_OK;
    414420        }
  • protocols/skype/skype.c

    re306fbf r164352e  
    11571157}
    11581158
    1159 gboolean skype_connected(gpointer data, void *source, b_input_condition cond)
     1159gboolean skype_connected(gpointer data, int returncode, void *source, b_input_condition cond)
    11601160{
    11611161        struct im_connection *ic = data;
     
    11851185        imcb_log(ic, "Connecting");
    11861186        sd->ssl = ssl_connect(set_getstr(&acc->set, "server"),
    1187                 set_getint(&acc->set, "port"), skype_connected, ic);
     1187                set_getint(&acc->set, "port"), FALSE, skype_connected, ic);
    11881188        sd->fd = sd->ssl ? ssl_getfd(sd->ssl) : -1;
    11891189        sd->username = g_strdup(acc->user);
Note: See TracChangeset for help on using the changeset viewer.