Commit Graph

258 Commits

Author SHA1 Message Date
Jan Vidar Krey
35d8088b44 Handle socket errors from connected clients.
If a TLS error occurs, it could end up in a situation where the network handler code did not want to
read or write because it only had the error flag set. However, this was not handled, which left the
socket triggering in the event loop - but nothing was done to handle it.

This can easily cause a 100% cpu situation - the hub is still functioning though while this is
happening.
2019-12-13 10:51:40 +01:00
Jan Vidar Krey
cff10910ad Issue 72: Improve ghost user detection
uhub has the ability to disconnect a 'ghost' user, e.g. if a user
reconnects then uhub will kick the existing user if it is still there.
However, this could also be triggered abusively by having two "tabs" or windows
connect at the same time from the same client. The process of connecting a new
client is rather expensive because it triggers a lot of updates on all connections.

With this change, uhub will only attempt to disconnect the existing client if
it is marked with the "flag_choke" flag, which indicates that messages must be
dropped simply because the client is not accepting data fast enough. This will
cause the new connection to fail because the user is already logged in.

This can be further improved by adding a timestamp for when the connection
previously was provable working. Which is possibly a better and more reliable
way of detecting ghost users.
2019-12-01 13:16:28 +01:00
Jan Vidar Krey
78a7039240 Fix CPU spikes for TLS connections using incompatible TLS protocol versions. 2019-06-18 16:01:44 +02:00
Boris Pek
cf3a6e06df Secure URLs: http --> https (part 2) 2019-04-23 15:59:03 +02:00
Jan Vidar Krey
46906a9a9c Merge branch 'master' of github.com:janvidar/uhub 2019-03-15 11:31:29 +01:00
Boris Pek
d25fead3a8 Fix spelling errors 2019-02-25 19:46:24 +01:00
Boris Pek
ef83b31cec Fix spelling errors 2019-02-25 19:46:24 +01:00
Jan Vidar Krey
c383a53105 Fix crash if unable to load plugin. 2018-11-21 11:00:20 +01:00
Kcchouette
f0b67ea4cd Update config.xml 2018-11-20 11:56:07 +01:00
Jan Vidar Krey
dc80644471 Merge pull request #28 from klondi/unrestricted_users
Allow unrestricted users on uhub
2014-12-15 09:36:49 +01:00
Jan Vidar Krey
0e27e4219d Merge pull request #30 from klondi/mimicfixes
Mimicfixes
2014-11-25 07:55:56 +01:00
Michal Micka
6ad5efea6d Fix: Make config parser python 3 compatible 2014-11-24 16:08:47 +01:00
klondike
19068de088 Make unrestricted... unrestricted 2014-11-24 12:11:54 +01:00
klondike
d86ef503b3 Add opbots and unrestricted bots 2014-11-24 12:11:11 +01:00
Andre Schreder
2d45a37536 added broadcast message and getter for user count in plugin API 2014-10-03 15:23:36 +02:00
Jan Vidar Krey
1da917e5b9 Fix crash due to negative max copy length. 2014-09-23 00:01:15 +02:00
Jan Vidar Krey
1526d63403 Simplify list_clear(), allow NULL as free() function pointer.
This makes it redundant to create a null_free() or dummy_free() function
that does nothing.
2014-08-05 13:08:46 +02:00
Jan Vidar Krey
652ac5f9b9 Fix #211 - ADC IINF should have flag AP for application name, and VE for version.
x# Please enter the commit message for your changes. Lines starting
2014-08-03 22:51:47 +02:00
Jan Vidar Krey
4263750bc5 Merge branch 'ssl_fixes' 2014-07-30 11:47:27 +02:00
Jan Vidar Krey
2182feb052 Added support for probing HTTP, enough to tell browsers to stop calling. 2014-07-30 11:46:54 +02:00
Jan Vidar Krey
b85381c0f5 Added configuration options for TLS cipher suites and TLS versions. 2014-07-29 13:31:42 +02:00
Jan Vidar Krey
7706e1cb8a Fix copyright year. 2014-05-14 11:39:18 +02:00
Jan Vidar Krey
24b98358d3 Remove usage of strcat, since OpenBSD does not like that. 2014-05-14 11:00:18 +02:00
Tilka
591d0ba5bb Support certificate chains 2013-09-06 01:44:25 +02:00
Tilka
a81757c483 Merge remote-tracking branch 'upstream/master' 2013-09-06 01:43:10 +02:00
Jan Vidar Krey
cf9be754aa Rewrote the configuration file parser generator.
Converted from Perl to Python for a better
and cleaner object oriented design.
2013-04-22 21:58:06 +02:00
Jan Vidar Krey
cd5c4ee622 Optimize lookups by CID and nick.
This used to be a linear search O(n), but is now done
as a red-black tree O(log n) instead.

