aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeLines
* Merge branch 'master' into patched-masterHEADpatched-masterMarius Halden2018-05-31-9/+15
|\
| * Openssl 1.1 supportEneas U de Queiroz2018-05-24-9/+15
| | | | | | | | | | | | This adds openssl 1.1.0 support. Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
* | Merge branch 'master' into patched-masterMarius Halden2017-04-07-52/+188
|\|
| * Merge branch 'develop'dequis2017-04-06-2/+2
| |\
| | * Add --verbose configure option to control verbose build outputTim Harder2017-03-12-2/+2
| | | | | | | | | | | | Defaults to disabled to maintain the status quo.
| * | Move canohost functions (diff licence) to separate file.Wilmer van der Gaast2017-04-06-106/+185
| | |
| * | Remove ip6_*wrap() functions which are no longer needed.Wilmer van der Gaast2017-04-06-48/+0
| | |
| * | Add reverse_lookup() function which does a more proper (verified) DNSWilmer van der Gaast2017-04-06-0/+105
| |/ | | | | | | | | reverse lookup. (Code copied from OpenSSH instead of redoing it poorly.)
* | Merge branch 'master' into patched-masterMarius Halden2017-01-01-18/+8
|\|
| * Use NI_MAXHOST rather than HOST_NAME_MAX for host lengths.Jelmer Vernooij2016-12-31-18/+8
| | | | | | | | | | | | | | This constant is always available and meant to be used with getnameinfo(). This fixes the build on Debian GNU/kFreeBSD.
* | Merge branch 'master' into patched-masterMarius Halden2016-12-27-1/+1
|\|
| * Fix some clang static analyzer warningsdequis2016-12-26-1/+1
| | | | | | | | Nothing interesting.
* | Merge branch 'master' into patched-masterMarius Halden2016-11-12-3/+9
|\|
| * word_wrap: truncate utf8 safelydequis2016-11-12-3/+9
| |
* | Merge branch 'master' into patched-masterMarius Halden2016-10-17-15/+62
|\|
| * misc: Add str_pad_and_truncate() helper functiondequis2016-10-17-0/+27
| | | | | | | | Useful for tables. See following commit.
| * lib/sha1: Refactor sha1_hmac into a generic b_hmac functiondequis2016-10-16-15/+35
| |
* | Merge branch 'master' into patched-masterMarius Halden2016-10-03-1/+2
|\|
| * ssl_openssl: Allow TLS versions newer than 1.0dequis2016-09-29-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Another victim of SSLv23_client_method's terrible name. At least we weren't forcing ssl 3.0. Thanks kl3 for pointing this out. Despite what this commit might suggest, using openssl is not recommended at all. Potential GPL incompatibility aside, that module doesn't have certificate verification code. Don't use it unless you have a good reason to do so.
* | Merge branch 'master' into patched-masterMarius Halden2016-05-20-1/+1
|\|
| * Remove the ARCH / CPU defines.Jelmer Vernooij2016-05-15-1/+1
| | | | | | | | | | | | | | These only reflect on what arch/cpu bitlbee was built, not on which it is running. This makes the Debian package unreproducible. See e.g. https://tests.reproducible-builds.org/rb-pkg/testing/i386/bitlbee.html
* | more sslMarius Halden2016-05-07-5/+46
| |
* | Start adding ssl supportMarius Halden2016-05-07-0/+38
|/
* ssl_gnutls: Replace GNUTLS_STUPID_CAST with (long)dequis2016-04-30-7/+1
| | | | | | | | That's what the gnutls code itself uses, in all platforms. There's a newer method that does this in a cleaner way, but it's not supported in all the gnutls versions that bitlbee works with, so this is simpler.
* Fix a double free when calling proxy_disconnect() inside phb->func()dequis2016-02-18-8/+23
| | | | | | | | | | | | | | | | Fixes trac ticket #1248 proxy_connected() calls phb->func(), then tries to do phb_free() directly afterwards, but that might have been freed by a proxy_disconnect() call during the execution of that callback. This one happened to several different people because some AIM server broke recently. This commit fixes it by implementing a phb_connected() function that removes the PHB from the hash table before calling phb->func(), which ensures that any proxy_disconnect() calls just close the fd and nothing else.
* ini: Null check file parameter before passing it to open()dequis2015-12-17-2/+2
| | | | | The test suite does this. It's harmless in practice but open() is declared as nonnull. Thanks to clang's ubsan.
* proxy: fix validation of the proxytype valuedequis2015-12-09-1/+1
| | | | | | Coverity says it could be an out of bounds read, but the value is set internally, so not really. Still, good point about the condition being wrong.
* misc.c: Add a str_reject_chars function, use it in otr_filter_colorsdequis2015-11-27-0/+17
|
* Use proxy_disconnect() in http, ssl, jabber, oscardequis2015-10-26-6/+8
| | | | | | | | | | Twitter and MSN are all HTTP/SSL, so they don't need it either. The out of tree facebook and steam plugins are also covered by the HTTP/SSL changes. Yahoo is written in a weird way and doesn't seem to need it (it seems it doesn't immediately stop connections when you tell it to logout)
* Add proxy_disconnect() to interrupt possibly pending connectionsdequis2015-10-26-1/+40
| | | | | | | | | | | Fixes trac ticket 1198, https://bugs.bitlbee.org/bitlbee/ticket/1198 This function can be used as a safe drop-in replacement to closesocket() If a proxy connection is pending (connected callback still not called), it looks up the PHB in a hash table indexed by fd. If it is there, it closes, frees the phb and avoids further calls to the callback. If it is not in there, it just does closesocket()
* proxy: Turn phb_close() into phb_free(), use it for all g_free(phb)dequis2015-10-26-35/+40
| | | | More cleanup.
* proxy: Use an array of function pointers for proxy_connect_*dequis2015-10-25-10/+15
| | | | Just cleanup.
* socks4a proxy support (like socks4 with remote DNS)dequis2015-10-21-7/+26
| | | | | | | | | Fixes trac ticket 995 https://bugs.bitlbee.org/bitlbee/ticket/995 This is slightly pointless for the suggested use case (tor), since with socks5 we already send a hostname instead of an IP address. Either way, it was easy to implement, so I hope it helps.
* Allow NULL callback functions in http_dorequestArtem Savkov2015-10-08-3/+7
| | | | | | | | | Check callback function supplied to http_dorequest and only run it if it is not NULL. While it is not the usual case there are some times when there is no need to check the results of a http request. Using a NULL pointer is much more convenient than creating noop functions.
* Replace <br/> and <br /> with \n in strip_htmlAndré Glüpker2015-10-08-0/+4
|
* typofix - https://github.com/vlajos/misspell_fixerVeres Lajos2015-08-07-1/+1
|
* Fix NULL pointer dereference in lib/json.c. (#1220)Wilmer van der Gaast2015-06-17-1/+1
|
* Move twitter_parse_id() to parse_int64() in misc.cdequis2015-05-30-0/+17
|
* More coverity fixes!dequis2015-05-07-2/+8
| | | | | | | | | | CID 18634: 'Logically dead code' in jabber_get_info CID 18638: 'Dereference after null check' in oauth2_access_token_done CID 18691: 'Copy into fixed size buffer' in bee_irc_user_new CID 20274: Leak in bee_irc_chat_invite CID 20297, CID 20283: Leaks in crypt_main Some the base64 leaks there weren't detected, needs modeling.
* events_glib: fix parameter type warnings in event_debug() callsdequis2015-05-05-4/+4
|
* oauth: fix use-after-free of the ->next of the listdequis2015-04-24-2/+3
| | | | | | | Third time's the charm. Previous attempt fixed something and broke something else. Whatever. Definitely valgrind clean this time.
* get_rfc822_header: allow headers at the end of a stringdequis2015-04-10-5/+0
|
* proxy: minor refactor, simplify error handlingdequis2015-04-05-110/+36
|
* Fix a bunch of memory leaksdequis2015-03-22-8/+4
| | | | | | | | | | | | | | | | | | | - irc_im.c: - bee_irc_user_msg: strdup leaks when otr swallows messages - bee_irc_user_action_response: GString leak in all ctcp replies - otr.c: - call g_slist_free() on the list of the otr_policy setting - otr_filter_msg_in: call otrl_tlv_free() if "tlvs" are returned - otr_filter_msg_out: don't g_strdup() if the message should be ignored - log_otr_message: g_strdup_vprintf() leaks always - nogaim.c: - imcb_ask_auth/imcb_ask_add: leaks in g_strdup_printf() - imcb_ask_add leaks imcb_ask_cb_data if the user already exists - add imcb_ask_cb_free() to correctly free its data - msn_util.c: add msn_buddy_ask_free(), ditto - storage_xml.c: pass_cr/password if base64_decode or arc_decode fail - ssl_gnutls.c: conn->hostname leak in error conditions, like invalid certs - jabber_util.c: jabber_buddy_by_ext_jid() leaks jid if it's not an ext jid
* Refactor oauth_params_del to fix use-after-free that i introduceddequis2015-02-28-8/+7
| | | | | | | Yeah ok that was dumb. This is essentially just using a 'data' variable instead of 'l->data', but i went ahead and cleaned up the function.
* coverity: Fix some (harmless?) use-after-free with g_slist_remove()dequis2015-02-22-1/+1
| | | | | | | These were passing a pointer to a variable right after it was g_free()'d They are most likely harmless as g_slist_remove() probably just needs the pointer location, but fixing it anyway.
* Reindent everything to K&R style with tabsIndent2015-02-20-3705/+3716
| | | | | | | Used uncrustify, with the configuration file in ./doc/uncrustify.cfg Commit author set to "Indent <please@skip.me>" so that it's easier to skip while doing git blame.
* Use glib's GChecksum for md5/sha1dequis2015-01-31-733/+58
| | | | | | | | | | | | | | | | | | | This changes behavior slightly: - md5_init()/sha1_init() allocate a GChecksum - md5_finish()/sha1_finish() close and free() it - md5_digest_keep() was added (no sha1 equivalent needed) And yes, glib has this concept of "closing" the GChecksum, which means it can't be used anymore after g_checksum_get_digest(). jabber_cache_add() actually seems to need to do that to generate some random-ish values, so i kept that working by adding a md5_digest_keep() function that copies the GChecksum before it gets closed GChecksum was introduced in glib 2.16, so the configure script version was bumped. We were already depending on glib 2.16 accidentally (some post-3.2.2 code uses GHashTableIter)
* random_bytes: Use /dev/urandom only, don't bother trying /dev/randomdequis2015-01-26-59/+10
| | | | | | Also abort() if there's no /dev/urandom See http://www.2uo.de/myths-about-urandom/ for details.
* Fix UTF8 nick truncation issuesdequis2015-01-16-0/+10
| | | | | | | | | | | | | | When nicks exceeded the length limit, they were cut at 24 bytes and that sometimes left invalid utf8 at the end, which made the nick_ok() validation fail and often broke those nicks completely. This adds a truncate_utf8 function to cut the string at a safe place Also, the method to deduplicate nicks when there's no more place to add underscores was changed to add "_XX" at the end, where XX are two random hex chars. The previous method in those cases was increasing the value of the first character of the nick... which leads to silly and confusing results (i.e. FacebookUser -> GacebookUser)