Changes in / [be999a5:237eadd]
- Files:
-
- 2 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.h
rbe999a5 r237eadd 142 142 #include "misc.h" 143 143 #include "proxy.h" 144 #include "otr.h"145 144 146 145 typedef struct global { … … 154 153 char *helpfile; 155 154 int restart; 156 OtrlMessageAppOps otr_ops; /* collects interface functions required by OTR */157 155 } global_t; 158 156 -
configure
rbe999a5 r237eadd 34 34 gcov=0 35 35 plugins=1 36 otr=auto37 36 38 37 events=glib … … 78 77 --gcov=0/1 Disable/enable test coverage reporting $gcov 79 78 --plugins=0/1 Disable/enable plugins support $plugins 80 --otr=0/1 Disable/enable OTR encryption support $otr81 79 82 80 --events=... Event handler (glib, libevent) $events … … 485 483 fi 486 484 487 otrprefix=""488 for i in / /usr /usr/local; do489 if [ -f ${i}/lib/libotr.a ]; then490 otrprefix=${i}491 break492 fi493 done494 if [ "$otr" = "auto" ]; then495 if [ -n "$otrprefix" ]; then496 otr=1497 else498 otr=0499 fi500 fi501 if [ "$otr" = 1 ]; then502 echo '#define WITH_OTR' >> config.h503 echo "EFLAGS+=-L${otrprefix}/lib -lotr" >> Makefile.settings504 echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings505 else506 echo '#undef WITH_OTR' >> config.h507 fi508 509 485 if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then 510 486 echo … … 693 669 fi 694 670 695 if [ "$otr" = "1" ]; then696 echo ' Off-the-Record (OTR) Messaging enabled.'697 else698 echo ' Off-the-Record (OTR) Messaging disabled.'699 fi700 701 671 echo ' Using event handler: '$events 702 672 echo ' Using SSL library: '$ssl -
doc/README
rbe999a5 r237eadd 66 66 BitlBee's only real dependency is GLib. This is available on virtually every 67 67 platform. Any recent version of GLib (2.4 or higher) will work. 68 69 Off-the-Record encryption support will be included by default if the70 configure script finds libotr in one of the usual places. You can pass71 --otr=1 or --otr=0 to force it on or off, respectively.72 68 73 69 These days, MSN Messenger clients have to connect to the MS Passport servers … … 149 145 150 146 151 A NOTE ON PASSWORDENCRYPTION152 ==================== =========147 A NOTE ON ENCRYPTION 148 ==================== 153 149 154 150 There used to be a note here about the simple obfuscation method used to -
doc/user-guide/commands.xml
rbe999a5 r237eadd 367 367 </description> 368 368 </bitlbee-command> 369 370 <bitlbee-command name="otr">371 <short-description>Off-the-Record encryption control</short-description>372 <syntax>otr <subcommand> [<arguments>]</syntax>373 374 <description>375 376 <para>377 Available subcommands: connect, disconnect, smp, trust, info, keygen, and forget. See <emphasis>help otr <subcommand></emphasis> for more information.378 </para>379 380 </description>381 382 <bitlbee-command name="connect">383 <syntax>otr connect <nick></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 <nick></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 <nick> <secret></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 <nick> <fp1> <fp2> <fp3> <fp4> <fp5></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 <nick></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 <account-no></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 <thing> <arguments></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 <thing></emphasis> for more information.472 </para>473 474 </description>475 476 <bitlbee-command name="fingerprint">477 <syntax>otr forget fingerprint <nick> <fingerprint></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 <nick></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 <fingerprint></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>518 369 519 370 <bitlbee-command name="set"> … … 738 589 </description> 739 590 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>750 591 </bitlbee-setting> 751 592 … … 1086 927 </bitlbee-setting> 1087 928 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 1102 929 <bitlbee-setting name="password" type="string" scope="both"> 1103 930 <description> -
irc.h
rbe999a5 r237eadd 27 27 #define _IRC_H 28 28 29 #include "otr.h"30 31 29 #define IRC_MAX_LINE 512 32 #define IRC_MAX_ARGS 1630 #define IRC_MAX_ARGS 8 33 31 34 32 #define IRC_LOGIN_TIMEOUT 60 … … 87 85 gint ping_source_id; 88 86 gint login_source_id; /* To slightly delay some events at login time. */ 89 90 otr_t *otr; /* OTR state and book keeping */91 87 92 88 struct bee *b; -
lib/misc.c
rbe999a5 r237eadd 157 157 char *s = out, *cs; 158 158 int i, matched; 159 int taglen;160 159 161 160 memset( out, 0, sizeof( out ) ); … … 174 173 in ++; 175 174 176 taglen = in - cs - 1; /* not <0 because the above loop runs at least once */177 175 if( *in ) 178 176 { 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 ) 188 178 *(s++) = '\n'; 189 179 in ++; -
lib/ssl_bogus.c
rbe999a5 r237eadd 27 27 28 28 int ssl_errno; 29 30 void ssl_init( void )31 {32 }33 29 34 30 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) … … 70 66 return 0; 71 67 } 72 73 int ssl_pending( void *conn )74 {75 return 0;76 } -
lib/ssl_client.h
rbe999a5 r237eadd 47 47 48 48 49 /* Perform any global initialization the SSL library might need. */50 G_MODULE_EXPORT void ssl_init( void );51 52 49 /* Connect to host:port, call the given function when the connection is 53 50 ready to be used for SSL traffic. This is all done asynchronously, no -
lib/ssl_gnutls.c
rbe999a5 r237eadd 60 60 static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond ); 61 61 62 63 void ssl_init( void )64 {65 gnutls_global_init();66 initialized = TRUE;67 atexit( gnutls_global_deinit );68 }69 62 70 63 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) … … 129 122 if( !initialized ) 130 123 { 131 ssl_init(); 124 gnutls_global_init(); 125 initialized = TRUE; 126 atexit( gnutls_global_deinit ); 132 127 } 133 128 -
lib/ssl_nss.c
rbe999a5 r237eadd 91 91 92 92 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 101 93 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) 102 94 { … … 115 107 if( !initialized ) 116 108 { 117 ssl_init(); 109 PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1); 110 NSS_NoDB_Init(NULL); 111 NSS_SetDomesticPolicy(); 118 112 } 119 113 -
lib/ssl_openssl.c
rbe999a5 r237eadd 56 56 static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond ); 57 57 58 59 void ssl_init( void )60 {61 initialized = TRUE;62 SSLeay_add_ssl_algorithms();63 }64 58 65 59 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) … … 121 115 if( !initialized ) 122 116 { 123 ssl_init(); 117 initialized = TRUE; 118 SSLeay_add_ssl_algorithms(); 124 119 } 125 120 -
log.c
rbe999a5 r237eadd 30 30 static log_t logoutput; 31 31 32 static void log_null(int level, c onst char *logmessage);33 static void log_irc(int level, c onst char *logmessage);34 static void log_syslog(int level, c onst char *logmessage);35 static void log_console(int level, c onst char *logmessage);32 static void log_null(int level, char *logmessage); 33 static void log_irc(int level, char *logmessage); 34 static void log_syslog(int level, char *logmessage); 35 static void log_console(int level, char *logmessage); 36 36 37 37 void log_init(void) { … … 97 97 } 98 98 99 void log_message(int level, c onst char *message, ... ) {99 void log_message(int level, char *message, ... ) { 100 100 101 101 va_list ap; … … 122 122 } 123 123 124 void log_error(c onst char *functionname) {124 void log_error(char *functionname) { 125 125 log_message(LOGLVL_ERROR, "%s: %s", functionname, strerror(errno)); 126 126 … … 128 128 } 129 129 130 static void log_null(int level, c onst char *message) {130 static void log_null(int level, char *message) { 131 131 return; 132 132 } 133 133 134 static void log_irc(int level, c onst char *message) {134 static void log_irc(int level, char *message) { 135 135 if(level == LOGLVL_ERROR) 136 136 irc_write_all(1, "ERROR :Error: %s", message); … … 147 147 } 148 148 149 static void log_syslog(int level, c onst char *message) {149 static void log_syslog(int level, char *message) { 150 150 if(level == LOGLVL_ERROR) 151 151 syslog(LOG_ERR, "%s", message); … … 161 161 } 162 162 163 static void log_console(int level, c onst char *message) {163 static void log_console(int level, char *message) { 164 164 if(level == LOGLVL_ERROR) 165 165 fprintf(stderr, "Error: %s\n", message); -
log.h
rbe999a5 r237eadd 44 44 45 45 typedef struct log_t { 46 void (*error)(int level, c onst char *logmessage);47 void (*warning)(int level, c onst char *logmessage);48 void (*informational)(int level, c onst char *logmessage);46 void (*error)(int level, char *logmessage); 47 void (*warning)(int level, char *logmessage); 48 void (*informational)(int level, char *logmessage); 49 49 #ifdef DEBUG 50 void (*debug)(int level, c onst char *logmessage);50 void (*debug)(int level, char *logmessage); 51 51 #endif 52 52 } log_t; … … 54 54 void log_init(void); 55 55 void log_link(int level, int output); 56 void log_message(int level, c onst char *message, ...) G_GNUC_PRINTF( 2, 3 );57 void log_error(c onst char *functionname);56 void log_message(int level, char *message, ...) G_GNUC_PRINTF( 2, 3 ); 57 void log_error(char *functionname); 58 58 59 59 #endif -
protocols/jabber/jabber.c
rbe999a5 r237eadd 557 557 558 558 ret->name = "jabber"; 559 ret->mms = 0; /* no limit */560 559 ret->login = jabber_login; 561 560 ret->init = jabber_init; -
protocols/msn/msn.c
rbe999a5 r237eadd 336 336 337 337 ret->name = "msn"; 338 ret->mms = 1409; /* this guess taken from libotr UPGRADING file */339 338 ret->login = msn_login; 340 339 ret->init = msn_init; -
protocols/nogaim.h
rbe999a5 r237eadd 68 68 #define OPT_TYPING 0x00000100 /* Some pieces of code make assumptions */ 69 69 #define OPT_THINKING 0x00000200 /* about these values... Stupid me! */ 70 #define OPT_NOOTR 0x00001000 /* protocol not suitable for OTR */71 70 72 71 /* ok. now the fun begins. first we create a connection structure */ … … 143 142 const char *name; 144 143 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;149 144 150 145 /* Added this one to be able to add per-account settings, don't think -
protocols/oscar/oscar.c
rbe999a5 r237eadd 2604 2604 struct prpl *ret = g_new0(struct prpl, 1); 2605 2605 ret->name = "oscar"; 2606 ret->mms = 2343; /* this guess taken from libotr UPGRADING file */2607 2606 ret->away_states = oscar_away_states; 2608 2607 ret->init = oscar_init; -
protocols/twitter/twitter.c
rbe999a5 r237eadd 519 519 struct prpl *ret = g_new0(struct prpl, 1); 520 520 521 ret->options = OPT_NOOTR;522 521 ret->name = "twitter"; 523 522 ret->login = twitter_login; -
protocols/yahoo/yahoo.c
rbe999a5 r237eadd 379 379 struct prpl *ret = g_new0(struct prpl, 1); 380 380 ret->name = "yahoo"; 381 ret->mms = 832; /* this guess taken from libotr UPGRADING file */382 381 ret->init = byahoo_init; 383 382 -
query.c
rbe999a5 r237eadd 106 106 int count = 0; 107 107 108 if( !ic )109 return;110 111 108 q = irc->queries; 112 109 def = query_default( irc ); … … 151 148 else 152 149 irc_usermsg( irc, "Accepted: %s", q->question ); 153 if( q->yes ) 154 q->yes( q->data ); 150 q->yes( q->data ); 155 151 } 156 152 else … … 160 156 else 161 157 irc_usermsg( irc, "Rejected: %s", q->question ); 162 if( q->no ) 163 q->no( q->data ); 158 q->no( q->data ); 164 159 } 165 160 q->data = NULL; -
root_commands.c
rbe999a5 r237eadd 29 29 #include "help.h" 30 30 #include "ipc.h" 31 #include "otr.h"32 31 33 32 void root_command_string( irc_t *irc, char *command ) … … 1340 1339 { "info", 1, cmd_info, 0 }, 1341 1340 { "no", 0, cmd_yesno, 0 }, 1342 { "otr", 1, cmd_otr, 0 },1343 1341 { "qlist", 0, cmd_qlist, 0 }, 1344 1342 { "register", 1, cmd_register, 0 }, -
storage.c
rbe999a5 r237eadd 28 28 #define BITLBEE_CORE 29 29 #include "bitlbee.h" 30 #include "otr.h"31 30 32 31 extern storage_t storage_text; … … 115 114 116 115 status = st->load(irc, password); 117 if (status == STORAGE_OK) { 118 otr_load(irc); 116 if (status == STORAGE_OK) 119 117 return status; 120 }118 121 119 if (status != STORAGE_NO_SUCH_USER) 122 120 return status; … … 139 137 return STORAGE_NO_SUCH_USER; 140 138 } 141 142 otr_save(irc); 139 143 140 st = ((storage_t *)global.storage->data)->save(irc, overwrite); 144 141 … … 166 163 ret = status; 167 164 } 168 if (ret == STORAGE_OK) {169 otr_remove(nick);170 }171 165 172 166 return ret; … … 182 176 storage_t *primary_storage = gl->data; 183 177 irc_t *irc; 184 178 185 179 /* First, try to rename in the current write backend, assuming onick 186 180 * is stored there */ 187 181 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) 190 183 return status; 191 }192 184 193 185 /* Try to load from a migration backend and save to the current backend. … … 213 205 214 206 storage_remove(onick, password); 215 otr_rename(onick, nnick);216 207 217 208 return STORAGE_OK; -
unix.c
rbe999a5 r237eadd 29 29 #include "base64.h" 30 30 #include "commands.h" 31 #include "otr.h"32 31 #include "protocols/nogaim.h" 33 32 #include "help.h" 34 33 #include "ipc.h" 35 #include "lib/ssl_client.h"36 34 #include "md5.h" 37 35 #include "misc.h" … … 70 68 71 69 b_main_init(); 72 73 /* Ugly Note: libotr and gnutls both use libgcrypt. libgcrypt74 has a process-global config state whose initialization happpens75 twice if libotr and gnutls are used together. libotr installs custom76 memory management functions for libgcrypt while our gnutls module77 uses the defaults. Therefore we initialize OTR after SSL. *sigh* */78 ssl_init();79 otr_init();80 70 81 71 srand( time( NULL ) ^ getpid() );
Note: See TracChangeset
for help on using the changeset viewer.