Changeset be999a5
- Timestamp:
- 2010-08-23T23:12:24Z (14 years ago)
- Branches:
- master
- Children:
- ad2d8bc
- Parents:
- 237eadd (diff), eb6df6a (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. - Files:
-
- 2 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.h
r237eadd rbe999a5 142 142 #include "misc.h" 143 143 #include "proxy.h" 144 #include "otr.h" 144 145 145 146 typedef struct global { … … 153 154 char *helpfile; 154 155 int restart; 156 OtrlMessageAppOps otr_ops; /* collects interface functions required by OTR */ 155 157 } global_t; 156 158 -
configure
r237eadd rbe999a5 34 34 gcov=0 35 35 plugins=1 36 otr=auto 36 37 37 38 events=glib … … 77 78 --gcov=0/1 Disable/enable test coverage reporting $gcov 78 79 --plugins=0/1 Disable/enable plugins support $plugins 80 --otr=0/1 Disable/enable OTR encryption support $otr 79 81 80 82 --events=... Event handler (glib, libevent) $events … … 483 485 fi 484 486 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 485 509 if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then 486 510 echo … … 669 693 fi 670 694 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 671 701 echo ' Using event handler: '$events 672 702 echo ' Using SSL library: '$ssl -
doc/README
r237eadd rbe999a5 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 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. 68 72 69 73 These days, MSN Messenger clients have to connect to the MS Passport servers … … 145 149 146 150 147 A NOTE ON ENCRYPTION148 ==================== 151 A NOTE ON PASSWORD ENCRYPTION 152 ============================= 149 153 150 154 There used to be a note here about the simple obfuscation method used to -
doc/user-guide/commands.xml
r237eadd rbe999a5 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> 369 518 370 519 <bitlbee-command name="set"> … … 589 738 </description> 590 739 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> 591 750 </bitlbee-setting> 592 751 … … 927 1086 </bitlbee-setting> 928 1087 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 929 1102 <bitlbee-setting name="password" type="string" scope="both"> 930 1103 <description> -
irc.h
r237eadd rbe999a5 27 27 #define _IRC_H 28 28 29 #include "otr.h" 30 29 31 #define IRC_MAX_LINE 512 30 #define IRC_MAX_ARGS 832 #define IRC_MAX_ARGS 16 31 33 32 34 #define IRC_LOGIN_TIMEOUT 60 … … 85 87 gint ping_source_id; 86 88 gint login_source_id; /* To slightly delay some events at login time. */ 89 90 otr_t *otr; /* OTR state and book keeping */ 87 91 88 92 struct bee *b; -
lib/misc.c
r237eadd rbe999a5 157 157 char *s = out, *cs; 158 158 int i, matched; 159 int taglen; 159 160 160 161 memset( out, 0, sizeof( out ) ); … … 173 174 in ++; 174 175 176 taglen = in - cs - 1; /* not <0 because the above loop runs at least once */ 175 177 if( *in ) 176 178 { 177 if( g_strncasecmp( cs+1, "br", 2) == 0 ) 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 ) 178 188 *(s++) = '\n'; 179 189 in ++; -
lib/ssl_bogus.c
r237eadd rbe999a5 27 27 28 28 int ssl_errno; 29 30 void ssl_init( void ) 31 { 32 } 29 33 30 34 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) … … 66 70 return 0; 67 71 } 72 73 int ssl_pending( void *conn ) 74 { 75 return 0; 76 } -
lib/ssl_client.h
r237eadd rbe999a5 47 47 48 48 49 /* Perform any global initialization the SSL library might need. */ 50 G_MODULE_EXPORT void ssl_init( void ); 51 49 52 /* Connect to host:port, call the given function when the connection is 50 53 ready to be used for SSL traffic. This is all done asynchronously, no -
lib/ssl_gnutls.c
r237eadd rbe999a5 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 } 62 69 63 70 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) … … 122 129 if( !initialized ) 123 130 { 124 gnutls_global_init(); 125 initialized = TRUE; 126 atexit( gnutls_global_deinit ); 131 ssl_init(); 127 132 } 128 133 -
lib/ssl_nss.c
r237eadd rbe999a5 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 93 101 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) 94 102 { … … 107 115 if( !initialized ) 108 116 { 109 PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1); 110 NSS_NoDB_Init(NULL); 111 NSS_SetDomesticPolicy(); 117 ssl_init(); 112 118 } 113 119 -
lib/ssl_openssl.c
r237eadd rbe999a5 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 } 58 64 59 65 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data ) … … 115 121 if( !initialized ) 116 122 { 117 initialized = TRUE; 118 SSLeay_add_ssl_algorithms(); 123 ssl_init(); 119 124 } 120 125 -
log.c
r237eadd rbe999a5 30 30 static log_t logoutput; 31 31 32 static void log_null(int level, c har *logmessage);33 static void log_irc(int level, c har *logmessage);34 static void log_syslog(int level, c har *logmessage);35 static void log_console(int level, c har *logmessage);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); 36 36 37 37 void log_init(void) { … … 97 97 } 98 98 99 void log_message(int level, c har *message, ... ) {99 void log_message(int level, const char *message, ... ) { 100 100 101 101 va_list ap; … … 122 122 } 123 123 124 void log_error(c har *functionname) {124 void log_error(const 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 har *message) {130 static void log_null(int level, const char *message) { 131 131 return; 132 132 } 133 133 134 static void log_irc(int level, c har *message) {134 static void log_irc(int level, const 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 har *message) {149 static void log_syslog(int level, const 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 har *message) {163 static void log_console(int level, const char *message) { 164 164 if(level == LOGLVL_ERROR) 165 165 fprintf(stderr, "Error: %s\n", message); -
log.h
r237eadd rbe999a5 44 44 45 45 typedef struct log_t { 46 void (*error)(int level, c har *logmessage);47 void (*warning)(int level, c har *logmessage);48 void (*informational)(int level, c har *logmessage);46 void (*error)(int level, const char *logmessage); 47 void (*warning)(int level, const char *logmessage); 48 void (*informational)(int level, const char *logmessage); 49 49 #ifdef DEBUG 50 void (*debug)(int level, c har *logmessage);50 void (*debug)(int level, const 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 har *message, ...) G_GNUC_PRINTF( 2, 3 );57 void log_error(c har *functionname);56 void log_message(int level, const char *message, ...) G_GNUC_PRINTF( 2, 3 ); 57 void log_error(const char *functionname); 58 58 59 59 #endif -
protocols/jabber/jabber.c
r237eadd rbe999a5 557 557 558 558 ret->name = "jabber"; 559 ret->mms = 0; /* no limit */ 559 560 ret->login = jabber_login; 560 561 ret->init = jabber_init; -
protocols/msn/msn.c
r237eadd rbe999a5 336 336 337 337 ret->name = "msn"; 338 ret->mms = 1409; /* this guess taken from libotr UPGRADING file */ 338 339 ret->login = msn_login; 339 340 ret->init = msn_init; -
protocols/nogaim.h
r237eadd rbe999a5 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 */ 70 71 71 72 /* ok. now the fun begins. first we create a connection structure */ … … 142 143 const char *name; 143 144 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; 144 149 145 150 /* Added this one to be able to add per-account settings, don't think -
protocols/oscar/oscar.c
r237eadd rbe999a5 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 */ 2606 2607 ret->away_states = oscar_away_states; 2607 2608 ret->init = oscar_init; -
protocols/twitter/twitter.c
r237eadd rbe999a5 519 519 struct prpl *ret = g_new0(struct prpl, 1); 520 520 521 ret->options = OPT_NOOTR; 521 522 ret->name = "twitter"; 522 523 ret->login = twitter_login; -
protocols/yahoo/yahoo.c
r237eadd rbe999a5 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 */ 381 382 ret->init = byahoo_init; 382 383 -
query.c
r237eadd rbe999a5 106 106 int count = 0; 107 107 108 if( !ic ) 109 return; 110 108 111 q = irc->queries; 109 112 def = query_default( irc ); … … 148 151 else 149 152 irc_usermsg( irc, "Accepted: %s", q->question ); 150 q->yes( q->data ); 153 if( q->yes ) 154 q->yes( q->data ); 151 155 } 152 156 else … … 156 160 else 157 161 irc_usermsg( irc, "Rejected: %s", q->question ); 158 q->no( q->data ); 162 if( q->no ) 163 q->no( q->data ); 159 164 } 160 165 q->data = NULL; -
root_commands.c
r237eadd rbe999a5 29 29 #include "help.h" 30 30 #include "ipc.h" 31 #include "otr.h" 31 32 32 33 void root_command_string( irc_t *irc, char *command ) … … 1339 1340 { "info", 1, cmd_info, 0 }, 1340 1341 { "no", 0, cmd_yesno, 0 }, 1342 { "otr", 1, cmd_otr, 0 }, 1341 1343 { "qlist", 0, cmd_qlist, 0 }, 1342 1344 { "register", 1, cmd_register, 0 }, -
storage.c
r237eadd rbe999a5 28 28 #define BITLBEE_CORE 29 29 #include "bitlbee.h" 30 #include "otr.h" 30 31 31 32 extern storage_t storage_text; … … 114 115 115 116 status = st->load(irc, password); 116 if (status == STORAGE_OK) 117 if (status == STORAGE_OK) { 118 otr_load(irc); 117 119 return status; 118 120 } 119 121 if (status != STORAGE_NO_SUCH_USER) 120 122 return status; … … 137 139 return STORAGE_NO_SUCH_USER; 138 140 } 139 141 142 otr_save(irc); 140 143 st = ((storage_t *)global.storage->data)->save(irc, overwrite); 141 144 … … 163 166 ret = status; 164 167 } 168 if (ret == STORAGE_OK) { 169 otr_remove(nick); 170 } 165 171 166 172 return ret; … … 176 182 storage_t *primary_storage = gl->data; 177 183 irc_t *irc; 178 184 179 185 /* First, try to rename in the current write backend, assuming onick 180 186 * is stored there */ 181 187 status = primary_storage->rename(onick, nnick, password); 182 if (status != STORAGE_NO_SUCH_USER) 188 if (status != STORAGE_NO_SUCH_USER) { 189 otr_rename(onick, nnick); 183 190 return status; 191 } 184 192 185 193 /* Try to load from a migration backend and save to the current backend. … … 205 213 206 214 storage_remove(onick, password); 215 otr_rename(onick, nnick); 207 216 208 217 return STORAGE_OK; -
unix.c
r237eadd rbe999a5 29 29 #include "base64.h" 30 30 #include "commands.h" 31 #include "otr.h" 31 32 #include "protocols/nogaim.h" 32 33 #include "help.h" 33 34 #include "ipc.h" 35 #include "lib/ssl_client.h" 34 36 #include "md5.h" 35 37 #include "misc.h" … … 68 70 69 71 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(); 70 80 71 81 srand( time( NULL ) ^ getpid() );
Note: See TracChangeset
for help on using the changeset viewer.