Changes in / [be999a5:237eadd]


Ignore:
Files:
2 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.h

    rbe999a5 r237eadd  
    142142#include "misc.h"
    143143#include "proxy.h"
    144 #include "otr.h"
    145144
    146145typedef struct global {
     
    154153        char *helpfile;
    155154        int restart;
    156         OtrlMessageAppOps otr_ops;   /* collects interface functions required by OTR */
    157155} global_t;
    158156
  • configure

    rbe999a5 r237eadd  
    3434gcov=0
    3535plugins=1
    36 otr=auto
    3736
    3837events=glib
     
    7877--gcov=0/1      Disable/enable test coverage reporting  $gcov
    7978--plugins=0/1   Disable/enable plugins support          $plugins
    80 --otr=0/1       Disable/enable OTR encryption support   $otr
    8179
    8280--events=...    Event handler (glib, libevent)          $events
     
    485483fi
    486484
    487 otrprefix=""
    488 for i in / /usr /usr/local; do
    489         if [ -f ${i}/lib/libotr.a ]; then
    490                 otrprefix=${i}
    491                 break
    492         fi
    493 done
    494 if [ "$otr" = "auto" ]; then
    495         if [ -n "$otrprefix" ]; then
    496                 otr=1
    497         else
    498                 otr=0
    499         fi
    500 fi
    501 if [ "$otr" = 1 ]; then
    502         echo '#define WITH_OTR' >> config.h
    503         echo "EFLAGS+=-L${otrprefix}/lib -lotr" >> Makefile.settings
    504         echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
    505 else
    506         echo '#undef WITH_OTR' >> config.h
    507 fi
    508 
    509485if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then
    510486        echo
     
    693669fi
    694670
    695 if [ "$otr" = "1" ]; then
    696         echo '  Off-the-Record (OTR) Messaging enabled.'
    697 else
    698         echo '  Off-the-Record (OTR) Messaging disabled.'
    699 fi
    700 
    701671echo '  Using event handler: '$events
    702672echo '  Using SSL library: '$ssl
  • doc/README

    rbe999a5 r237eadd  
    6666BitlBee's only real dependency is GLib. This is available on virtually every
    6767platform. Any recent version of GLib (2.4 or higher) will work.
    68 
    69 Off-the-Record encryption support will be included by default if the
    70 configure script finds libotr in one of the usual places. You can pass
    71 --otr=1 or --otr=0 to force it on or off, respectively.
    7268
    7369These days, MSN Messenger clients have to connect to the MS Passport servers
     
    149145
    150146
    151 A NOTE ON PASSWORD ENCRYPTION
    152 =============================
     147A NOTE ON ENCRYPTION
     148====================
    153149
    154150There used to be a note here about the simple obfuscation method used to
  • doc/user-guide/commands.xml

    rbe999a5 r237eadd  
    367367                </description>
    368368        </bitlbee-command>
    369        
    370         <bitlbee-command name="otr">
    371                 <short-description>Off-the-Record encryption control</short-description>
    372                 <syntax>otr &lt;subcommand&gt; [&lt;arguments&gt;]</syntax>
    373 
    374                 <description>
    375 
    376                         <para>
    377                                 Available subcommands: connect, disconnect, smp, trust, info, keygen, and forget. See <emphasis>help otr &lt;subcommand&gt;</emphasis> for more information.
    378                         </para>
    379 
    380                 </description>
    381                
    382                 <bitlbee-command name="connect">
    383                         <syntax>otr connect &lt;nick&gt;</syntax>
    384                        
    385                         <description>
    386                        
    387                                 <para>
    388                                         Attempts to establish an encrypted connection with the specified user by sending a magic string.
    389                                 </para>
    390                                
    391                         </description>
    392                
    393                 </bitlbee-command>
    394                
    395                 <bitlbee-command name="disconnect">
    396                         <syntax>otr disconnect &lt;nick&gt;</syntax>
    397                        
    398                         <description>
    399                        
    400                                 <para>
    401                                         Resets the connection with the specified user to cleartext.
    402                                 </para>
    403                                
    404                         </description>
    405                
    406                 </bitlbee-command>
    407                
    408                 <bitlbee-command name="smp">
    409                         <syntax>otr smp &lt;nick&gt; &lt;secret&gt;</syntax>
    410                        
    411                         <description>
    412                        
    413                                 <para>
    414                                         Attempts to authenticate the given user's active fingerprint via the Socialist Millionaires' Protocol.
    415                                 </para>
    416                                
    417                                 <para>
    418                                         If an SMP challenge has already been received from the given user, responds with the specified secret. Otherwise, a challenge for the secret will be sent. If the protocol succeeds (i.e. both parties gave the same secret), the fingerprint will be trusted.
    419                                 </para>
    420                                
    421                         </description>
    422                
    423                 </bitlbee-command>
    424                
    425                 <bitlbee-command name="trust">
    426                         <syntax>otr trust &lt;nick&gt; &lt;fp1&gt; &lt;fp2&gt; &lt;fp3&gt; &lt;fp4&gt; &lt;fp5&gt;</syntax>
    427                        
    428                         <description>
    429                        
    430                                 <para>
    431                                         Manually affirms trust in the specified fingerprint, given as five blocks of precisely eight (hexadecimal) digits each.
    432                                 </para>
    433                                
    434                         </description>
    435                
    436                 </bitlbee-command>
    437                
    438                 <bitlbee-command name="info">
    439                         <syntax>otr info</syntax>
    440                         <syntax>otr info &lt;nick&gt;</syntax>
    441                        
    442                         <description>
    443                        
    444                                 <para>
    445                                         Shows information about the OTR state. The first form lists our private keys and current OTR contexts. The second form displays information about the connection with a given user, including the list of their known fingerprints.
    446                                 </para>
    447                                
    448                         </description>
    449                
    450                 </bitlbee-command>
    451                
    452                 <bitlbee-command name="keygen">
    453                         <syntax>otr keygen &lt;account-no&gt;</syntax>
    454                        
    455                         <description>
    456                        
    457                                 <para>
    458                                         Generates a new OTR private key for the given account.
    459                                 </para>
    460                                
    461                         </description>
    462                
    463                 </bitlbee-command>
    464                
    465                 <bitlbee-command name="forget">
    466                         <syntax>otr forget &lt;thing&gt; &lt;arguments&gt;</syntax>
    467                        
    468                         <description>
    469                        
    470                                 <para>
    471                                         Forgets some part of our OTR userstate. Available things: fingerprint, context, and key. See <emphasis>help otr forget &lt;thing&gt;</emphasis> for more information.
    472                                 </para>
    473                        
    474                         </description>
    475                        
    476                         <bitlbee-command name="fingerprint">
    477                                 <syntax>otr forget fingerprint &lt;nick&gt; &lt;fingerprint&gt;</syntax>
    478                                
    479                                 <description>
    480                                
    481                                         <para>
    482                                                 Drops the specified fingerprint from the given user's OTR connection context. It is allowed to specify only a (unique) prefix of the desired fingerprint.
    483                                         </para>
    484                                        
    485                                 </description>
    486                                
    487                         </bitlbee-command>
    488                                
    489                         <bitlbee-command name="context">
    490                                 <syntax>otr forget context &lt;nick&gt;</syntax>
    491                                
    492                                 <description>
    493                                
    494                                         <para>
    495                                                 Forgets the entire OTR context associated with the given user. This includes current message and protocol states, as well as any fingerprints for that user.
    496                                         </para>
    497                                        
    498                                 </description>
    499                                
    500                         </bitlbee-command>
    501 
    502                         <bitlbee-command name="key">
    503                                 <syntax>otr forget key &lt;fingerprint&gt;</syntax>
    504                                
    505                                 <description>
    506                                
    507                                         <para>
    508                                                 Forgets an OTR private key matching the specified fingerprint. It is allowed to specify only a (unique) prefix of the fingerprint.
    509                                         </para>
    510                                        
    511                                 </description>
    512                                
    513                         </bitlbee-command>
    514                
    515                 </bitlbee-command>
    516                
    517         </bitlbee-command>
    518369
    519370        <bitlbee-command name="set">
     
    738589                </description>
    739590
    740         </bitlbee-setting>
    741 
    742         <bitlbee-setting name="color_encrypted" type="boolean" scope="global">
    743                 <default>true</default>
    744 
    745                 <description>
    746                         <para>
    747                                 If set to true, BitlBee will color incoming encrypted messages according to their fingerprint trust level: untrusted=red, trusted=green.
    748                         </para>
    749                 </description>
    750591        </bitlbee-setting>
    751592
     
    1086927        </bitlbee-setting>
    1087928
    1088         <bitlbee-setting name="otr_policy" type="string" scope="global">
    1089                 <default>opportunistic</default>
    1090                 <possible-values>never, opportunistic, manual, always</possible-values>
    1091 
    1092                 <description>
    1093                         <para>
    1094                                 This setting controls the policy for establishing Off-the-Record connections.
    1095                         </para>
    1096                         <para>
    1097                                 A value of "never" effectively disables the OTR subsystem. In "opportunistic" mode, a magic whitespace pattern will be appended to the first message sent to any user. If the peer is also running opportunistic OTR, an encrypted connection will be set up automatically. On "manual", on the other hand, OTR connections must be established explicitly using <emphasis>otr connect</emphasis>. Finally, the setting "always" enforces encrypted communication by causing BitlBee to refuse to send any cleartext messages at all.
    1098                         </para>
    1099                 </description>
    1100         </bitlbee-setting>
    1101 
    1102929        <bitlbee-setting name="password" type="string" scope="both">
    1103930                <description>
  • irc.h

    rbe999a5 r237eadd  
    2727#define _IRC_H
    2828
    29 #include "otr.h"
    30 
    3129#define IRC_MAX_LINE 512
    32 #define IRC_MAX_ARGS 16
     30#define IRC_MAX_ARGS 8
    3331
    3432#define IRC_LOGIN_TIMEOUT 60
     
    8785        gint ping_source_id;
    8886        gint login_source_id; /* To slightly delay some events at login time. */
    89        
    90         otr_t *otr;            /* OTR state and book keeping */
    9187       
    9288        struct bee *b;
  • lib/misc.c

    rbe999a5 r237eadd  
    157157        char *s = out, *cs;
    158158        int i, matched;
    159         int taglen;
    160159       
    161160        memset( out, 0, sizeof( out ) );
     
    174173                                in ++;
    175174                       
    176                         taglen = in - cs - 1;   /* not <0 because the above loop runs at least once */
    177175                        if( *in )
    178176                        {
    179                                 if( g_strncasecmp( cs+1, "b", taglen) == 0 )
    180                                         *(s++) = '\x02';
    181                                 else if( g_strncasecmp( cs+1, "/b", taglen) == 0 )
    182                                         *(s++) = '\x02';
    183                                 else if( g_strncasecmp( cs+1, "i", taglen) == 0 )
    184                                         *(s++) = '\x1f';
    185                                 else if( g_strncasecmp( cs+1, "/i", taglen) == 0 )
    186                                         *(s++) = '\x1f';
    187                                 else if( g_strncasecmp( cs+1, "br", taglen) == 0 )
     177                                if( g_strncasecmp( cs+1, "br", 2) == 0 )
    188178                                        *(s++) = '\n';
    189179                                in ++;
  • lib/ssl_bogus.c

    rbe999a5 r237eadd  
    2727
    2828int ssl_errno;
    29 
    30 void ssl_init( void )
    31 {
    32 }
    3329
    3430void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )
     
    7066        return 0;
    7167}
    72 
    73 int ssl_pending( void *conn )
    74 {
    75         return 0;
    76 }
  • lib/ssl_client.h

    rbe999a5 r237eadd  
    4747
    4848
    49 /* Perform any global initialization the SSL library might need. */
    50 G_MODULE_EXPORT void ssl_init( void );
    51 
    5249/* Connect to host:port, call the given function when the connection is
    5350   ready to be used for SSL traffic. This is all done asynchronously, no
  • lib/ssl_gnutls.c

    rbe999a5 r237eadd  
    6060static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond );
    6161
    62 
    63 void ssl_init( void )
    64 {
    65         gnutls_global_init();
    66         initialized = TRUE;
    67         atexit( gnutls_global_deinit );
    68 }
    6962
    7063void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )
     
    129122        if( !initialized )
    130123        {
    131                 ssl_init();
     124                gnutls_global_init();
     125                initialized = TRUE;
     126                atexit( gnutls_global_deinit );
    132127        }
    133128       
  • lib/ssl_nss.c

    rbe999a5 r237eadd  
    9191
    9292
    93 void ssl_init( void )
    94 {
    95         PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
    96         NSS_NoDB_Init(NULL);
    97         NSS_SetDomesticPolicy();
    98         initialized = TRUE;
    99 }
    100 
    10193void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )
    10294{
     
    115107        if( !initialized )
    116108        {
    117                 ssl_init();
     109                PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
     110                NSS_NoDB_Init(NULL);
     111                NSS_SetDomesticPolicy();
    118112        }
    119113
  • lib/ssl_openssl.c

    rbe999a5 r237eadd  
    5656static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond );
    5757
    58 
    59 void ssl_init( void )
    60 {
    61         initialized = TRUE;
    62         SSLeay_add_ssl_algorithms();
    63 }
    6458
    6559void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )
     
    121115        if( !initialized )
    122116        {
    123                 ssl_init();
     117                initialized = TRUE;
     118                SSLeay_add_ssl_algorithms();
    124119        }
    125120       
  • log.c

    rbe999a5 r237eadd  
    3030static log_t logoutput;
    3131
    32 static void log_null(int level, const char *logmessage);
    33 static void log_irc(int level, const char *logmessage);
    34 static void log_syslog(int level, const char *logmessage);
    35 static void log_console(int level, const char *logmessage);
     32static void log_null(int level, char *logmessage);
     33static void log_irc(int level, char *logmessage);
     34static void log_syslog(int level, char *logmessage);
     35static void log_console(int level, char *logmessage);
    3636
    3737void log_init(void) {
     
    9797}
    9898
    99 void log_message(int level, const char *message, ... ) {
     99void log_message(int level, char *message, ... ) {
    100100
    101101        va_list ap;
     
    122122}
    123123
    124 void log_error(const char *functionname) {
     124void log_error(char *functionname) {
    125125        log_message(LOGLVL_ERROR, "%s: %s", functionname, strerror(errno));
    126126       
     
    128128}
    129129
    130 static void log_null(int level, const char *message) {
     130static void log_null(int level, char *message) {
    131131        return;
    132132}
    133133
    134 static void log_irc(int level, const char *message) {
     134static void log_irc(int level, char *message) {
    135135        if(level == LOGLVL_ERROR)
    136136                irc_write_all(1, "ERROR :Error: %s", message);
     
    147147}
    148148
    149 static void log_syslog(int level, const char *message) {
     149static void log_syslog(int level, char *message) {
    150150        if(level == LOGLVL_ERROR)
    151151                syslog(LOG_ERR, "%s", message);
     
    161161}
    162162
    163 static void log_console(int level, const char *message) {
     163static void log_console(int level, char *message) {
    164164        if(level == LOGLVL_ERROR)
    165165                fprintf(stderr, "Error: %s\n", message);
  • log.h

    rbe999a5 r237eadd  
    4444
    4545typedef struct log_t {
    46         void (*error)(int level, const char *logmessage);
    47         void (*warning)(int level, const char *logmessage);
    48         void (*informational)(int level, const char *logmessage);
     46        void (*error)(int level, char *logmessage);
     47        void (*warning)(int level, char *logmessage);
     48        void (*informational)(int level, char *logmessage);
    4949#ifdef DEBUG
    50         void (*debug)(int level, const char *logmessage);
     50        void (*debug)(int level, char *logmessage);
    5151#endif
    5252} log_t;
     
    5454void log_init(void);
    5555void log_link(int level, int output);
    56 void log_message(int level, const char *message, ...) G_GNUC_PRINTF( 2, 3 );
    57 void log_error(const char *functionname);
     56void log_message(int level, char *message, ...) G_GNUC_PRINTF( 2, 3 );
     57void log_error(char *functionname);
    5858
    5959#endif
  • protocols/jabber/jabber.c

    rbe999a5 r237eadd  
    557557       
    558558        ret->name = "jabber";
    559     ret->mms = 0;                        /* no limit */
    560559        ret->login = jabber_login;
    561560        ret->init = jabber_init;
  • protocols/msn/msn.c

    rbe999a5 r237eadd  
    336336       
    337337        ret->name = "msn";
    338     ret->mms = 1409;         /* this guess taken from libotr UPGRADING file */
    339338        ret->login = msn_login;
    340339        ret->init = msn_init;
  • protocols/nogaim.h

    rbe999a5 r237eadd  
    6868#define OPT_TYPING      0x00000100 /* Some pieces of code make assumptions */
    6969#define OPT_THINKING    0x00000200 /* about these values... Stupid me! */
    70 #define OPT_NOOTR       0x00001000 /* protocol not suitable for OTR */
    7170
    7271/* ok. now the fun begins. first we create a connection structure */
     
    143142        const char *name;
    144143        void *data;
    145         /* Maximum Message Size of this protocol.
    146          * - Introduced for OTR, in order to fragment large protocol messages.
    147          * - 0 means "unlimited". */
    148         unsigned int mms;
    149144
    150145        /* Added this one to be able to add per-account settings, don't think
  • protocols/oscar/oscar.c

    rbe999a5 r237eadd  
    26042604        struct prpl *ret = g_new0(struct prpl, 1);
    26052605        ret->name = "oscar";
    2606     ret->mms = 2343;       /* this guess taken from libotr UPGRADING file */
    26072606        ret->away_states = oscar_away_states;
    26082607        ret->init = oscar_init;
  • protocols/twitter/twitter.c

    rbe999a5 r237eadd  
    519519        struct prpl *ret = g_new0(struct prpl, 1);
    520520       
    521         ret->options = OPT_NOOTR;
    522521        ret->name = "twitter";
    523522        ret->login = twitter_login;
  • protocols/yahoo/yahoo.c

    rbe999a5 r237eadd  
    379379        struct prpl *ret = g_new0(struct prpl, 1);
    380380        ret->name = "yahoo";
    381     ret->mms = 832;           /* this guess taken from libotr UPGRADING file */
    382381        ret->init = byahoo_init;
    383382       
  • query.c

    rbe999a5 r237eadd  
    106106        int count = 0;
    107107       
    108         if( !ic )
    109                 return;
    110        
    111108        q = irc->queries;
    112109        def = query_default( irc );
     
    151148                else
    152149                        irc_usermsg( irc, "Accepted: %s", q->question );
    153                 if( q->yes )
    154                         q->yes( q->data );
     150                q->yes( q->data );
    155151        }
    156152        else
     
    160156                else
    161157                        irc_usermsg( irc, "Rejected: %s", q->question );
    162                 if( q->no )
    163                         q->no( q->data );
     158                q->no( q->data );
    164159        }
    165160        q->data = NULL;
  • root_commands.c

    rbe999a5 r237eadd  
    2929#include "help.h"
    3030#include "ipc.h"
    31 #include "otr.h"
    3231
    3332void root_command_string( irc_t *irc, char *command )
     
    13401339        { "info",           1, cmd_info,           0 },
    13411340        { "no",             0, cmd_yesno,          0 },
    1342         { "otr",            1, cmd_otr,            0 },
    13431341        { "qlist",          0, cmd_qlist,          0 },
    13441342        { "register",       1, cmd_register,       0 },
  • storage.c

    rbe999a5 r237eadd  
    2828#define BITLBEE_CORE
    2929#include "bitlbee.h"
    30 #include "otr.h"
    3130
    3231extern storage_t storage_text;
     
    115114
    116115                status = st->load(irc, password);
    117                 if (status == STORAGE_OK) {
    118                         otr_load(irc);
     116                if (status == STORAGE_OK)
    119117                        return status;
    120                 }
     118               
    121119                if (status != STORAGE_NO_SUCH_USER)
    122120                        return status;
     
    139137                return STORAGE_NO_SUCH_USER;
    140138        }
    141 
    142         otr_save(irc);
     139       
    143140        st = ((storage_t *)global.storage->data)->save(irc, overwrite);
    144141       
     
    166163                        ret = status;
    167164        }
    168         if (ret == STORAGE_OK) {
    169                 otr_remove(nick);
    170         }
    171165       
    172166        return ret;
     
    182176        storage_t *primary_storage = gl->data;
    183177        irc_t *irc;
    184        
     178
    185179        /* First, try to rename in the current write backend, assuming onick
    186180         * is stored there */
    187181        status = primary_storage->rename(onick, nnick, password);
    188         if (status != STORAGE_NO_SUCH_USER) {
    189                 otr_rename(onick, nnick);
     182        if (status != STORAGE_NO_SUCH_USER)
    190183                return status;
    191         }
    192184
    193185        /* Try to load from a migration backend and save to the current backend.
     
    213205
    214206        storage_remove(onick, password);
    215         otr_rename(onick, nnick);
    216207
    217208        return STORAGE_OK;
  • unix.c

    rbe999a5 r237eadd  
    2929#include "base64.h"
    3030#include "commands.h"
    31 #include "otr.h"
    3231#include "protocols/nogaim.h"
    3332#include "help.h"
    3433#include "ipc.h"
    35 #include "lib/ssl_client.h"
    3634#include "md5.h"
    3735#include "misc.h"
     
    7068       
    7169        b_main_init();
    72        
    73         /* Ugly Note: libotr and gnutls both use libgcrypt. libgcrypt
    74            has a process-global config state whose initialization happpens
    75            twice if libotr and gnutls are used together. libotr installs custom
    76            memory management functions for libgcrypt while our gnutls module
    77            uses the defaults. Therefore we initialize OTR after SSL. *sigh* */
    78         ssl_init();
    79         otr_init();
    8070       
    8171        srand( time( NULL ) ^ getpid() );
Note: See TracChangeset for help on using the changeset viewer.