These operations can be further opimized with a hash-table
which would acheive near constant time lookups.
2013-03-23 22:11:05 +01:00
Jan Vidar Krey
52211a6bac Updated copyright year. 2013-03-22 20:00:40 +01:00
Jan Vidar Krey
f25015927a Clean up white space. 2013-03-22 20:00:40 +01:00
Jan Vidar Krey
5835a06676 Removed redundant debug printf. 2013-03-22 20:00:40 +01:00
Jan Vidar Krey
6c55ae1146 Simple compile fix. 2013-03-22 20:00:40 +01:00
Jan Vidar Krey
2d6f69d299 Cleaned up usage of linked lists and added missing functionality.
- Added a list_remove_first() which is generally better than list_remove()
  provided you want to remove the first element.
- Added a list_append_list() to append and move all nodes from one list to
  another.
2013-03-22 20:00:40 +01:00
Jan Vidar Krey
b81bb2cbd9 Cleaned up all list iterations, added macro named LIST_FOREACH.
Previously you would have to do something like this:

for (type foo = (type) list_get_first(list); foo; foo = (type) list_get_next(list)
{
    /* code */
}

Now, you can instead write this as:

LIST_FOREACH(type, foo, list,
{
    /* code */
})

Basically, boilerplate stuff including the casting is gone.
2013-03-22 00:58:14 +01:00
Emery
143b68588a Systemd notify support 2012-11-17 09:57:14 -06:00
Emery
ce68c446d1 Optional systemd journal logging 2012-11-11 15:21:00 -06:00
Tillmann Karras
dcc7aa4018 some regex adjustments
IP addresses are now checked for correct charset rather than allowing
everything.
2012-11-08 12:36:37 +01:00
Tilka
9dce6693f6 fix error messages and comments 2012-11-08 12:27:08 +01:00
Jan Vidar Krey
4385266bb7 Free all memory in case the hub does not start because of port already in use. 2012-10-17 20:54:46 +02:00
Jan Vidar Krey
50912bdf75 More work on splitting out OpenSSL specific bits. 2012-10-15 20:39:03 +02:00
Jan Vidar Krey
f20c42d05f Wrapped everything OpenSSL related in a SSL_USE_OPENSSL check macro. 2012-10-02 23:59:11 +02:00
Jan Vidar Krey
3ea38c59af Better reporting using the !stats command. 2012-10-02 23:59:11 +02:00
Jan Vidar Krey
e4fc91dde1 Made the network statistics work again. 2012-10-02 23:59:11 +02:00
Jan Vidar Krey
61073bd304 Fix rare protocol parse error due to incorrect recv queue handling. 2012-10-03 13:49:50 +02:00
Jan Vidar Krey
089966d918 Fix ADC client send queue. 2012-10-03 11:44:07 +02:00
Jan Vidar Krey
fc52f0e030 Renamed the hub_sendq and hub_recvq to ioq_send and ioq_recv. 2012-09-28 09:24:04 +02:00
Jan Vidar Krey
845aefc941 Decouple hub and user manager more cleanly. 2012-09-27 15:29:00 +02:00
Jan Vidar Krey
4fcf3ffc83 Add support for configuration options that depend on certain #ifdefs. 2012-09-27 15:28:46 +02:00
Jan Vidar Krey
cba0121574 ADCH++ had a security bug that allowed UCMD extension to be relayed.
uhub did not have this security bug since the hub did not advertise support for the
UCMD extension, but the message was still correctly relayed as specified in the
protocol specification.

However, this commit adds support for the UCMD extension, but only to the extent
that uhub will advertise it and uhub will also drop any such CMD message
generated by a client and will (currently) never issues a CMD message by itself.
2012-07-30 00:08:12 +02:00
Yorhel
b9005b1724 core/probe.c: Fix TLS probe when handshake version != SSL version
GnuTLS sends a handshake with SSL 3.0 (0x0300) in the outer packet, but
mentions TLS 1.2 (0x0303) in the Client Hello. There's no real need for
uhub to validate these fields, as OpenSSL should do that itself already.
Just use the version mentioned in Client Hello for logging output.
2012-06-02 14:46:47 +02:00
Jan Vidar Krey
571abddd98 Cleaned up code generator for config file parsing. 2012-05-23 23:37:42 +02:00